arb#
Arblib wrapper using ctypes.
Functions#
Returns x - y. |
|
Returns sum of x and y. |
|
Returns product of x and y. |
|
Returns quotient of x divided by y. |
|
Returns log(x). |
|
Returns max of x and y. |
|
Returns exp(x). |
|
Returns min of x and y. |
|
Returns absolute value of x. |
|
Returns -x. |
|
Sign function. |
|
Error function. |
|
Complementary error function. |
|
Inverse error function. |
|
Returns square root of x. |
|
Returns pi. |
|
Returns union of x and y. |
|
Sum of elements in xs. |
|
Product of elements in xs. |
- arb_add(x, y, prec)#
Returns sum of x and y.
- arb_mul(x, y, prec)#
Returns product of x and y.
- arb_div(x, y, prec)#
Returns quotient of x divided by y.
- arb_max(x, y, prec)#
Returns max of x and y.
If x and y represent intervals [x_l, x_u] and [y_l, y_u], this returns an interval containing [max(x_l, y_l), max(x_u, y_u)].
- arb_exp(x, prec)#
Returns exp(x).
If x represents an interval [x_l, x_u], this returns an interval containing [exp(x_l), exp(x_u)].
- arb_min(x, y, prec)#
Returns min of x and y.
If x and y represent intervals [x_l, x_u] and [y_l, y_u], this returns an interval containing [min(x_l, y_l), min(x_u, y_u)].
- arb_sgn(x)#
Sign function.
If x contains both zero and nonzero numbers, this returns an Arb with mid=0 and rad=1.
- arb_union(x, y)#
Returns union of x and y.
If x and y represent intervals [x_l, x_u] and [y_l, y_u], this returns an interval containing [min(x_l, y_l), max(x_u, y_u)].
Classes#
An interval on the real line represented by a midpoint and a radius. |
- class Arb(ptr)#
An interval on the real line represented by a midpoint and a radius.
Note: Arbs with radius=0 are referred to as exact arbs.
Methods# Constructs an Arb by specifying its midpoint and radius.
Constructs an exact Arb with midpoint val.
Construct an exact Arb with midpoint val.
Constructs an exact arb with midpoint specified as mantissa and exponent.
Returns True if self is less than other.
Returns True if self is less than or equal to other.
Returns True if self is not equal to other.
Returns True if self is greater than other.
Returns True if self is greater than or equal to other.
Returns True if self is equal to other.
Returns -1 * self`.
Returns True if radius is 0.
Returns True if self is finite.
Returns True if midpoint is NaN.
Returns a float approximating the midpoint of self.
Returns the only floating point number contained in self.
Returns a pair (Mantissa, Exponent) if exact.
Returns an exact Arb representing the smallest value in self.
Returns an exact Arb representing the largest value in self.
Returns the midpoint of self.
Returns the radius of self.
Returns True if value is contained in the interval represented by self.
Cleanup.
- __init__(ptr)#
Construct a ball represented exactly.
NOTE: Do not use directly. Use a from_ constructor instead.
- static from_midpoint_radius(mid, rad)#
Constructs an Arb by specifying its midpoint and radius.
- static from_int(val)#
Constructs an exact Arb with midpoint val.
- static from_float(val)#
Construct an exact Arb with midpoint val.
- static from_man_exp(man, exp)#
Constructs an exact arb with midpoint specified as mantissa and exponent.
- __lt__(other)#
Returns True if self is less than other.
This returns True if each value in the interval represented by self is less than every value in other.
Note: If the midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- __le__(other)#
Returns True if self is less than or equal to other.
This returns True if each value in the interval represented by self is less than or equal to every value in other.
Note: If the midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- __ne__(other)#
Returns True if self is not equal to other.
This returns True if no value in the interval represented by self is equal to a value in other.
Note: If the midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- __gt__(other)#
Returns True if self is greater than other.
This returns True if each value in the interval represented by self is greater than every value in other.
Note: If the midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- __ge__(other)#
Returns True if self is greater than or equal to other.
This returns True if each value in the interval represented by self is greater than or equal to every value in other.
Note: If the midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- __eq__(other)#
Returns True if self is equal to other.
This returns True if each value in the interval represented by self is greater than every value in other. If midpoint is NaN, this returns False.
- Parameters
other (Any) –
- Return type
- to_float(prec=64)#
Returns the only floating point number contained in self.
If more than one float lies in the interval represented by self, this raises an error.
- man_exp()#
Returns a pair (Mantissa, Exponent) if exact.
If self is not exact, this raises an error.
- lower(prec)#
Returns an exact Arb representing the smallest value in self.
- upper(prec)#
Returns an exact Arb representing the largest value in self.
- __contains__(value)#
Returns True if value is contained in the interval represented by self.
- Parameters
value (Any) –
- Return type
- __del__()#
Cleanup.