Skip to content

special: erf (companion to the existing erfc) #166

Description

@sbryngelson

aneforge/special.py implements erfc (line ~57) but not erf. Add erf, the natural companion:

def erf(x: Tensor) -> Tensor:
    return _const(x, 1.0) - erfc(x)   # erf(x) = 1 - erfc(x)

(or share the underlying polynomial directly if that is cleaner given how erfc is built -- follow the existing _horner / _poly_in style in the file).

Oracle: scipy.special.erf. Add a case to the module self-test (special.py's _selftest, matching how erfc/expm1/log1p are checked) over a spread of x in roughly [-4, 4].

Testing: the numeric check dispatches, so run it on any Apple Silicon Mac and note in the PR that it passed locally; CI runs only the off-device/build subset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions