haskell / math-functions

Special mathematical functions
http://hackage.haskell.org/package/math-functions
BSD 2-Clause "Simplified" License
40 stars 28 forks source link

Investigate precision of invIncompleteBeta a b x for very small x #44

Open Shimuuar opened 8 years ago

Shimuuar commented 8 years ago

Function could return answers which are orders of magnitude off. It could be due to the fact that we revert to bisection which is linear instead of cubic Halley.

>>> (\a b -> incompleteBeta a b . invIncompleteBeta a b) 90 90 1e-200
9.866213992257607e-197
Shimuuar commented 8 years ago

Things are much worse:

*Statistics.Distribution.StudentT> invIncompleteBeta 0.5e-2 0.5 0.84013
8.881784197001252e-16
*Statistics.Distribution.StudentT> invIncompleteBeta 0.5e-2 0.5 0.84012
0.0