\ 4tH library - FERF - Copyright 2009 J.L. Bezemer \ You can redistribute this file and/or modify it under \ the terms of the GNU General Public License \ include lib/ansfloat.4th [UNDEFINED] ferf [IF] [UNDEFINED] pi [IF] include lib/fpconst.4th [THEN] [UNDEFINED] >taylor [IF] include lib/taylor.4th [THEN] : ferf fdup f0< fdup fabs s" 1.86" s>float f< if drop else fdrop 1 s>f if fnegate then exit then fdup >taylor 3 -taylor 10 +taylor 42 -taylor 216 +taylor 1320 -taylor 9360 +taylor 75600 -taylor 685440 +taylor 6894720 -taylor 76204800 +taylor 918086400 -taylor fdrop fdrop 2 s>f pi fsqrt f/ f* ; [THEN] \ : ferf-test \ fclear 10 set-precision \ -2 s>f begin \ fdup 2 s>f F< \ while \ fdup fdup f. ferf f. cr \ s" 0.05" s>float f+ \ repeat fdrop fdepth . depth . \ ; ferf-test