diff --git a/extra/math/derivatives/derivatives.factor b/extra/math/derivatives/derivatives.factor index fef93cabc4..d92066efaf 100644 --- a/extra/math/derivatives/derivatives.factor +++ b/extra/math/derivatives/derivatives.factor @@ -3,7 +3,8 @@ USING: kernel math math.points math.function-tools ; IN: math.derivatives -: small-amount ( -- n ) 1.0e-12 ; -: near ( x -- y ) small-amount + ; -: derivative ( x function -- m ) 2dup [ near ] dip [ eval ] 2bi@ slope ; +: small-amount ( -- n ) 1.0e-14 ; +: some-more ( x -- y ) small-amount + ; +: some-less ( x -- y ) small-amount - ; +: derivative ( x function -- m ) [ [ some-more ] dip eval ] [ [ some-less ] dip eval ] 2bi slope ; : derivative-func ( function -- function ) [ derivative ] curry ; \ No newline at end of file