ULPSK 3CW "25 November 2009" "mathcw-1.00"

Table of contents


NAME

ulpskf, ulpsk, ulpskl, ulpskw, ulpskq, ulpskll, ulpskdf, ulpskd, ulpskdl, ulpskdll - Kahan ulp function

SYNOPSIS

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

#include <mathcw.h>

extern float ulpskf (float approx, double exact);

extern double ulpsk (double approx, long double exact);

extern long double ulpskl (long double approx, long_long_double exact);

extern __float80 ulpskw (__float80 approx, long_long_double exact);

extern __float128 ulpskq (__float128 approx, long_long_double exact);

extern long_long_double ulpskll (long_long_double approx, long_long_double exact);

extern decimal_float ulpskdf (decimal_float approx, decimal_double exact);

extern decimal_double ulpskd (decimal_double approx, decimal_long_double exact);

extern decimal_long_double ulpskdl (decimal_long_double approx,
                                    decimal_long_long_double exact);

extern decimal_long_long_double ulpskdll (decimal_long_long_double approx,
                                          decimal_long_long_double exact);

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


DESCRIPTION

Return the error in Kahan ulps (units in the last place) of the first argument compared to the second, defined by |approx - exact| / ulpk(exact).

Notice that the precision of the second argument is higher (when possible) than that of the first argument, in order to allow a sensible difference to be computed.


RETURN VALUES

If either argument is a NaN, return a NaN. Otherwise, return their absolute difference in ulps.

ERRORS

None.

SEE ALSO

ulpk(3CW), ulpmh(3CW), ulpsmh(3CW).