arb#

Arblib wrapper using ctypes.

Functions#

arb_sub()

Returns x - y.

arb_add()

Returns sum of x and y.

arb_mul()

Returns product of x and y.

arb_div()

Returns quotient of x divided by y.

arb_log()

Returns log(x).

arb_max()

Returns max of x and y.

arb_exp()

Returns exp(x).

arb_pow()

Returns x^y.

arb_min()

Returns min of x and y.

arb_abs()

Returns absolute value of x.

arb_neg()

Returns -x.

arb_sgn()

Sign function.

arb_erf()

Error function.

arb_erfc()

Complementary error function.

arb_erfinv()

Inverse error function.

arb_sqrt()

Returns square root of x.

arb_const_pi()

Returns pi.

arb_union()

Returns union of x and y.

arb_sum()

Sum of elements in xs.

arb_product()

Product of elements in xs.

arb_lambertw()

Lambert W function.

arb_sub(x, y, prec)#

Returns x - y.

Parameters:
Return type:

Arb

arb_add(x, y, prec)#

Returns sum of x and y.

Parameters:
Return type:

Arb

arb_mul(x, y, prec)#

Returns product of x and y.

Parameters:
Return type:

Arb

arb_div(x, y, prec)#

Returns quotient of x divided by y.

Parameters:
Return type:

Arb

arb_log(x, prec)#

Returns log(x).

Parameters:
Return type:

Arb

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)].

Parameters:
Return type:

Arb

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)].

Parameters:
Return type:

Arb

arb_pow(x, y, prec)#

Returns x^y.

Parameters:
Return type:

Arb

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)].

Parameters:
Return type:

Arb

arb_abs(x)#

Returns absolute value of x.

Parameters:

x (Arb)

Return type:

Arb

arb_neg(x)#

Returns -x.

Parameters:

x (Arb)

Return type:

Arb

arb_sgn(x)#

Sign function.

If x contains both zero and nonzero numbers, this returns an Arb with mid=0 and rad=1.

Parameters:

x (Arb)

Return type:

Arb

arb_erf(x, prec)#

Error function.

Parameters:
Return type:

Arb

arb_erfc(x, prec)#

Complementary error function.

Parameters:
Return type:

Arb

arb_erfinv(x, prec)#

Inverse error function.

Parameters:
Return type:

Arb

arb_sqrt(x, prec)#

Returns square root of x.

Parameters:
Return type:

Arb

arb_const_pi(prec)#

Returns pi.

Parameters:

prec (int)

Return type:

Arb

arb_union(x, y, prec)#

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)].

Parameters:
Return type:

Arb

arb_sum(xs, prec)#

Sum of elements in xs.

Parameters:
Return type:

Arb

arb_product(xs, prec)#

Product of elements in xs.

Parameters:
Return type:

Arb

arb_lambertw(x, branch, prec)#

Lambert W function.

Parameters:
Return type:

Arb

Classes#

Arb

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#

from_midpoint_radius()

Constructs an Arb by specifying its midpoint and radius.

from_int()

Constructs an exact Arb with midpoint val.

from_float()

Construct an exact Arb with midpoint val.

from_man_exp()

Constructs an exact arb with midpoint specified as mantissa and exponent.

one()

Returns an exact Arb with midpoint 1 and radius 0.

positive_infinity()

Returns an Arb representing positive infinity.

negative_infinity()

Returns an Arb representing negative infinity.

__lt__()

Returns True if self is less than other.

__le__()

Returns True if self is less than or equal to other.

__ne__()

Returns True if self is not equal to other.

__gt__()

Returns True if self is greater than other.

__ge__()

Returns True if self is greater than or equal to other.

__eq__()

Returns True if self is equal to other.

__neg__()

Returns -1 * self.

is_exact()

Returns True if radius is 0.

is_finite()

Returns True if self is finite.

is_nan()

Returns True if midpoint is NaN.

__float__()

Returns a float approximating the midpoint of self.

to_float()

Returns the only floating point number contained in self.

man_exp()

Returns a pair (Mantissa, Exponent) if exact.

lower()

Returns an exact Arb representing the smallest value in self.

upper()

Returns an exact Arb representing the largest value in self.

midpoint()

Returns the midpoint of self.

radius()

Returns the radius of self.

__contains__()

Returns True if value is contained in the interval represented by self.

__del__()

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.

Parameters:
Return type:

Arb

static from_int(val)#

Constructs an exact Arb with midpoint val.

Parameters:

val (int)

Return type:

Arb

static from_float(val)#

Construct an exact Arb with midpoint val.

Parameters:

val (float)

Return type:

Arb

static from_man_exp(man, exp)#

Constructs an exact arb with midpoint specified as mantissa and exponent.

Parameters:
Return type:

Arb

static one()#

Returns an exact Arb with midpoint 1 and radius 0.

Return type:

Arb

static positive_infinity()#

Returns an Arb representing positive infinity.

Return type:

Arb

static negative_infinity()#

Returns an Arb representing negative infinity.

Return type:

Arb

__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:

bool

__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:

bool

__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:

bool

__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:

bool

__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:

bool

__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:

bool

__neg__()#

Returns -1 * self.

Return type:

Arb

is_exact()#

Returns True if radius is 0.

Return type:

bool

is_finite()#

Returns True if self is finite.

Return type:

bool

is_nan()#

Returns True if midpoint is NaN.

Return type:

bool

__float__()#

Returns a float approximating the midpoint of self.

Return type:

float

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.

Parameters:

prec (int)

Return type:

float

man_exp()#

Returns a pair (Mantissa, Exponent) if exact.

If self is not exact, this raises an error.

Return type:

Tuple[int, int]

lower(prec)#

Returns an exact Arb representing the smallest value in self.

Parameters:

prec (int)

Return type:

Arb

upper(prec)#

Returns an exact Arb representing the largest value in self.

Parameters:

prec (int)

Return type:

Arb

midpoint()#

Returns the midpoint of self.

Return type:

Arb

radius()#

Returns the radius of self.

Return type:

Arb

__contains__(value)#

Returns True if value is contained in the interval represented by self.

Parameters:

value (Any)

Return type:

bool

__del__()#

Cleanup.