hi marcel,
is not only a stack solution for interpolation, is:
1. FACTORED solution to linear interpolation and that imply a better
FLEXIBILITY and REUSABILITY.
2. ROUNDED solution for linear interpolation with increased precision:
running
gforth-0.6.2 with the test program, even for coarse
division for [0,1] interval ( 1024):
\ factored & rounded ----------------------------------------
: round ( a b -- a+b|a-b)
OVER 0> IF + ELSE - THEN ;
: >space ( x1 x0 x -- T) OVER - -ROT - 1024 SWAP */ ;
: space> ( T y0 y1 -- y) OVER - ROT * 512 round 1024 / + ;
: interpl ( y0 y1 x1 x0 x -- y) >space -ROT space> ;