I picked up that you're using some of the FP words from 4tH - THANK YOU!
You "reported" an error of the Taylor series. That is not true. The sources
you probably used are for the Brad Eckert FP implementation, which has a
SEPARATE FP stack. The "bug" you experienced and the way you solved it
indicates to me you're using a SHARED FP stack.
Fortunately, 4tH also features an FP implementation with a shared FP stack,
called Zen FP. Sometimes, it might be better to get your inspiration there
with the following notes:
- Zen FP uses 2 cells numbers, one for the mantissa and one for the exponent.
Consequently, 2OVER is FOVER, 2DUP is FDUP, etc.
- 4tH is geared towards 32 bit cells at least. Yours seems to be 16 bit, so
sometimes you will need to treat 4tH numbers as double numbers (as you did in
the Taylor series).
I hope these few notes will enable you to implement a full range of FP words
(just like me ;-) ) if you haven't done so already.
I picked up that you're using some of the FP words from 4tH - THANK YOU!
You "reported" an error of the Taylor series. That is not true. The sources
you probably used are for the Brad Eckert FP implementation, which has a
SEPARATE FP stack. The "bug" you experienced and the way you solved it
indicates to me you're using a SHARED FP stack.
Fortunately, 4tH also features an FP implementation with a shared FP stack,
called Zen FP. Sometimes, it might be better to get your inspiration there
with the following notes:
- Zen FP uses 2 cells numbers, one for the mantissa and one for the exponent.
Consequently, 2OVER is FOVER, 2DUP is FDUP, etc.
- 4tH is geared towards 32 bit cells at least. Yours seems to be 16 bit, so
sometimes you will need to treat 4tH numbers as double numbers (as you did in
the Taylor series).
I hope these few notes will enable you to implement a full range of FP words
(just like me ;-) ) if you haven't done so already.
Hans Bezemer