Names:
doubledouble,
DD
represents a number as the sum of two IEEE doubles.
Library names:
sollya_obj_t sollya_lib_double_double(sollya_obj_t)
sollya_obj_t sollya_lib_double_double_obj()
int sollya_lib_is_double_double_obj(sollya_obj_t)
sollya_obj_t sollya_lib_build_function_double_double(sollya_obj_t)
#define SOLLYA_DD(x) sollya_lib_build_function_double_double(x)
Description:
- doubledouble is both a function and a constant.
- As a function, it rounds its argument to the nearest number that can be written
as the sum of two double precision numbers.
- The algorithm used to compute doubledouble(x) is the following: let xh = double(x)
and let xl = double(x - xh). Return the number xh + xl. Note that if the current
precision is not sufficient to exactly represent xh + xl, a rounding will occur
and the result of doubledouble(x) will be useless.
- As a constant, it symbolizes the double-double precision format. It is used in
contexts when a precision format is necessary, e.g. in the commands
round, roundcoefficients and implementpoly.
See the corresponding help pages for examples.
Example 1:
> verbosity=1!;
> a = 1+ 2^(-100);
> DD(a);
1.0000000000000000000000000000007888609052210118054
> prec=50!;
> DD(a);
1.0000000000000000000000000000008
Go back to the list of commands