Open oscardssmith opened 4 years ago
Not sure either: unfortunately the code didn't cite any references. From what I understand, this is a known problem with the Remez algorithm. I think there are some potential modifications to work around it, but if you widen the interval so that is no longer symmetric, you get a valid answer:
ratfn_minimax(x -> x == 0 ? one(x) : expm1(x)/x, (-1/512,1/512+1e-8), 2, 0,(x,y) -> x)
That mostly works, but if I only modify the interval slightly, I get very high errors (in the hundreds). Is there any way to prevent this from happening automatically?
Probably, but I don't know.
Might be possible to try something like this: https://people.maths.ox.ac.uk/trefethen/vander_revised.pdf
When I run
ratfn_minimax(x -> x == 0 ? one(x) : expm1(x)/x, (-1/512,1/512), 2, 0,(x,y) -> x)[3]
, I get the following error.That said,
ratfn_minimax(x -> x == 0 ? one(x) : expm1(x)/x, (-1/512,1/512), 3, 0,(x,y) -> x)[3]
works just fine. Is there a way to make this not happen or work arround it?