Skip to content

RFC: add special.erf to the specification #964

@kgryte

Description

@kgryte

This RFC proposes adding a new API for computing the error function to the Array API specification in a special functions extension.

Overview

Based on array library comparison data, the API is available in a majority of array libraries in the PyData ecosystem. The error function is particularly important in statistics (e.g., CDF of a normal distribution).

erf was previously discussed as a candidate for inclusion within the context of a special functions extension. That RFC addressed several topics and design discussions. This RFC seeks to cut through the noise and propose a single API candidate for inclusion in the standard.

Prior Art

Proposal

def erf(x: array, /) -> array

within a special functions extension in a manner similar to linalg and fft.

Comments

  • SciPy supports complex dtypes. JAX does not. As a first pass, I suggest standardizing support for real-valued floating-point arrays. In a follow-up revision, we can add support for complex dtypes.
  • Given erf's presence in C99, special cases should follow suit as we have done for other special functions in the main namespace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API extensionAdds new functions or objects to the API.RFCRequest for comments. Feature requests and proposed changes.

    Type

    No type

    Projects

    Status

    Stage 0

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions