Post Reply 
Solve() gives wrong answer (r10077)
04-27-2016, 02:14 PM
Post: #4
RE: Solve() gives wrong answer (r10077)
The majority of my regressions tests are with exact data, this explains these kinds of quirks. I believe I can fix
Code:
fsolve(0.04e-16*x^2-2.4e-16*x+30e-16);

For the other example, it's intrinsically not possible to solve it, as explained by Han. Binary floats can only represent exactly rationals with a denominator dividing a power of 2, that's not the case for 0.04=1/25, therefore rounding errors might transform a 0 discriminant to something negative. csolve will return complex roots in this situation.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Solve() gives wrong answer (r10077) - parisse - 04-27-2016 02:14 PM



User(s) browsing this thread: 4 Guest(s)