1 (edited by joe 2011-09-23 22:49:29)

Topic: Absolute value error

It seems there's some error when i want to interpret abs(x) as (x^2)^.5
How come?

Post's attachments

Attachment icon Error.grf 885 b, 541 downloads since 2011-09-23 

Re: Absolute value error

The reason is rounding errors. Because of rounding ((1-x)^2)^.5+((1-a)^2)^.5 sometimes becomes less than ((x-a)^2)^.5. It is not much but enough. I hope to find a way to solve this in a future version. A workaround that works now is to add an offset like ((1-x)^2)^.5+((1-a)^2)^.5>=((x-a)^2)^.5 - 0.0001