mathlib: Miscellaneous math utilities¶
Miscellaneous math utilities
base conversion
derivatives
dimension reduction
range alternatives
etc
Functions¶
|
return the intersection of (u1, u2) and (v1, v2) or None if no intersection |
|
Like xrange(), but returns list of floats instead |
|
Like range, but yielding Fractions |
|
Similar to numpy.linspace, returns a python list |
|
clip the value of x between minvalue and maxvalue |
|
|
|
Least common multiplier between a seq. |
|
find the min common denominator to express floats as fractions |
|
Converts given number s, from base b to base 10 |
|
Converts given number x, from base 10 to base b |
|
Converts s from base a to base b |
|
Reduces distances in multiple dimensions to 1 dimension. |
|
The geometric mean is often used to find the mean of data measured in different units. |
|
The harmonic mean is used to calculate F1 score. |
|
Split interval (start, end) at the given offsets |
|
Return a function which is the derivative of the given func |
|
create an array [start, ..., stop] with a logarithmic scale |
|
go from begin to end in numsteps at randomly spaced steps |
|
calculate the fibonacci number n (accepts fractions) |
|
Fibonacci interpolation |
|
Round x to its nearest integer, taking the fractional part as the probability |
|
Round x with given resolution |
|
The next value in the grid defined by step/offset which is >= x |
|
Return the shortest distance to x from origin around a circle of modulo mod. |
|
A rotation function that rotates a point around an origin |
|
Optimize one parameter to arrive to a desired value. |
|
Is x a power of two? |
|
Return the lowest power of two >= x |