Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: neil@teleos.com (Neil Hunt) Newsgroups: comp.sys.sun Subject: : what are _REDUCE() and _POLY() Keywords: SunOS Message-ID: <3643@kalliope.rice.edu> Date: 2 Jun 89 17:47:13 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 21 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 13, message 6 of 17 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@AI.SRI.com ...!decwrl!argosy!teleos!neil