Next: , Previous: , Up: Rational Interval Functions   [Index]


5.6 Interval Arithmetic Functions

Inline Function: void mpri_add (mpri_t rop, const mpri_t op1, const mpri_t op2)
Inline Function: void mpri_add_q (mpri_t rop, const mpri_t op1, const mpq_t op2)

Set rop to op1 + op2.

Inline Function: void mpri_sub (mpri_t rop, const mpri_t op1, const mpri_t op2)
Inline Function: void mpri_sub_q (mpri_t rop, const mpri_t op1, const mpq_t op2)
Inline Function: void mpri_q_sub (mpri_t rop, const mpq_t op1, const mpri_t op2)

Set rop to op1 - op2.

Function: void mpri_mul (mpri_t rop, const mpri_t op1, const mpri_t op2)
Inline Function: void mpri_mul_q (mpri_t rop, const mpri_t op1, const mpq_t op2)

Set rop to op1 * op2. Multiplication by zero, passed as singleton interval [0/1,0/1] or literally, gives the singleton interval [0/1,0/1].

Function: void mpri_div (mpri_t rop, const mpri_t op1, const mpri_t op2)
Inline Function: void mpri_div_q (mpri_t rop, const mpri_t op1, const mpq_t op2)
Inline Function: void mpri_q_div (mpri_t rop, const mpq_t op1, const mpri_t op2)

Set rop to op1/op2. When the dividend op1 reduces to the singleton interval [0/1,0/1], viz. zero, the division returns the singleton interval [0/1,0/1] as result; when the divisor op2 contains zero, the division returns [0/0,0/0], namely NaN.

Inline Function: void mpri_neg (mpri_t rop, const mpri_t op)

Set rop to -op.

Inline Function: void mpri_abs (mpri_t rop, const mpri_t op)

Set rop to abs(op), the absolute value of op.

Inline Function: void mpri_inv (mpri_t rop, const mpri_t op)

Set rop to 1/op when the rational interval op does not contains zero, to [0/0,0/0] (NaN) otherwise.

Inline Function: void mpri_sqr (mpri_t rop, const mpri_t op)

Set rop to the square of op.

Inline Function: void mpri_sqrt (mpri_t rop, const mpri_t op, mpri_prec_t prec)

Set rop to the best rational interval approximation of the square root of op, sqrt(op), with a guaranteed precision of at least prec bits. If the rational interval radicand op is not positive, the return interval is [0/0,0/0], namely NaN. This inline function implements an efficient wrapper around the low-level function mpri_set_qi_z_ASGMT.

Inline Function: void mpri_rsqrt (mpri_t rop, const mpri_t op, mpri_prec_t prec)

Set rop to the best rational interval approximation of the reciprocal square root of op, literally sqrt(op)/op, with a guaranteed precision of at least prec bits. If the rational interval operand op is not strictly positive, the return interval is [0/0,0/0], to wit NaN. This inline function efficiently implements a wrapper around the low-level function mpri_set_qi_z_ASGMT.

Inline Function: void mpri_mul_2exp (mpri_t rop, const mpri_t op, unsigned long int exponent)

Set rop to op times 2 raised to exponent.

Inline Function: void mpri_div_2exp (mpri_t rop, const mpri_t op, unsigned long int exponent)

Set rop to op divided by 2 raised to exponent.


Next: , Previous: , Up: Rational Interval Functions   [Index]