Precision floating point functions, utilities and constants.
|
hypot(x,
y)
Return the Euclidean distance, sqrt(x*x + y*y). |
|
|
|
cbrt(x)
Compute the cubic root x**(1/3). |
|
|
|
cbrt2(x)
Compute the cubic root squared x**(2/3). |
|
|
|
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. |
|
|
|
favg(v1,
v2,
f=0.5)
Return the average of two values. |
|
|
|
fdot(a,
*b)
Return the precision dot product sum(a[i] * b[i] for
i=0..len(a)). |
|
|
|
fdot3(a,
b,
c,
start=0)
Return the precision dot product start + sum(a[i] *
b[i] * c[i] for i=0..len(a)). |
|
|
|
fhorner(x,
*cs)
Evaluate the polynomial sum(cs[i] * x**i for
i=0..len(cs)) using the Horner form. |
|
|
|
|
|
fmean(xs)
Compute the accurate mean sum(xs[i] for i=0..len(xs))
/ len(xs). |
|
|
|
fpolynomial(x,
*cs)
Evaluate the polynomial sum(cs[i] * x**i for
i=0..len(cs)). |
|
|
|
fpowers(x,
n,
alts=0)
Return a series of powers [x**i for i=1..n]. |
|
|
|
fprod(iterable,
start=1.0)
Iterable product, like math.prod or
numpy.prod . |
|
|
|
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. |
|
|
|
fsum_(*xs)
Precision summation of the positional argument vulues. |
|
|
|
fsum(iterable)
Return an accurate floating point sum of values in the iterable. |
|
|
|
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 sum(x**2 for x in
xs). |
|
|
|
sqrt3(x)
Compute the square root, cubed sqrt(x)**3 or sqrt(x**3). |
|
|