]> gitweb.factorcode.org Git - factor.git/commitdiff
picomath: simplify.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 May 2015 21:47:15 +0000 (14:47 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 May 2015 21:47:15 +0000 (14:47 -0700)
extra/picomath/picomath.factor

index abbcb81e2787dcc0c43cbc47e253c88418ae2b3f..ff614b58d283c2db9faca51dfa655d0efc8c0532 100644 (file)
@@ -22,7 +22,7 @@ PRIVATE>
 :: erf ( x -- value )
     x 0 >= 1 -1 ? :> sign
     x abs :> x!
-    p x * 1 + 1 swap / :> t
+    p x * 1 + recip :> t
     a5 t * a4 + t * a3 + t * a2 + t * a1 + t *
     x x neg * e^ * 1 swap - :> y
     sign y * ;
@@ -34,7 +34,7 @@ PRIVATE>
 :: phi ( x -- value )
     x 0 >= 1 -1 ? :> sign
     x abs 2 sqrt / :> x!
-    p x * 1 + 1 swap / :> t
+    p x * 1 + recip :> t
     a5 t * a4 + t * a3 + t * a2 + t * a1 + t *
     x x neg * e^ * 1 swap - :> y
     sign y * 1 + 2 / ;