You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When x = Fun() and a = abs(x) the value of norm(x - a, Inf) is incorrectly reported as 0.0, whereas norm(a - z, Inf) is correctly reported as 2.0. I found another example of this on the web. Details below.
macd@macd-NUC9:~$ julia19
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.2 (2023-07-05)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia @v1.9> using ApproxFun
julia @v1.9> x = Fun()
Fun(Chebyshev(), [0.0, 1.0])
julia @v1.9> a = abs(x)
Fun(ContinuousSpace{Float64, Float64, PiecewiseSegment{Float64, Vector{Float64}}}(PiecewiseSegment{Float64, Vector{Float64}}([-1.0, -0.0, 1.0])), [1.0, 5.55112e-17, 1.0])
julia @v1.9> norm(x - a, Inf)
0.0
julia @v1.9> norm(a - x, Inf)
2.0
julia @v1.9> # This behavior was noted before in:
# https://www.cs.purdue.edu/homes/dgleich/cs514-2021/julia/Lecture-7-Approximation.html
# (search for "why is this negative???")
# But note that this works OK for the normal domain of [-1, 1]
xx = Fun(Chebyshev(1..5))
Fun(Chebyshev(1 .. 5), [3.0, 2.0])
julia @v1.9> f = exp(xx);
julia @v1.9> g = exp(-xx);
julia @v1.9> norm(f - g, Inf)
148.40642115557753
julia @v1.9> norm(g - f, Inf)
-2.3504023872875983
julia @v1.9>
The text was updated successfully, but these errors were encountered:
When
x = Fun()
anda = abs(x)
the value ofnorm(x - a, Inf)
is incorrectly reported as 0.0, whereasnorm(a - z, Inf)
is correctly reported as 2.0. I found another example of this on the web. Details below.The text was updated successfully, but these errors were encountered: