betai
betai (a, b, x [, accuracy ])
The betai function returns the regularized incomplete beta function Ix (a, b ),
Here
where a, b > 0, and 0 <= x <= 1.
Optionally, accuracy can be used to specify the desired fractional accuracy.
Details
The accuracy parameter specifies the fractional accuracy that you desire. That is, if you set accuracy to 1e-7, that means that you wish that the absolute value of (factual-freturned)/factual be less than 10-7.
Larger values of accuracy (poorer accuracy) result in evaluation of fewer terms of a series, which means the function executes somewhat faster.
A single-precision level of accuracy is about 3x10-7, double-precision about 2x10-16. The betai function will return full double-precision accuracy for small values of a and b. Achievable accuracy declines as a and b increase:
| a | b | x | betai | Accuracy Achievable |
|---|---|---|---|---|
| 1 | 1.5 | 0.5 | 0.646447 | full double precision (2x10-16) |
| 8 | 10 | 0.5 | 0.685470 | 6x10-16 |
| 20 | 21 | 0.5 | 0.562685 | 2x10-15 |
| 20 | 21 | 0.1 | 1.87186e-10 | 5x10-15 |