- DFALIGN
- DFALIGNED
- DFFIELD:
- DF@
- DFLOAT+
- DFLOATS
- DF!
- D>F
- FABS
- FACOS
- FACOSH
- FALIGN
- FALIGNED
- FALOG
- FASIN
- FASINH
- FATAN
- FATANH
- FATAN2
- FCONSTANT
- FCOS
- FCOSH
- FDEPTH
- FDROP
- FDUP
- F/
- FEXP
- FEXPM1
- FE.
- FFIELD:
- F@
- FLITERAL
- FLN
- FLNP1
- FLOAT+
- FLOATS
- FLOG
- FLOOR
- FMAX
- FMIN
- F-
- FNEGATE
- FOVER
- F+
- FROT
- FROUND
- FSIN
- FSINCOS
- FSINH
- FSQRT
- FSWAP
- FS.
- F!
- FTAN
- FTANH
- FTRUNC
- F*
- F**
- FVALUE
- FVARIABLE
- F0=
- F0<
- F.
- F<
- F~
- F>D
- F>S
- PRECISION
- REPRESENT
- SET-PRECISION
- SFALIGN
- SFALIGNED
- SFFIELD:
- SF@
- SFLOAT+
- SFLOATS
- SF!
- S>F
- >FLOAT
12.6.2.1516 FEXPM1 f-e-x-p-m-one FLOATING EXT
( F: r1 -- r2 ) or
( r1 -- r2 )
Raise e to the power r1 and subtract one, giving r2.
See:
Rationale:
This function allows accurate computation when its arguments
are close to zero, and provides a useful base for the standard
exponential functions. Hyperbolic functions such as
sinh(x) can be efficiently and accurately
implemented by using FEXPM1; accuracy is lost in this
function for small values of x if the word FEXP is
used.
An important application of this word is in finance; say a loan is repaid at 15% per year; what is the daily rate? On a computer with single-precision (six decimal digit) accuracy:
- Using FLN and FEXP:
FLN of 1.15 = 0.139762,
divide by 365 = 3.82910E-4,
form the exponent using FEXP = 1.00038, and
subtract one (1) and convert to percentage = 0.038%.
- Using FLNP1 and FEXPM1:
FLNP1 of 0.15 = 0.139762, (this is the same value
as in the first example, although with the argument closer
to zero it may not be so)
divide by 365 = 3.82910E-4,
form the exponent and subtract one (1) using FEXPM1 = 3.82983E-4, and
convert to percentage = 0.0382983%.