PEPS 3CW "17 April 2007" "mathcw-1.00"

Table of contents


NAME

pepsf, peps, pepsl, pepsw, pepsq, pepsll, pepsdf, pepsd, pepsdl, pepsdll - pair-precision machine epsilon

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern void pepsf (double_pair x, const double_pair y);

extern void peps (double_pair x, const double_pair y);

extern void pepsl (double_pair x, const double_pair y);

extern void pepsw (double_pair x, const double_pair y);

extern void pepsq (double_pair x, const double_pair y);

extern void pepsll (long_long_double_pair x, const long_long_double_pair y);

extern void pepsdf (decimal_float_pair x, const decimal_float_pair y);

extern void pepsd (decimal_double_pair x, const decimal_double_pair y);

extern void pepsdl (decimal_long_double_pair x, const decimal_long_double_pair y);

extern void pepsdll (decimal_long_long_double_pair x, const decimal_long_long_double_pair y);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the generalized pair-precision machine epsilon of x: the smallest positive number that can be added to x such that the sum differs from x.

When the argument is one, the result is the normal machine epsilon, sometimes called the big epsilon. With T-digit precision in ordinary arithmetic, the pair-precision normal machine epsilon is BASE**(1 - 2*T).

When the argument is negative one, the result is the normal machine epsilon divided by the base, sometimes called the little epsilon.

When the argument is zero, the result is the smallest representable floating-point number. In IEEE 754 arithmetic, when gradual underflow is supported, the result is the smallest positive subnormal number; otherwise, it is the smallest positive normal number.

When the argument is Infinity or NaN, the result is a NaN.

NB: The normal algorithm for computing the generalized machine epsilon

    eps = (x == 0) ? 1 : x;
    while ((x + eps/BASE) != x)
        eps /= BASE;
cannot be used with pair-precision arithmetic because the low component comes out too small. The revised algorithm in the pexp(3CW) family does the job correctly, and with less work.

RETURN VALUES

None. The function result is stored in the first argument, result.

ERRORS

None.

SEE ALSO

pabs(3CW), pacos(3CW), pacosh(3CW), padd(3CW), pasin(3CW), pasinh(3CW), patan(3CW), patan2(3CW), patanh(3CW), pcbrt(3CW), pcmp(3CW), pcon(3CW), pcopy(3CW), pcopysign(3CW), pcos(3CW), pcosh(3CW), pcotan(3CW), pdiv(3CW), pdot(3CW), peval(3CW), pexp(3CW), pexp10(3CW), pexp16(3CW), pexp2(3CW), pexp8(3CW), pexpm1(3CW), pfdim(3CW), pfmax(3CW), pfmin(3CW), pfrexp(3CW), pfrexph(3CW), phigh(3CW), phypot(3CW), pierf(3CW), pierfc(3CW), pilogb(3CW), pin(3CW), pinfty(3CW), pipow(3CW), pisinf(3CW), pisnan(3CW), pisqnan(3CW), pissnan(3CW), pldexp(3CW), pldexph(3CW), plog(3CW), plog101p(3CW), plog1p(3CW), plow(3CW), pmul(3CW), pmul2(3CW), pneg(3CW), pout(3CW), pprosum(3CW), pqnan(3CW), pscalbln(3CW), pscalbn(3CW), pset(3CW), psignbit(3CW), psin(3CW), psinh(3CW), psnan(3CW), psplit(3CW), psqrt(3CW), psub(3CW), psum(3CW), psum2(3CW), ptan(3CW), ptanh(3CW).