]> gitweb.factorcode.org Git - factor.git/commitdiff
math.functions: adding lgamma
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 19 Aug 2023 05:08:01 +0000 (22:08 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 19 Aug 2023 05:08:16 +0000 (22:08 -0700)
basis/math/functions/functions.factor
basis/math/libm/libm.factor

index 0c1ce94b031b12822dbe012aaa5435dc262fcdf9..5ac743b76c98ed27eba6a3359274b2cf7461b48a 100644 (file)
@@ -198,6 +198,12 @@ M: complex log >polar [ flog ] dip rect> ; inline
 
 : logn ( x n -- y ) [ log ] bi@ / ;
 
+GENERIC: lgamma ( x -- y )
+
+M: float lgamma flgamma ;
+
+M: real lgamma >float lgamma ;
+
 <PRIVATE
 
 : most-negative-finite-float ( -- x )
index 1149695414c65cd78894038a24e9178ccfc5d680..04ee64543f089c7591eb4705d05095fbd2c091d9 100644 (file)
@@ -73,3 +73,6 @@ FUNCTION-ALIAS: fasinh
 
 FUNCTION-ALIAS: fatanh
     double atanh ( double x )
+
+FUNCTION-ALIAS: flgamma
+    double lgamma ( double x )