time-to-botec/squiggle/node_modules/jstat/test/special/gammafn-test.js
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

25 lines
593 B
JavaScript

var vows = require('vows');
var assert = require('assert');
var suite = vows.describe('jStat.gammafn');
require('../env.js');
suite.addBatch({
'gammafn': {
'topic': function() {
return jStat;
},
// Checked against Mathematica Gamma[a]
'check gammafn': function(jStat) {
var tol = 0.000001;
assert.epsilon(tol, jStat.gammafn(0.00001), 99999.422794);
assert.epsilon(tol, jStat.gammafn(0.2), 4.590843);
assert.equal(jStat.gammafn(10), 362880);
assert.equal(jStat.gammafn(171.6243769536076), Infinity);
}
}
});
suite.export(module);