jope
jope copied to clipboard
wrong values for loggamma?
BigDecimal d9 = BigDecimal.valueOf(1.9999542254);
BigDecimal d = loggam(d9.add(BigDecimal.ONE));
System.out.println(d); //-0.000019352145145910313920070482
correct value is 0.69310494089 (https://www.wolframalpha.com/input/?i=loggamma%281.9999542254+%2B+1%29)
it's giving the value of loggamma(d9) not loggamma(d9+1) which is curious. It wouldn't matter if you called loggamma(d9) but you're calling loggamma(d9+1) so I think it's incorrect?
thank you @lucas-zee, feel free to open a PR if you want to.