From octave-sources-request at bevo dot che dot wisc dot edu Thu Apr 9 07:33:05 1998 Subject: sanity test for gammai From: Jim Van Zandt To: octave-sources at bevo dot che dot wisc dot edu Cc: jrv at vanzandt dot mv dot com Date: Thu, 09 Apr 1998 08:33:03 -0400 John - Octave 2.0.5 finds: octave:46> sqrt(pi)*erf(1) ans = 1.49364826562485e+00 octave:47> gammai(.5,1)*gamma(.5) ans = 1.49364826562485e+00 octave:48> gammainc(1,.5)*gamma(.5) ans = 1.49364826562485e+00 which are correct. (Unfortunately, as has been pointed out, 2.0.11 results are not correct.) I would like to propose the following for test/octave.test/arith/gammai-1.m: # reference: Abramowitz & Stegun section # 6.5, where P(a,x) is the Octave # function gammai(a,x) x = [sqrt(pi)*erf(1), gammai(.5,1)*gamma(.5), gammainc(1,.5)*gamma(.5)]; v = [1.49364826562485, 1.49364826562485, 1.49364826562485]; all (abs (x - v) < sqrt(eps)) Unfortunately, octave 2.0.5 chokes on this (infinite loop or something). I have not been able to determine why. - Jim Van Zandt