Re: Tough problem...
- From: "John Herbster" <herb-sci1_AT_sbcglobal.net>
- Date: Tue, 27 Jun 2006 09:00:05 -0500
"Atmapuri" <janez.makovsek@xxxxxxx> wrote
Atmapuri, You are missing the benefit of a lot of expertise by
not including the subject in the subject line. I almost skipped
opening your post myself.
If you pass a large argument to sin or cos, the
result is not accurate.
Of course! That is nature of number representations.
How can sin(2*pi/8) give exactly the square root of 2,
when that result is irrational?
In fact, you loose roughly as many
decimal places, as there are zeros in the argument:
sin(1000) => looses 3 decimal places.
What are you comparing to?
If the computation is done in extended precision,
you have a reserve of 4 decimal places,
Not exactly so.
but sometimes even that is not enough.
Enough for what?
... here is my reasoning:
sin(1000) is computed by the FPU by first
computing the reminder after division by two.
...
Why don't you first subtract out the multiples
of 2*pi?
Regards, JohnH
.
- Follow-Ups:
- Re: Tough problem...
- From: Atmapuri
- Re: Tough problem...
- References:
- Tough problem...
- From: Atmapuri
- Tough problem...
- Prev by Date: Re: Fastcode CompareText B&V
- Next by Date: Re: Tough problem...
- Previous by thread: Tough problem...
- Next by thread: Re: Tough problem...
- Index(es):
Relevant Pages
|