Utilities using precision floating point summation.
|
bqrt(x)
Return the 4-th, bi-quadratic or quartic root, x**(1 / 4), preserving type(x) . |
|
|
|
cbrt(x)
Compute the cube root x**(1/3), preserving
type(x) . |
|
|
|
cbrt2(x)
Compute the cube root squared x**(2/3),
preserving type(x) . |
|
|
|
euclid(x,
y)
Appoximate the norm sqrt(x**2 + y**2) by
max(abs(x), abs(y)) + min(abs(x), abs(y)) *
0.4142.... |
|
|
|
euclid_(*xs)
Appoximate the norm sqrt(sum(x**2 for x in
xs)) by cascaded euclid. |
|
|
|
|
|
|
|
fatan(x)
Fast approximation of atan(x) , scalar. |
|
|
|
fatan1(x)
Fast approximation of atan(x) for 0 <=
x < 1 , unchecked. |
|
|
|
fatan2(y,
x)
Fast approximation of atan2(y, x) , scalar. |
|
|
|
favg(a,
b,
f=0.5,
nonfinites=True)
Return the precise average of two values. |
|
|
|
fdot(a,
*b,
**start)
Return the precision dot product sum(a[i] * b[i] for
ni=0..len(a)). |
|
|
|
fdot3(xs,
ys,
zs,
start=0)
Return the precision dot product start + sum(a[i] *
b[i] * c[i] for i=0..len(a)-1). |
|
|
|
fhorner(x,
*cs,
**incx)
Horner form evaluation of polynomial sum(cs[i] * x**i
for i=0..n) with in- or decreasing exponent sum(... i=n..0), where n = len(cs) - 1 . |
|
|
|
|
|
fma(x,
y,
z,
**nonfinites)
Fused-multiply-add, using math.fma(x, y, z) in Python
3.13+ or an equivalent implementation. |
|
|
|
fmean(xs)
Compute the accurate mean sum(xs) / len(xs). |
|
|
|
fmean_(*xs,
**nonfinites)
Compute the accurate mean sum(xs) / len(xs). |
|
|
|
f2mul_(x,
*ys,
**nonfinites)
Cascaded, accurate multiplication x * y *
y ... for all ys . |
|
|
|
fpolynomial(x,
*cs,
**over_f2product_nonfinites)
Evaluate the polynomial sum(cs[i] * x**i for
i=0..len(cs)) [/ over]. |
|
|
|
fpowers(x,
n,
alts=0)
Return a series of powers [x**i for i=1..n], note
1..! |
|
|
|
fprod(xs,
start=1)
Iterable product, like math.prod or
numpy.prod . |
|
|
|
frandoms(n,
seeded=None)
Generate n (long) lists of random floats . |
|
|
|
frange(start,
number,
step=1)
Generate a range of float s. |
|
|
value
|
freduce(function,
sequence,
initial=...)
Apply a function of two arguments cumulatively to the items of a
sequence, from left to right, so as to reduce the sequence to a
single value. |
|
|
|
fremainder(x,
y)
Remainder in range [-y / 2, y / 2] . |
|
|
|
hypot(x,
y)
Return the Euclidean distance, sqrt(x*x + y*y). |
|
|
|
hypot_(*xs)
Compute the norm sqrt(sum(x**2 for x in xs)). |
|
|
|
hypot1(x)
Compute the norm sqrt(1 + x**2). |
|
|
|
hypot2(x,
y)
Compute the squared norm x**2 + y**2. |
|
|
|
hypot2_(*xs)
Compute the squared norm fsum(x**2 for x in
xs) . |
|
|
|
norm2(x,
y)
Normalize a 2-dimensional vector. |
|
|
|
norm_(*xs)
Normalize the components of an n-dimensional vector. |
|
|
|
sqrt0(x,
Error=None)
Return the square root sqrt(x) iff x
> EPS02, preserving type(x) . |
|
|
|
sqrt3(x)
Return the square root, cubed sqrt(x)**3
or sqrt(x**3), preserving
type(x) . |
|
|
|
sqrt_a(h,
b)
Compute a side of a right-angled triangle from
sqrt(h**2 - b**2) . |
|
|
|
zcrt(x)
Return the 6-th, zenzi-cubic root, x**(1 /
6), preserving type(x) . |
|
|
|
zqrt(x)
Return the 8-th, zenzi-quartic or squared-quartic root,
x**(1 / 8), preserving
type(x) . |
|
|