packages feed

apple-0.1.0.0: math/gamma.apple

λz.
  { Γ ← λz.
    {
      zz ⟜ z-1;
      c0 ← 0.999999999999997092;
      𝛾 ← 607%128;
      coeffs ← ⟨ 57.1562356658629235
               , _59.5979603554754912
               , 14.1360979747417471
               , _0.491913816097620199
               , 0.339946499848118887e-4
               , 0.465236289270485756e-4
               , _0.983744753048795646e-4
               , 0.158088703224912494e-3
               , _0.210264441724104883e-3
               , 0.217439618115212643e-3
               , _0.164318106536763890e-3
               , 0.844182239838527433e-4
               , _0.261908384015814087e-4
               , 0.368991826595316234e-5
               ⟩;
      ss ← (+)/([y%(zz+itof x)]`(⍳ 1 14 1) coeffs);
      (((zz+0.5)*_.(zz+𝛾+0.5))-(zz+𝛾+0.5))+_.((√(2*𝜋))*(c0+ss))
    };
    e:(?z≥0.5,.Γ z,.(_.𝜋)-(_.(sin.(𝜋*z)))-Γ(1-z))
  }