Skip to main content

Crate zenith_float_num

Crate zenith_float_num 

Source
Expand description

zenith-float implements arbitrary-precision software floating-point numbers.

Modules§

ctx
Context is used in expressions returning ExactNum.

Structs§

Ball
Enclosure mid ± rad used to certify that a rounded midpoint is unique.
CachedFBig
A float stored at extra working precision so later requests at lower (or equal) precision reuse the cache instead of recomputing.
ComplexBall
Disk enclosure in (\mathbb{C}): center mid, radius rad.
ConstCacheInfo
Snapshot of how many mantissa bits of each constant are currently cached.
Consts
Constants cache contains arbitrary-precision mathematical constants.
ExactComplex
Complex value re + i·im with software-limb real and imaginary parts.
ExactInt
Arbitrary-precision signed integer. Distinct from ExactNum, which is floating-point.
ExactNum
A floating point number of arbitrary precision.
ExactNumArray
Batch of ExactNum values at a shared precision p, row-major.
ExactNumPoly
Dense univariate polynomial c₀ + c₁ x + ⋯ + cₙ xⁿ.
ExactRational
Exact rational num/den. Distinct from ExactNum, which is floating-point.
Ieee32
Software IEEE-754 binary32 (24-bit significand, 8-bit exponent). Stored as u32 bits.
Ieee64
Software IEEE-754 binary64 (53-bit significand, 11-bit exponent). Stored as u64 bits.
Ieee32Array
Contiguous binary32 lanes (u32 bits), row-major.
Ieee64Array
Contiguous binary64 lanes (u64 bits), row-major.
InlineBinaryBuffer
Fixed 16-byte stack buffer for an inlined ExactNum.
Radix
Radix for parse/format (bases 2 through 36).
RadixFloat
A floating-point value with an associated parse/format radix.
SharedConsts
Thread-safe Consts for batch evaluation across threads (std only). Callers still take &mut Consts inside SharedConsts::with; the mutex serializes cache fills.

Enums§

Error
Possible errors.
RoundingMode
Rounding modes.
Sign
Sign.

Constants§

BINARY_FLAG_ARRAY
ExactNumArray record.
BINARY_FLAG_HEAP_NEG
Heap finite, negative.
BINARY_FLAG_HEAP_POS
Heap finite, positive.
BINARY_FLAG_INF_NEG
INF_NEG.
BINARY_FLAG_INF_POS
INF_POS.
BINARY_FLAG_NAN_BARE
NaN with no associated Error.
BINARY_FLAG_NAN_DIV0
NaN: Error::DivisionByZero.
BINARY_FORMAT_VERSION
First-byte version stored in every record.
BINARY_HEADER_LEN
Header bytes of a heap or array record (same size as the inline record).
BINARY_INLINE_LEN
Bytes in InlineBinaryBuffer / ExactNum::to_inline_bytes.
BINARY_INLINE_MANT_BITS
Mantissa bits that fit in the inline record (2 × 32).
BINARY_INLINE_U32_WORDS
u32 limbs in the inline mantissa field.
BINARY_MAX_ELEMS
Maximum array elements accepted by ExactNumArray::from_bytes.
BINARY_MAX_U32
Maximum u32 limbs accepted by ExactNum::from_bytes.
CHEBYSHEV_MAX_DEGREE
Maximum number of Chebyshev coefficients chebyshev_coeffs will compute.
CSV_MAX_COLS
Maximum columns accepted in one CSV row.
CSV_MAX_ROWS
Maximum data rows accepted by Ieee64Array::from_csv_str.
DSP_MAX_POINTS
Maximum real length for dct / idct / dst / idst and the window generators. Transforms use a 2N-point FFT, so this is half of FFT_MAX_POINTS.
EXPONENT_BIT_SIZE
The size of exponent type in bits.
EXPONENT_MAX
Maximum exponent value.
EXPONENT_MIN
Minimum exponent value.
IEEE_SIMD_LANE_WIDTH
Number of u32 lanes in one integer SIMD vector (128-bit register). Binary64 uses IEEE_SIMD_LANE_WIDTH / 2 u64 lanes. Scalar fallback uses the same width so wrappers can size buffers without cfg.
INF_NEG
Negative infinity.
INF_POS
Positive infinity.
INLINE_WORDS
Number of words kept on the stack before allocating.
JACOBI_AGM_MAX
AGM / descending Landen steps for am, sn, cn, dn.
MAX_PREC_RETRY
Maximum extra correct-rounding retries.
NAN
Not a number.
ODE_MAX_STEPS
Maximum accepted steps for any solver in this module.
ODE_MIN_STEP
Default minimum step exponent: h_min = 2^{ODE_MIN_STEP}.
ORTHOPOLY_N_MAX
Maximum degree for every family in this module. Larger n is NaN.
POLLARD_RHO_ITER_MAX
Maximum f evaluations in one pollard_rho run before None.
POLY_COMPANION_CLOSED_DEG
Highest degree whose companion eigenvalues have a closed form on this type.
PROPTEST_CASES
Cases per proptest property under cargo test (no mpfr-tests required).
QUADRATURE_MAX_NODES
Maximum number of Gauss nodes. Larger n is None.
ROOT_DEFAULT_TOL
Default absolute tolerance exponent: tol = 2^{ROOT_DEFAULT_TOL}.
ROOT_MAX_ITER
Maximum iterations for every method in this module.
TANH_SINH_LEVELS_MAX
Maximum tanh–sinh step halvings after the precision-based h.
WORD_BASE
Base of words.
WORD_BIT_SIZE
Size of a word in bits.
WORD_MAX
Maximum value of a word.
WORD_SIGNIFICANT_BIT
Word with the most significant bit set.

