

|
 |
| Programming > Forth > Re: Taylor seri... |
|
| << Topic |
< Post |
Post 3 of 6 Topic 4019 of 4053
|
Post > |
Topic >> |
Re: Taylor series FSIN, FCOS, FTAN
by "The Beez'" <hansoft@[EMAIL PROTECTED]
>
Apr 27, 2008 at 08:32 AM
| On Apr 27, 12:30 pm, Albert van der Horst <alb...@[EMAIL PROTECTED]
>
wrote:
> For large values you should do range reduction. It amount to
> subtraction multiples of 2*pi and such. At least try to land
> in the [-PI, PI] interval.
> It is wise to at least take that from the sources I supplied. This
> greatly affects precision. If you omit range reduction, with your
> Taylor series, it still works in principle.
> For Chebychev it breaks down.
: REDUCE.2PI \ x
PI*2 \ x pi2
FOVER FOVER F/ \ x pi2 x/pi2
FLOOR \ x pi2 i(x/pi2)
FOVER F* \ x pi2 mod(x,pi2)
FROT \ PI2 MOD(X,PI2) X
FSWAP F- \ PI2 MOD(X,PI2)
FOVER 2E F/ FOVER \ PI2 MOD PI MOD
F< IF FSWAP F- ELSE FNIP THEN ;
I took this one from your source, but I'm unable to figure out what
you're trying to do at:
FOVER 2E F/ FOVER \ PI2 MOD PI MOD
Where does "2E" come from all of a sudden? And why isn't it converted
to a float before using it?
Hans Bezemer


|
6 Posts in Topic:
|
"The Beez'" < |
2008-04-26 04:12:45 |
|
Albert van der Horst < |
2008-04-27 10:30:59 |
|
"The Beez'" < |
2008-04-27 08:32:25 |
|
Albert van der Horst < |
2008-04-27 17:04:51 |
|
"The Beez'" < |
2008-04-27 08:45:45 |
|
"The Beez'" < |
2008-04-28 02:33:38 |
|
Post A Reply:

|
|
|
|