<math.h>: what are _REDUCE() and _POLY()

Neil Hunt neil at teleos.com
Sat Jun 3 03:47:13 AEST 1989


Looking in the file /usr/include/math.h, I found macros _POLYn and
_REDUCE.  While _POLYn is quite obvious (it appears to evaluate a
polynomial of order n whose coefficients are stored in an array), the
intended function of reduce is more opaque.  Can anyone shed any light?
Where are these macros used?

/*	@(#)math.h 1.2 86/10/07 SMI; from S5R2 2.5	*/
 ...
#define _REDUCE(TYPE, X, XN, C1, C2)	{ \
	double x1 = (double)(TYPE)X, x2 = X - x1; \
	X = x1 - (XN) * (C1); X += x2; X -= (XN) * (C2); }
 ...
#define _POLY1(x, c)	((c)[0] * (x) + (c)[1])
#define _POLY2(x, c)	(_POLY1((x), (c)) * (x) + (c)[2])
 ...
#define _POLY9(x, c)	(_POLY8((x), (c)) * (x) + (c)[9])

Neil/.

	Neil%Teleos.com at AI.SRI.com
     ...!decwrl!argosy!teleos!neil



More information about the Comp.sys.sun mailing list