Gforth on a 64 bit Linux PC @ Intel I7 8 cores 2.2 GHz, HW FPU
: test ( -- ) \ test 1'000 times sin, displays time in us
utime cr
pi 2e f* 1000e f/ \ 2*pi/1000
cr
1000 0 do
\ fdup i s>f f* fdrop
fdup i s>f f* fsin fdrop
\ i . fdup i s>f f* fsin fs. cr
\ i . fdup i s>f f* fsin hex. hex. cr
loop
fdrop
utime 2swap d-
;
64 us, 13 us -> 51 ns for fsin . 2 magnitudes faster than Mecrisp-Cube M4F @ 32 MHz |