I am trying to use Optim.jl for univariate functions in tandem with ApproxFun.jl. However, there is a catastrophic bug that requires an awkward workaround. When I evaluate a Fourier series at a point close to zero, ApproxFun gives a completely incorrect result. Below is the minimal code that demonstrates this.
This has also occurred for more complicated functions. Essentially, if I evaluate a Fourier series at some very small x, then the output will be close to zero. Here, 1e-09 is not particularly close to machine precision, so I can't see why this should be happening.
I am trying to use Optim.jl for univariate functions in tandem with ApproxFun.jl. However, there is a catastrophic bug that requires an awkward workaround. When I evaluate a Fourier series at a point close to zero, ApproxFun gives a completely incorrect result. Below is the minimal code that demonstrates this.
Input:
Result:
This has also occurred for more complicated functions. Essentially, if I evaluate a Fourier series at some very small x, then the output will be close to zero. Here, 1e-09 is not particularly close to machine precision, so I can't see why this should be happening.