Closed jaypaik closed 3 years ago
@jaypaik, thanks for bringing this to my attention.
Am I using this wrong / is there some setting to produce the correct numbers here? Thanks for taking a look!
A quick investigation seems to point at a bug in expand
. I'll have to take a closer look to see exactly what's happening.
expand(-(-100*(10+x)^(-1)+20)^2*(10+x)^2+11000)
gives
-16000000*(10+x)^(-2)*x^2-1600000000*(10+x)^(-2)-29000-320000000*(10+x)^(-2)*x-400*x^2-8000*x
but should give
-(10000*x^2)/(x^2+20*x+100)-(200000*x)/(x^2+20*x+100)-1000000/(x^2+20*x+100)+(4000*x^2)/(x+10)+(80000*x)/(x+10)+400000/(x+10)-400*x^2-8000*x-29000
@jaypaik. Fixed. Quite an interesting issue by the way. It was a lot more involved than I initially thought. It actually ended up exposing three bugs.
Wow, that does seem like a pretty involved fix, and I see you had to deal with what seems like floating point precision issues too. Thanks for the fix and actively maintaining this project to this day. Cheers!
I see you had to deal with what seems like floating point precision issues too
Unfortunately you are correct. Someday I'll find the time and motivation to do a complete conversion to big numbers.
Thanks for the fix and actively maintaining this project to this day. Cheers!
You're welcome and thanks.
Hi!
I'm seeing differences in solutions between
nerdamer
and Wolfram Alpha for this particular call:When taking the output of
diff
and solving it via Wolfram Alpha, it seems to produce the correct results, so it seems the bug is in thesolve
function.Am I using this wrong / is there some setting to produce the correct numbers here? Thanks for taking a look!