VSUM 3CW "28 December 2009" "mathcw-1.00"

Table of contents


NAME

vsumf, vsum, vsuml, vsumw, vsumq, vsumll, vsumdf, vsumd, vsumdl, vsumdll - sum vector of numbers with error correction

SYNOPSIS

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

#include <mathcw.h>

extern float vsumf (float *perr, int n, float v[/* n */]);

extern double vsum (double *perr, int n, double v[/* n */]);

extern long double vsuml (long double *perr, int n, long double v[/* n */]);

extern __float80 vsumw (__float80 *perr, int n, __float80 v[/* n */]);

extern __float128 vsumq (__float128 *perr, int n, __float128 v[/* n */]);

extern long_long_double vsumll (long_long_double *perr, int n,
                                long_long_double v[/* n */]);

extern decimal_float vsumdf (decimal_float *perr, int n, decimal_float v[/* n */]);

extern decimal_double vsumd (decimal_double *perr, int n, decimal_double v[/* n */]);

extern decimal_long_double vsumdl (decimal_long_double *perr, int n,
                                   decimal_long_double v[/* n */]);

extern decimal_long_long_double vsumdll (decimal_long_long_double *perr, int n,
                                         decimal_long_long_double v[/* n */]);

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


DESCRIPTION

Compute the sum of n floating-point numbers with error correction. The sum is returned as the function value, and the (usually small) correction in the variable pointed to by the first argument. If that argument is a NULL pointer, storage of the correction is silently suppressed. The mathematical sum of the function value and the correction may approximate the true (infinite-precision) vector sum to roughly twice working precision.

RETURN VALUES

Return the sum of n elements v[0] + v[1] + ... + v[n-1].

ERRORS

None.