```\ 5 point Gauss-Laguerre integration

MARKER -gauss

needs ftran111.f

12.640800844276e0    FVARIABLE x4  x4  F!
7.085810005859e0    FVARIABLE x3  x3  F!
3.596425771041e0    FVARIABLE x2  x2  F!
1.413403059107e0    FVARIABLE x1  x1  F!
0.263560319718e0    FVARIABLE x0  x0  F!

5.21755610583e-1    FVARIABLE w0  w0  F!
3.98666811083e-1    FVARIABLE w1  w1  F!
7.59424496817e-2    FVARIABLE w2  w2  F!
3.61175867992e-3    FVARIABLE w3  w3  F!
2.33699723858e-5    FVARIABLE w4  w4  F!

v: fdummy

: )int      ( f: a b -- integral)  ( xt --)
defines  fdummy
f" w0 * fdummy(x0) + w1 * fdummy(x1) + w2* fdummy(x2)
+ w3 * fdummy(x3) + w4 * fdummy(x4) "
;

FALSE [IF]

Examples:

10 set-precision

use( fcos )int f. .5005384852  ok       \ exact = 0.5

: f1   f2*  fcos  ;                     \ cos(2x)
use( f1 )int f. .1183827839  ok         \ exact = 0.2

use( fsin )int f. .4989033210  ok       \ exact = 0.5

: f2   f2*  fsin  ;  ok                 \ sin(2x)
use( f2 )int f. .4494545483  ok         \ exact = 0.4

: f3   fdup  f^4  f*   fdup  2e0 f-  f*  1e0 f+  ;   \ x^10 - 2x^5 + 1
use( f3 )int f. 3614161.000  ok         \ exact = 3628561

: f4   f^4  fdup  2e0 f-  f*  1e0  f+  ;  ok  \ x^8 - 2x^4 + 1
1e0 f4 f. .0000000000  ok
2e0 f4 f. 225.0000000  ok

use( f4 )int f. 40273.00000  ok         \ exact =  40273
[THEN]
```