Opened 9 years ago

Last modified 4 years ago

#10087 new defect

bug with fast_float, imag and sqrt : NotANumber isn't fine.

Reported by: fmaltey Owned by: burcin
Priority: major Milestone:
Component: symbolics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps: todo

Description

I'm looking at the float result of y by fast_float for m=0.0 :

var('m')
y=imag(sqrt(1+sqrt(m-1)))
fast_float (y, m)(0)     # I get nan

Now I try the constant function (without m), the value must be the previous one for m=0.

z=imag(sqrt(1+sqrt(-1)))
fast_float(z,m)(0)  # I get the right 0.45...=2^(1/4)*sin(pi/8)

I feel (but I can't prove) that this bug is near from the #7165 bug I found in parametric_plot [that maybe calls fast_float in this case].

When I read the y.imag() value, there is at the end a fuzzy ...*sqrt(abs(sqrt(m-1)+1)) This sqrt(m-1) is Not_A_Number if m=0 because fast_float only uses real numbers. So this call might be replaced by an other expression, with real part and imaginary part.

There is no expression as sqrt(1+sqrt(-1)) in z.imag() and Sage runs right.

F.

Change History (1)

comment:1 Changed 4 years ago by jakobkroeker

  • Stopgaps set to todo
Note: See TracTickets for help on using tickets.