Message-ID: <Pine.A41.4.61b.0503151524570.383546@homer03.u.washington.edu>
Date: 2005-03-16T00:26:48Z
From: Thomas Lumley
Subject: Trigonometric functions (PR#7728)
In-Reply-To: <Pine.LNX.4.44.0503160018280.2246-100000@kleigh.nl>
On Wed, 16 Mar 2005, Peter Kleiweg wrote:
> Thomas Lumley schreef op de 15e dag van de lentemaand van het jaar 2005:
>
>
>>> x<-sqrt(2)
>>> asin(x^2-1)
>>> result in:
>>> NaN
>>
>> Because you can't take the arcsin of 2^2-1=3.
>
> Wrong answer.
You're right. It's actually because you can't take the arcsin of
1+4.4e-16. Same problem, just less extreme.
> x<-sqrt(2)
> x^2-1==1
[1] FALSE
> x^2-1>1
[1] TRUE
> x^2-1-1
[1] 4.440892e-16
-thomas