double_interval.h – double-precision interval arithmetic and helpers¶
This module provides helper functions for computing fast enclosures
using double
arithmetic.
Types, macros and constants¶
-
type di_t¶
Holds two
double
endpointsa
andb
representing the extended real interval \([a, b]\). We generally assume that \(a \le b\) and that neither endpoint is NaN.
Basic manipulation¶
-
di_t di_interval(double a, double b)¶
Returns the interval \([a, b]\). We require that the endpoints are ordered and not NaN.
-
void arb_set_di(arb_t res, di_t x, slong prec)¶
Sets the ball res to the double-precision interval x, rounded to prec bits.
-
void di_print(di_t x)¶
Prints x to standard output. This simply prints decimal representations of the floating-point endpoints; the decimals are not guaranteed to be rounded outward.
-
double d_randtest2(flint_rand_t state)¶
Returns a random non-NaN
double
with any exponent. The value can be infinite or subnormal.
-
di_t di_randtest(flint_rand_t state)¶
Returns an interval with random endpoints.
Arithmetic¶
Fast arithmetic¶
The following methods perform fast but sloppy interval arithmetic: we manipulate the endpoints with default rounding and then add or subtract generic perturbations regardless of whether the operations were exact. It is currently assumed that the CPU rounding mode is to nearest.
-
di_t di_fast_add(di_t x, di_t y)¶
-
di_t di_fast_sub(di_t x, di_t y)¶
-
di_t di_fast_mul(di_t x, di_t y)¶
-
di_t di_fast_div(di_t x, di_t y)¶
Returns the sum, difference, product or quotient of x and y. Division by zero is currently defined to return \([-\infty, +\infty]\).
-
di_t di_fast_add_d(di_t x, double y)¶
-
di_t di_fast_sub_d(di_t x, double y)¶
-
di_t di_fast_mul_d(di_t x, double y)¶
-
di_t di_fast_div_d(di_t x, double y)¶
Arithmetic with an exact
double
operand.