arb#
Arblib wrapper using ctypes.
Functions#
Returns |
|
Returns sum of |
|
Returns product of |
|
Returns quotient of |
|
Returns |
|
Returns max of |
|
Returns |
|
Returns |
|
Returns min of |
|
Returns absolute value of x. |
|
Returns -x. |
|
Sign function. |
|
Error function. |
|
Complementary error function. |
|
Inverse error function. |
|
Returns square root of |
|
Returns pi. |
|
Returns union of |
|
Sum of elements in xs. |
|
Product of elements in xs. |
|
Lambert W function. |
- arb_add(x, y, prec)#
Returns sum of
x
andy
.
- arb_mul(x, y, prec)#
Returns product of
x
andy
.
- arb_div(x, y, prec)#
Returns quotient of
x
divided byy
.
- arb_max(x, y, prec)#
Returns max of
x
andy
.If
x
andy
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
andy
.If
x
andy
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, prec)#
Returns union of
x
andy
.If
x
andy
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)]
.
- arb_product(xs, prec)#
Product of elements in xs.
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 an exact Arb with midpoint 1 and radius 0.
Returns an Arb representing positive infinity.
Returns an Arb representing negative infinity.
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 inother
.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 inother
.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 inother
.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 inother
.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 inother
.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 inother
. 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.