]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/function-tools/function-tools.factor
factor: trim using lists
[factor.git] / extra / math / function-tools / function-tools.factor
index 3f719767d3eecc283208df3ad55535b19faef14a..5481ef8809b1c90ab9f7a07c91858f6d4bea3509 100644 (file)
@@ -1,8 +1,18 @@
-! Copyright © 2008 Reginald Keith Ford II
-! Tools for quickly comparing and evaluating mathematical Factor functions
-
+! Copyright (c) 2008 Reginald Keith Ford II.
+! See http://factorcode.org/license.txt for BSD license.
 USING: kernel math arrays ;
-IN: math.function-tools 
-: difference-func ( func func -- func ) [ bi - ] 2curry ;
-: eval ( x func -- pt ) dupd call 2array ;
-: eval3d ( x y func -- pt ) [ 2dup ] dip call 3array ;
\ No newline at end of file
+IN: math.function-tools
+
+! Tools for quickly comparing, transforming, and evaluating mathematical functions
+
+: difference-func ( func func -- func )
+    [ bi - ] 2curry ; inline
+
+: eval ( x func -- pt )
+    dupd call( x -- y ) 2array ; inline
+
+: eval-inverse ( y func -- pt )
+    dupd call( y -- x ) swap 2array ; inline
+
+: eval3d ( x y func -- pt )
+    [ 2dup ] dip call( x y -- z ) 3array ; inline