private static double Internalgamma(double z){
  double sum=0.0;
  double[] c={1.0,0.5772156649015329,-0.6558780715202538,-0.0420026350340952,0.1665386113822915,-0.0421977345555443,-0.0096219715278770,0.0072189432466630,-0.0011651675918591,-0.0002152416741149,0.0001280502823882,-0.0000201348547807,-0.0000012504934821,0.0000011330272320,-0.0000002056338417,0.0000000061160950,0.0000000050020075,-0.0000000011812746,0.0000000001043427,0.0000000000077823,-0.0000000000036968,0.0000000000005100,-0.0000000000000206,-0.0000000000000054,0.0000000000000014,0.0000000000000001};
  for (int i=0; i < c.length; i++) {
    sum+=c[i] * Math.pow(z,(double)(i + 1));
  }
  return (1.0 / sum);
}

private static double Internalgamma ( double z ) { double sum = 0.0 ; double [ ] c = { 1.0 , 0.5772156649015329 , - 0.6558780715202538 , - 0.0420026350340952 , 0.1665386113822915 , - 0.0421977345555443 , - 0.0096219715278770 , 0.0072189432466630 , - 0.0011651675918591 , - 0.0002152416741149 , 0.0001280502823882 , - 0.0000201348547807 , - 0.0000012504934821 , 0.0000011330272320 , - 0.0000002056338417 , 0.0000000061160950 , 0.0000000050020075 , - 0.0000000011812746 , 0.0000000001043427 , 0.0000000000077823 , - 0.0000000000036968 , 0.0000000000005100 , - 0.0000000000000206 , - 0.0000000000000054 , 0.0000000000000014 , 0.0000000000000001 } ; for ( int i = 0 ; i < c . length ; i ++ ) { sum += c [ i ] * Math . pow ( z , ( double ) ( i + 1 ) ) ; } return ( 1.0 / sum ) ; }
an internal method for finding gamma for a restricted range of reals .
