array-api icon indicating copy to clipboard operation
array-api copied to clipboard

RFC: add `exp2` function to the standard

Open steff456 opened this issue 2 years ago • 0 comments

This RFC requests to include a new API in the array API specification for the purpose of computing the base-2 exponential.

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 log2, exp, and pow, but does not include the IEEE 754 function exp2. Would be nice to add for completeness.

While this can currently be achieved now by using pow, exp2 is commonly implemented as a slightly more ergonomic perf path.

Prior art

Proposal:

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

cc @kgryte

steff456 avatar Feb 14 '23 21:02 steff456