LogExpFunctions.jl icon indicating copy to clipboard operation
LogExpFunctions.jl copied to clipboard

`log2mexp(x)` accuracy vanishes around the right edge of the domain, at `log(2)`

Open nsajko opened this issue 5 months ago • 4 comments

The error in ULPs (here for log2mexp(x::Float64)) has a spike at the right endpoint of the domain:

Image

The base of the spike:

Image

~~A problem is that the doc string for some reason promises the exact current implementation, so fixing this bug requires a breaking change.~~

nsajko avatar Aug 02 '25 13:08 nsajko

Technically the 1.0 release did not go through, so I would be OK with a breaking change in the docs, especially if we can improve on accuracy in practice.

tpapp avatar Aug 06 '25 08:08 tpapp

@nsajko, if you are planning to make a fix, I can wait with 1.0 (no pressure).

tpapp avatar Aug 20 '25 09:08 tpapp

I'm not able to help, and don't know how difficult a fix might be, or if it is even possible.

nsajko avatar Aug 21 '25 13:08 nsajko

I tried employing RationalFunctionApproximation to construct an approximation, however that didn't pan out.

nsajko avatar Aug 21 '25 13:08 nsajko