On Fri, Nov 12, 2010 at 3:44 PM, Derrick <we.sana...@gmail.com> wrote:
> Any clue why bool(arcsin(x) == 2*arctan(x/(1+sqrt(1-x^2)))) returns
> false where the expressions are mathematically equivalent.

Because an expression being equal to zero is, in general, and
undecideable question. If it can't tell, it'd rather error on the side
of caution (not being equal) than claim they're equal.

> I found that arcsin(x) - 2*arctan(x/(1+sqrt(1-x^2))) is not exactly 0
> for all x in [-1,1].

True. You can't even represent arcsin(x) exactly as a floating point
number for most values of x. There's rounding error and all when you
combine operations as well.

> In sage, is there any way to compare expressions
> with some numerical precision?

sage: expr.subs(x=1/3).n()
0.000000000000000
sage: expr.subs(x=1/3).n(100)
3.9443045261050590270586428264e-31
sage: expr.subs(x=1/3).n(1000)
0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

- Robert

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to