Working on better POST and PUT requests
[factor/jcg.git] / extra / math / function-tools / function-tools.factor
blob11e57d2639700258f3cbbaae4859977a12430069
1 ! Copyright (c) 2008 Reginald Keith Ford II.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math arrays sequences ;
4 IN: math.function-tools
6 ! Tools for quickly comparing, transforming, and evaluating mathematical functions
8 : difference-func ( func func -- func )
9     [ bi - ] 2curry ; inline
11 : eval ( x func -- pt )
12     dupd call 2array ; inline
14 : eval-inverse ( y func -- pt )
15     dupd call swap 2array ; inline
17 : eval3d ( x y func -- pt )
18     [ 2dup ] dip call 3array ; inline