How to use the gamma function from mathjs
Find comprehensive JavaScript mathjs.gamma code examples handpicked from public code repositorys.
14 15 16 17 18 19 20 21 22 23
const csqrt = math.sqrt; const cpow = math.pow; const csquare = z => cmul(z, z); const ccis = z => cexp(cmul_i(z)); const gamma_right = math.gamma; const gamma_left = z => math.divide(math.pi, math.multiply( math.sin(math.multiply(z, math.pi)), gamma_right(math.subtract(1, z)) ));
8
29
3
+ 3 other calls in file
54 55 56 57 58 59 60
var upper_incomplete_gamma = function(s, x){ // ref: https://en.wikipedia.org/wiki/Incomplete_gamma_function#Properties return math.gamma(s) - lower_incomplete_gamma(s, x); }; return upper_incomplete_gamma(a, x) / math.gamma(a); };
0
10
1
+ 3 other calls in file
mathjs.evaluate is the most popular function in mathjs (87200 examples)