jope icon indicating copy to clipboard operation
jope copied to clipboard

wrong values for loggamma?

Open lukaz-vaultree-com opened this issue 4 years ago • 1 comments

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?

lukaz-vaultree-com avatar Aug 25 '21 15:08 lukaz-vaultree-com

thank you @lucas-zee, feel free to open a PR if you want to.

ssavvides avatar Aug 30 '21 20:08 ssavvides