erfinv(y: number): number
Inverse error function.
Computes the inverse of the error function.
The inverse error function satisfies y = erf(x), for -1 ≤ y ≤ 1 and -∞ ≤ x ≤ ∞.
Compute the inverse error function for a positive value
Compute the inverse error function for a positive value
import { assertEquals } from "jsr:@std/assert"; assertEquals(erfinv(0.1), 0.08885596505119556);
Compute the inverse error function for a negative value
Compute the inverse error function for a negative value
import { assertEquals } from "jsr:@std/assert"; assertEquals(erfinv(-0.5), -0.47693623612190483);
Compute the inverse error function for 0 (should return 0)
Compute the inverse error function for 0 (should return 0)
import { assertEquals } from "jsr:@std/assert"; assertEquals(erfinv(0), 0);