Re: Forth PARANOIA
- From: mhx@xxxxxx (Marcel Hendrix)
- Date: Thu, 28 May 2009 21:43:32 +0200
Andrew Haley <andrew29@xxxxxxxxxxxxxxxxxxxxxxx> writes Re: Forth PARANOIA
Ed <nospam@xxxxxxxxxxx> wrote:[..]
For example most F** do not permit x<0 and some do not
even allow any x=0 cases.
This is because few chips have a power function so it has to be
synthesized with log/exp. The basic form is:
: F** ( x y -- r ) FSWAP FLN F* FEXP ;
Because the first step is log(x) it automatically excludes all
x <= 0.
SwiftForth's F** stops at this point and I'm not sure it's a bad
thing. It's clean and fast.
It's ok because 80-bit intermediate precision is used. If not, it
produces fairly large errors for bases with large magnitudes. This is
an important quality of implementation issue, IMO.
Surely F** should support x^y where y is allowed to be negative.
SwiftForth i386-Win32 3.1.3 29-Feb-2008
CHOOSE-OPTIONS ok
INCLUDING-OPTION C:\ForthInc\SWIFTFORTH\LIB\OPTIONS\` fpmath.f ok
2e -8e F** f. 0.0039062 ok
But unfortunately
0e 8e F** f. FLOAT_INVALID_OPERATION
0e -8e F** f. FLOAT_INVALID_OPERATION
-marcel
.
- Follow-Ups:
- Re: Forth PARANOIA
- From: Coos Haak
- Re: Forth PARANOIA
- References:
- Re: Forth PARANOIA
- From: Andrew Haley
- Re: Forth PARANOIA
- Prev by Date: Re: "the forth branch of this government"
- Next by Date: Re: Forth PARANOIA
- Previous by thread: Re: Forth PARANOIA
- Next by thread: Re: Forth PARANOIA
- Index(es):
Relevant Pages
|
Loading