Traits§

FromExt
A trait for conversion with additional arguments.

Functions§

bisect
Bisection on [a, b]. None if f(a) and f(b) do not have opposite signs.
blackman_window
Symmetric Blackman: 0.42 − 0.5 cos(θ) + 0.08 cos(2θ), θ = 2πk/(n−1).
brent
Brent’s method (bisection + secant + inverse quadratic) on [a, b].
chebyshev_coeffs
Interpolation coefficients of f on [a, b] at the n Chebyshev–Gauss nodes.
chebyshev_error_bound
ℓ¹ tail Σ_{k≥1} |c_k| at precision p.
chebyshev_eval
Evaluate the Chebyshev expansion of coeffs at x ∈ [a, b].
clenshaw
Clenshaw recurrence for Σ_{k=0}^{n-1} c_k T_k(x) at precision p.
constant_time_eq
Timing-safe equality: always scans both slices; length mismatch is false.
dct
Discrete cosine transform, type II, via a 2N-point FFT.
dst
Discrete sine transform, type II, via a 2N-point FFT.
euler
Explicit Euler for y' = f(t, y) on [t0, t1] with n_steps equal steps.
fft_real
Unnormalized DFT of a real row or column. Output is (2, n) (row 0 real, row 1 imaginary). Same power-of-two rule as ExactNumArray::fft.
gauss_hermite
Gauss–Hermite quadrature: ∫_{-∞}^{∞} f(x) e^{-x²} dx with n nodes.
gauss_laguerre
Gauss–Laguerre quadrature: ∫₀^∞ f(x) e^{-x} dx with n nodes.
gauss_legendre
Gauss–Legendre quadrature of f on [a, b] with n nodes.
hamming_window
Symmetric Hamming: 0.54 − 0.46 cos(2πk/(n−1)). Endpoints are 0.08.
hann_window
Symmetric Hann: ½(1 − cos(2πk/(n−1))). n = 1 is [1].
hmac_sha256
HMAC-SHA-256 (key, data).
idct
Inverse of dct: type-III DCT scaled by 2/N so idct(dct(x)) = x.
idst
Inverse of dst: type-III DST scaled by 2/N so idst(dst(x)) = x.
ifft_real
Inverse of fft_real: ExactNumArray::ifft then the real row.
illinois
Illinois (modified regula falsi) on [a, b].
kaiser_window
Kaiser–Bessel: I_0(β √(1−t_k²)) / I_0(β) with t_k = (k−(n−1)/2)/((n−1)/2).
miller_rabin
Miller–Rabin on |n| with the given bases. n < 2 is false.
mod_inv
Modular inverse of a modulo modulus. None if not invertible.
mod_pow
base^exp mod modulus. exp < 0 or a zero modulus is None. |modulus| = 1 is 0.
newton
Newton–Raphson from x0 with exact derivative df.
ode_min_step
Minimum step 2^{ODE_MIN_STEP} at precision p.
pollard_rho
Brent Pollard ρ. A proper factor of |n|, or None if prime / cap hit.
rectangular_window
Rectangular window: n ones.
rk4
Classical RK4 for y' = f(t, y) on [t0, t1] with n_steps equal steps.
rk45_adaptive
Dormand–Prince RK5(4) with absolute / relative step control.
root_default_tol
Suggested absolute tolerance 2^{ROOT_DEFAULT_TOL} at precision p.
sha256
SHA-256 of data.
sha512
SHA-512 of data.
tanh_sinh
Tanh–sinh (double-exponential) quadrature of f on [a, b].
ziv_round
Evaluate compute at increasing working precision until the result rounds uniquely to p bits (try_set_precision). Same retry budget as the transcendental kernel (crate::MAX_PREC_RETRY).
ziv_round_vec
Same Ziv loop as ziv_round, with every input lifted to p_wrk before compute.

Type Aliases§

ConstCache
Alias for Consts: a progressive cache of π, e, ln 2, ln 10, √2, φ, and γ.
Exponent
An exponent.
Word
A word.