time-to-botec/squiggle/node_modules/jstat/test/special/gammap-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

26 lines
672 B
JavaScript

var vows = require('vows');
var assert = require('assert');
var suite = vows.describe('jStat.gammap');
require('../env.js');
suite.addBatch({
'gammap': {
'topic': function() {
return jStat;
},
// Checked against Mathematica Gamma[a, 0, x]
// Also checked against R's gammainc(x, a) via the pracma library
// gammainc() outputs three values, this matches 'lowinc'
'check gammap': function(jStat) {
var tol = 0.000001;
assert.epsilon(tol, jStat.gammap(5, 5), 13.4281611);
assert.epsilon(tol, jStat.gammap(5, 4), 8.90791355);
assert.epsilon(tol, jStat.gammap(5, 7), 19.8482014);
}
}
});
suite.export(module);