(gamma) ( x -- value )


Vocabulary
picomath.private

Inputs
xan object


Outputs
valuean object


Definition


:: (gamma) ( x -- value )
x :> y! 0 :> n! y 1.0 <
:> arg-was-less-than-one arg-was-less-than-one
[ y 1.0 + y! ] [ y floor >integer 1 - n! y n - y! ] if
0.0 :> num! 1.0 :> den! y 1 - :> z! 8 <iota>
[ [ P nth num + z * num! ] [ Q nth den z * + den! ] bi ]
each num den / 1.0 + arg-was-less-than-one
[ y 1.0 - / ] [ n [ y * y 1.0 + y! ] times ] if ;