DriftTexture · function

erf

The error function, to double precision.

Explained in DriftTexture.

function erf(x: number): number
import { erf } from '@driftengine/texture';

Parameters

ParameterTypeDescription
xnumber

In depth

A Maclaurin series below 3, where its alternating terms peak near 170 at x = 3 and cost about three digits to cancellation — still 1e-13; a continued fraction for the complement above, which converges fastest exactly where the series is worst; and ±1 past 6, where the complement is below a double's last place.