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
// SPDX-FileCopyrightText: 2026 John Moxley
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Floating-point power algorithm family -- narrow-tier kernels.
//!
//! Only D18 / D38 have policy-routed `powf_strict` today. The wide
//! tiers still ship `powf` through their per-tier macro shells; migrating
//! those mirrors the deferral on [`crate::algos::ln`] / [`crate::algos::exp`].
//!
//! `powf` is the composition `exp(y * ln(x))` performed entirely in the
//! 256-bit `Fixed` guard-digit intermediate, so the round-trip never
//! drops precision below the working scale before the final rounding.
//!
//! Variants:
//!
//! - [`powf_series_2limb`] -- D38's hand-tuned `powf` on the `Fixed` intermediate,
//! carrying the four-variant matrix entry shape (strict + approx, each
//! with an explicit-rounding sibling). The D38 realisation of the
//! `powf_exp_with_ln` (`ExpWithLn`) algorithm.
//! - [`pow_schoolbook`] -- correctness reference: naive `exp(y*ln(x))`
//! using the schoolbook exp and ln. Registered as the unrouted
//! `Algorithm::Schoolbook` variant.
pub
/// Width-generic analytic storage-overflow gate for the wide-tier
/// `exp(y·ln x)` composition -- the wide sibling of the narrow kernel's
/// internal `powf_overflow_gate`. Run by the per-tier `powf_strict_with`
/// shells BEFORE the result-sized working lift, so a deep-overflow cell
/// panics contractually instead of wrapping the lifted `ln`.
pub
/// Exact integer-power pin shared by the narrow + wide `powf` kernels: when
/// the base and exponent are exact integers, `base^exp` is an exact rational
/// and its correctly-directed-rounded value is emitted directly instead of
/// the to-nearest `exp(exp*ln base)` composition.
pub
/// Schoolbook floating-point power -- naive `exp(y*ln(x))` composition,
/// correctness reference. Registered as the unrouted `Algorithm::Schoolbook`
/// arm; not connected to `select`.
pub