[ANN] LogarithmicNumbers.jl v1.0.0

LogarithmicNumbers.jl is a logarithmic number system for Julia.

It provides signed Logarithmic{T} and unsigned ULogarithmic{T} real number types which store the logarithm of the number. This means you can represent really huge or tiny numbers - useful for things like computing extremely small probabilities.

As I’ve had some interest in it lately, I have tidied up this package, added loads of unit tests, fixed some bugs and called it v1.0.

23 Likes

Great work, thanks! Gonna try it on my HMM code :slight_smile:

1 Like

I saw that LogarithmicNumbers currently adds additional log-numbers-related features to Distributions, StatsFuns and SpecialFunctions. I wonder - if the package is lightweight enough, maybe those packages could actually depend on LogarithmicNumbers? I think there might be interesting possibilities, long-term - for example, cdf could return a logarithmic number in cases where it would just return exp(logcdf(...)) and so on.

CC @devmotion, @mschauer, @andreasnoack

for example, cdf could return a logarithmic number in cases where it would just return exp(logcdf(...)) and so on.

I’m not sure if this is desirable. I imagine that it would be quite surprising if sometimes logarithmic numbers are returned and in many cases you would have to convert the values to standard number types anyway since many functions don’t support logarithmic types (similar to operator overloading AD such as ForwardDiff.Dual). More importantly, it seems you could just use logcdf and wrap the output as a logarithmic number if desired, couldn’t you?

1 Like