deno.land / x / simplestatistic@v7.7.1 / src / inverse_error_function.js

inverse_error_function.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/** * The Inverse [Gaussian error function](http://en.wikipedia.org/wiki/Error_function) * returns a numerical approximation to the value that would have caused * `errorFunction()` to return x. * * @param {number} x value of error function * @returns {number} estimated inverted value */function inverseErrorFunction(x) { const a = (8 * (Math.PI - 3)) / (3 * Math.PI * (4 - Math.PI));
const inv = Math.sqrt( Math.sqrt( Math.pow(2 / (Math.PI * a) + Math.log(1 - x * x) / 2, 2) - Math.log(1 - x * x) / a ) - (2 / (Math.PI * a) + Math.log(1 - x * x) / 2) );
if (x >= 0) { return inv; } else { return -inv; }}
export default inverseErrorFunction;
simplestatistic

Version Info

Tagged at
2 years ago