1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: GPL-2.0-or-later
//! Exponential function `e^x` for `f32` on `no_std` embedded targets,
//! powered by `embedded-exp-f32`.
//!
//! Uses Cody-Waite range reduction, a `(2, 2)` Padé approximation over the
//! reduced interval, and IEEE 754 exponent reconstruction without `libm`,
//! heap allocation, or loops over `k`.
//!
//! # Behavior & Notes
//!
//! | Input / Condition | Behavior |
//! |-------------------|----------|
//! | `x = 0.0` | Returns `1.0` |
//! | `x = 1.0` | Returns `~e` (`core::f32::consts::E`) |
//! | `x <= -87.33654` | Underflows to `0.0` |
//! | `x >= 88.72284` | Overflows to `f32::INFINITY` |
//! | `fast-path` feature | Skips explicit bounds/NaN checks when `x` is already validated |
pub use exp_f32;
/// Computes `e^x` in `f32` without `libm` or `std`.