ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
math Namespace Reference

Functions

int comb (int n, int k)
bool isinf (float x)
bool isnan (float x)
int floor (float x)
int ceil (float x)
float sin (float x)
float cos (float x)
float tan (float x)
float sqrt (float x)
float exp (float x)
float log (float x)
int factorial (int n)
int gcd (int a, int b)
int lcm (int a, int b)
int isqrt (int n)
int perm (int n, int k=-1)
int prod (list[int] values, int start=1)
bool isclose (float a, float b, float rel_tol=1e-09, float abs_tol=0.0)
float expm1 (float x)
float log1p (float x)
float exp2 (float x)
float asin (float x)
float acos (float x)
float atan (float x)
float atan2 (float y, float x)
float log2 (float x)
float log10 (float x)
float asinh (float x)
float acosh (float x)
float atanh (float x)
float hypot (float x, float y)
float dist (list[float] p, list[float] q)
float pow (float x, float y)
float fabs (float x)
int trunc (float x)
float fmod (float x, float y)
float copysign (float x, float y)
float sinh (float x)
float cosh (float x)
float tanh (float x)
bool isfinite (float x)
float degrees (float x)
float radians (float x)
tuple[float, float] modf (float x)
float cbrt (float x)
float erf (float x)
float erfc (float x)
tuple[float, int] frexp (float x)
float fsum (list[float] values)
float _lanczos_sum (float z)
float gamma (float x)
float ldexp (float x, int i)
float lgamma (float x)
float remainder (float x, float y)
float sumprod (list[float] a, list[float] b)
float ulp (float x)
float nextafter (float x, float y)

Variables

float pi = 3.141592653589793
float e = 2.718281828459045
float inf = float('inf')
float tau = 6.283185307179586
float nan = float('nan')

Function Documentation

◆ _lanczos_sum()

float math._lanczos_sum ( float z)
protected
Lanczos approximation sum for gamma/lgamma

◆ acos()

float math.acos ( float x)
Calculate arccosine of x (in radians)

Raises:
    ValueError: If |x| > 1 (math domain error)

◆ acosh()

float math.acosh ( float x)

◆ asin()

float math.asin ( float x)
Calculate arcsine of x (in radians)

Raises:
    ValueError: If |x| > 1 (math domain error)

◆ asinh()

float math.asinh ( float x)

◆ atan()

float math.atan ( float x)
Calculate arctangent of x (in radians)

◆ atan2()

float math.atan2 ( float y,
float x )
Calculate two-argument arctangent (in radians)

◆ atanh()

float math.atanh ( float x)

◆ cbrt()

float math.cbrt ( float x)
Calculate the cube root of x

◆ ceil()

int math.ceil ( float x)

◆ comb()

int math.comb ( int n,
int k )
Calculate binomial coefficient C(n, k) = n! / (k! * (n-k)!)

Args:
    n: Total number of items (non-negative integer)
    k: Number of items to choose (non-negative integer)

Returns:
    The binomial coefficient, or 0 if k > n

Raises:
    ValueError: If n or k are negative
    TypeError: If n or k are not integers

◆ copysign()

float math.copysign ( float x,
float y )
Return x with the sign of y

◆ cos()

float math.cos ( float x)
Calculate cosine of x (in radians)

Args:
    x: Input angle in radians

Returns:
    Cosine of x

◆ cosh()

float math.cosh ( float x)
Calculate hyperbolic cosine of x

◆ degrees()

float math.degrees ( float x)

◆ dist()

float math.dist ( list[float] p,
list[float] q )

◆ erf()

float math.erf ( float x)
Calculate the error function of x

◆ erfc()

float math.erfc ( float x)
Calculate the complementary error function of x

◆ exp()

float math.exp ( float x)
Calculate e raised to the power of x

Args:
    x: Input value

Returns:
    e^x

◆ exp2()

float math.exp2 ( float x)

◆ expm1()

float math.expm1 ( float x)

◆ fabs()

float math.fabs ( float x)
Calculate absolute value of x

◆ factorial()

int math.factorial ( int n)

◆ floor()

int math.floor ( float x)

◆ fmod()

float math.fmod ( float x,
float y )
Floating-point remainder of x / y

◆ frexp()

tuple[float, int] math.frexp ( float x)
Split x into mantissa and exponent (x = m * 2**e),
with m in [0.5, 1.0) (or 0.0 if x == 0)

◆ fsum()

float math.fsum ( list[float] values)
Return an accurate floating point sum of values

◆ gamma()

float math.gamma ( float x)
Calculate the gamma function of x.
For positive integers x, this function satisfies gamma(x) = (x - 1)!.

◆ gcd()

int math.gcd ( int a,
int b )

◆ hypot()

float math.hypot ( float x,
float y )

◆ isclose()

bool math.isclose ( float a,
float b,
float rel_tol = 1e-09,
float abs_tol = 0.0 )

◆ isfinite()

bool math.isfinite ( float x)

◆ isinf()

bool math.isinf ( float x)

◆ isnan()

bool math.isnan ( float x)

◆ isqrt()

int math.isqrt ( int n)

◆ lcm()

int math.lcm ( int a,
int b )

◆ ldexp()

float math.ldexp ( float x,
int i )
Return x * (2**i)

◆ lgamma()

float math.lgamma ( float x)
Calculate the natural logarithm of the absolute value of the gamma function

◆ log()

float math.log ( float x)
Calculate natural logarithm of x

Args:
    x: Positive number

Returns:
    Natural logarithm of x

Raises:
    ValueError: If x <= 0 (math domain error)

◆ log10()

float math.log10 ( float x)
Calculate base-10 logarithm of x

Raises:
    ValueError: If x <= 0 (math domain error)

◆ log1p()

float math.log1p ( float x)

◆ log2()

float math.log2 ( float x)
Calculate base-2 logarithm of x

Raises:
    ValueError: If x <= 0 (math domain error)

◆ modf()

tuple[float, float] math.modf ( float x)
Split x into fractional and integer parts

◆ nextafter()

float math.nextafter ( float x,
float y )
Return the next floating-point value after x towards y

◆ perm()

int math.perm ( int n,
int k = -1 )

◆ pow()

float math.pow ( float x,
float y )
Calculate x raised to the power of y

◆ prod()

int math.prod ( list[int] values,
int start = 1 )

◆ radians()

float math.radians ( float x)

◆ remainder()

float math.remainder ( float x,
float y )
Return IEEE 754-style remainder of x with respect to y

◆ sin()

float math.sin ( float x)
Calculate sine of x (in radians)

Args:
    x: Input angle in radians

Returns:
    Sine of x

◆ sinh()

float math.sinh ( float x)
Calculate hyperbolic sine of x

◆ sqrt()

float math.sqrt ( float x)
Calculate square root of x

Args:
    x: Non-negative number

Returns:
    Square root of x

Raises:
    ValueError: If x is negative (math domain error)

◆ sumprod()

float math.sumprod ( list[float] a,
list[float] b )
Return the sum of products of two sequences

◆ tan()

float math.tan ( float x)
Calculate tangent of x (in radians)

◆ tanh()

float math.tanh ( float x)
Calculate hyperbolic tangent of x

◆ trunc()

int math.trunc ( float x)
Truncate x toward zero and return int

◆ ulp()

float math.ulp ( float x)
Return the value of the least significant bit of the float x

Variable Documentation

◆ e

float math.e = 2.718281828459045

◆ inf

float math.inf = float('inf')

◆ nan

float math.nan = float('nan')

◆ pi

float math.pi = 3.141592653589793

◆ tau

float math.tau = 6.283185307179586