RealFns: CEDAR DEFINITIONS = BEGIN Exp: PROC [REAL] RETURNS [REAL]; Log: PROC [base, arg: REAL] RETURNS [REAL]; Ln: PROC [REAL] RETURNS [REAL]; SqRt: PROC [REAL] RETURNS [REAL]; Root: PROC [index, arg: REAL] RETURNS [REAL]; Power: PROC [base, exponent: REAL] RETURNS [REAL]; Sin: PROC [radians: REAL] RETURNS [sin: REAL]; SinDeg: PROC [degrees: REAL] RETURNS [sin: REAL]; Cos: PROC [radians: REAL] RETURNS [cos: REAL]; CosDeg: PROC [degrees: REAL] RETURNS [cos: REAL]; Tan: PROC [radians: REAL] RETURNS [tan: REAL]; TanDeg: PROC [degrees: REAL] RETURNS [tan: REAL]; ArcTan: PROC [y, x: REAL] RETURNS [radians: REAL]; ArcTanDeg: PROC [y, x: REAL] RETURNS [degrees: REAL]; AlmostZero: PROC [x: REAL, distance: [-126..127]] RETURNS [BOOL]; AlmostEqual: PROC [y, x: REAL, distance: [-126..0]] RETURNS [BOOL]; END. ςRealFns.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Stewart, August 27, 1982 11:21 am Russ Atkinson (RRA) February 19, 1985 4:11:34 pm PST Doug Wyatt, February 27, 1985 8:41:51 am PST For an input argument n, returns e^n (e=2.718...). Computed by continued fractions. Computes logarithm to the base base of arg. Computed by Ln(arg)/Ln(base). Computes the natural logarithm (base e) of the input argument. Calculates the square root of the input value by Newton's iteration. Calculates the index root of arg by e(Ln(arg)/index). Calculates base to the exponent power by e(exponent*Ln(base)). Computes the trigonometric functions by polynomial; good to 7.33 decimal places. Good to 8.7 decimal places. AlmostZero returns TRUE if ABS[x] is smaller than 2^distance. AlmostEqual returns TRUE if ABS[x-y]/MAX[ABS[x],ABS[y]] is smaller than 2^distance. That is, the exponent of the result of the subtract must be ABS[distance] smaller than the larger exponent of the operands. Κ˜codešœ ™ Kšœ Οmœ1™™>K™—š  œŸœŸœŸœŸœ˜!KšœD™DK™—š  œŸœŸœŸœŸœ˜-Kšœ5™5K™—š  œŸœŸœŸœŸœ˜2Kšœ>™>K™—K˜Kš  œŸœ ŸœŸœŸœ˜.š  œŸœ ŸœŸœŸœ˜1K˜—Kš  œŸœ ŸœŸœŸœ˜.š  œŸœ ŸœŸœŸœ˜1K˜—Kš  œŸœ ŸœŸœŸœ˜.š  œŸœ ŸœŸœŸœ˜1Kšœ3™3Kšœ™K™—Kš  œŸœŸœŸœ Ÿœ˜2š   œŸœŸœŸœ Ÿœ˜5Kšœ™K™—K˜š   œŸœŸœŸœŸœ˜AKšœ=™=K™—š   œŸœŸœŸœŸœ˜CKšœΠ™ΠK™—K˜KšŸœ˜—…—2 ΄