Skip to content

RFC: add cbrt #590

Open
Open
@steff456

Description

@steff456

This RFC requests to include a new API in the array API specification for the purpose of computing the cube root.

Overview

Based on array comparison data, the API is available in the majority of libraries in the PyData ecosystem.

The Array API Specification currently includes pow and sqrt, but does not include the IEEE 754 function cbrt.

While the cube root could be implemented in terms of pow, this is not desirable as the rational 1/3 is not typically equal to 1.0/3.0 due to limited floating-point precision. Cube root implementations are generally more accurate than the equivalent operation via pow.

Prior art

Proposal:

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

cc @kgryte

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions