GH-44903: [C++] Add the Expm1(exponent) scalar arithmetic function (#44904) `Expm1(exponent)` is a more accurate way of computing `Exp(exponent) - 1.0` for small values of exponent. ### Rationale for this change `expm1(x)` is specifically designed to compute `exp(x)−1` more accurately, particularly for small x. It uses numerical techniques and approximations that minimize the loss of precision. When x is very small (close to 0), `exp(x)` is approximately `1+x`. Subtracting 1 from `exp(x)` (i.e., `(exp(x)−1)` can result in significant cancellation of significant digits due to floating-point arithmetic, leading to a loss of precision). For example: When `x = 10^−8`, `exp(x)` is close to `1 + 10^−8`, so subtracting 1 leaves only the small `10^−8`, which may lose accuracy due to floating-point limitations. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes and documentation was updated to list the new function. * GitHub Issue: #44903 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Apache Arrow is a universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics. It contains a set of technologies that enable data systems to efficiently store, process, and move data.
Major components of the project include:
Arrow is an Apache Software Foundation project. Learn more at arrow.apache.org.
The reference Arrow libraries contain many distinct software components:
The official Arrow libraries in this repository are in different stages of implementing the Arrow format and related features. See our current feature matrix on git main.
Please read our latest project contribution guide.
Even if you do not plan to contribute to Apache Arrow itself or Arrow integrations in other projects, we'd be happy to have you involved: