From: Alan G I. <ai...@am...> - 2006-05-25 20:28:23
|
On Thu, 25 May 2006, Robert Kern apparently wrote:=20 > Let me clarify. Since you created your values by=20 > multiplying the floating-point approximation pi by an=20 > integer value. When you perform the operation % (2*pi) on=20 > those values, the result happens to be exact or nearly so=20 > but only because you used the same approximation of pi.=20 > Doing that operation on an arbitrary value (like 1000000)=20 > only introduces more error to the calculation.=20 > Floating-point sin(1000000.0) should return a value within=20 > eps (~2**-52) of the true, real-valued function=20 > sin(1000000). Calculating (1000000 % (2*pi)) introduces=20 > error in two places: the approximation pi and the=20 > operation %. A floating-point implementation of sin(.)=20 > will return a value within eps of the real sin(.) of the=20 > value that is the result of the floating-point operation=20 > (1000000 % (2*pi)), which already has some error=20 > accumulated.=20 I do not think that we have any disgreement here, except=20 possibly over eps, which is not constant for different=20 argument sizes. So I wondered if there was a tradeoff:=20 smaller eps (from smaller argument) for the cost of=20 computational error in an additional operation. Anyway, thanks for the feedback on this. Cheers, Alan |