time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

gammap-test.js (672B)


      1 var vows = require('vows');
      2 var assert = require('assert');
      3 var suite = vows.describe('jStat.gammap');
      4 
      5 require('../env.js');
      6 
      7 suite.addBatch({
      8   'gammap': {
      9     'topic': function() {
     10       return jStat;
     11     },
     12 
     13     // Checked against Mathematica Gamma[a, 0, x]
     14     // Also checked against R's gammainc(x, a) via the pracma library
     15     // gammainc() outputs three values, this matches 'lowinc'
     16     'check gammap': function(jStat) {
     17       var tol = 0.000001;
     18       assert.epsilon(tol, jStat.gammap(5, 5), 13.4281611);
     19       assert.epsilon(tol, jStat.gammap(5, 4), 8.90791355);
     20       assert.epsilon(tol, jStat.gammap(5, 7), 19.8482014);
     21     }
     22   }
     23 });
     24 
     25 suite.export(module);