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

arccos and arcsin

Open MikaelSlevinsky opened this issue 8 years ago • 4 comments

Firstly, they need a minor fix, since acos(x) has an infinite coefficient:

julia> acos(Fun(identity,-1.0..0.0))
Fun((1+x)^-0.5[Chebyshev(【-1.0,0.0】)]⊕ConstantSpace,[-1.07871, Inf, -1.10822, -0.0317578, -0.0024717, -0.000253871, -2.97623e-5, -3.7712e-6, -5.02982e-7, -6.957e-8  …  -1.43517e-9, -2.11848e-10, -3.17037e-11, -4.79914e-12, -7.33506e-13, -1.13072e-13, -1.75372e-14, -2.72287e-15, -4.24105e-16, -9.27329e-17])

Secondly, something needs to be done when the interval is the entire real domain of acos:

julia> acos(Fun())
Fun(Chebyshev(【-1.0,1.0】)⊕(1-x^2)^-0.5[Chebyshev(【-1.0,1.0】)],[Inf, -9.11317e-16, -1.98721, 0.487335, 2.44702e-17, 6.0567e-16, 0.629283, -0.712968, 7.35972e-19, 8.33032e-17  …  -3.59057e-17, 4.66159e-17, -1.62015e-18, -3.56283e-35, -3.50061e-17, 8.05625e-21, 0.0, -1.50605e-35, 0.0, 1.15429e-20])

The approximation space is wrong, since it should have a square-root singularity at the right endpoint. Perhaps it's best done via a PiecewiseSpace?

MikaelSlevinsky avatar Sep 18 '17 19:09 MikaelSlevinsky

umm, acos does have square root singularities at both ±1 ….

On 18 Sep 2017, at 20:36, Richard Mikael Slevinsky [email protected] wrote:

Firstly, they need a minor fix, since acos(x) has an infinite coefficient:

julia> acos(Fun(identity,-1.0..0.0)) Fun((1+x)^-0.5[Chebyshev(【-1.0,0.0】)]⊕ConstantSpace,[-1.07871, Inf, -1.10822, -0.0317578, -0.0024717, -0.000253871, -2.97623e-5, -3.7712e-6, -5.02982e-7, -6.957e-8 … -1.43517e-9, -2.11848e-10, -3.17037e-11, -4.79914e-12, -7.33506e-13, -1.13072e-13, -1.75372e-14, -2.72287e-15, -4.24105e-16, -9.27329e-17]) Secondly, something needs to be done when the interval is the entire real domain of acos:

julia> acos(Fun()) Fun(Chebyshev(【-1.0,1.0】)⊕(1-x^2)^-0.5[Chebyshev(【-1.0,1.0】)],[Inf, -9.11317e-16, -1.98721, 0.487335, 2.44702e-17, 6.0567e-16, 0.629283, -0.712968, 7.35972e-19, 8.33032e-17 … -3.59057e-17, 4.66159e-17, -1.62015e-18, -3.56283e-35, -3.50061e-17, 8.05625e-21, 0.0, -1.50605e-35, 0.0, 1.15429e-20]) The approximation space is wrong, since it should have a square-root singularity at the right endpoint. Perhaps it's best done via a PiecewiseSpace?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JuliaApproximation/ApproxFun.jl/issues/540, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLDqdEyBay7NWvxvYpT8jgsF2YfNaaHks5sjsZLgaJpZM4Pba0b.

dlfivefifty avatar Sep 18 '17 19:09 dlfivefifty

Then it's not working correctly, since it's returning inverse square-roots.

MikaelSlevinsky avatar Sep 18 '17 19:09 MikaelSlevinsky

ah ok

dlfivefifty avatar Sep 18 '17 19:09 dlfivefifty

Probably the zero-endpoint conditions are currently being encoded in the coefficients à la Dirichlet spaces.

MikaelSlevinsky avatar Sep 18 '17 19:09 MikaelSlevinsky