256 Part 3 The instruction-set processor level: variations in the processor
Section 4 Desk calculator computers: keyboard processors with small memories
The algorithm produces tan 6. Therefore, in the Model 9100A, cos q is generated as
Sin q could be obtained from the relationship sin q = Ö 1 - cos2q , for example, but the use of the tangent relationship preserves the 12 digit accuracy for very small angles, even in the range of q < 10-12. Th proper sins of the functions are assigned from the scaling constants.
For the polar to rectangular functions, cos q and sin q are computed and multiplied by the radius vector to obtain the X and Y coordinates. In performing the rectangular to polar function, the signs of both the X and Y vectors are retained to place the resulting angle in the right quadrant.
Prescaling must also precede the inverse circular functions, since this routine operates on arguments less than or equal to 1. The inverse circular algorithm yields arctangent functions, making it necessary to use the trigonometric identity.
If cos-1(x) is desired, the arcsin relationship is used and a scaling constant adds p /2 after completion of the function. For arguments greater than 1, the arccotangent of the negative reciprocal is found which yields the arctangent when p /2 is added.
Exponential and logarithms
The exponential routine uses a compound iteration algorithm which has an argument range of 0 to the natural log of 10 (1n 10). Therefore, to be able to handle any argument within the dynamic range of the calculator, it is necessary to prescale the absolute value of the argument by dividing it by 1n 10 and saving the integer part to be used as the exponent of the final answer. The fractional part is multiplied by 1n 10 and the exponential found. This number is the mantissa, and with the previously saved integer part as a power of 10 exponent, becomes the final answer.
The exponential answer is reciprocated in case the original argument was negative, and for use in the hyperbolic functions. For these hyperbolic functions, the following identities are used:
The exponential routine in reverse is used as the routine for natural logs, with only the mantissa operated upon. Then the exponent is multiplied by 1n 10 and added to the answer. This routine also yields these log10 and are hyperbolic functions:
The sinh-1(x) relationship above yields reduced accuracy for negative values of x. Therefore, in the Model 9100A, the absolute value of the argument is operated upon and the correct sign affixed after completion.
It can be seen from the discussion of the algorithms that extreme care has been taken to use routines that have accuracy commensurate with the dynamic range of the calculator. For example; the square root has a maximum possible relative error of 1 part in 1010 over the full range of the machine.
There are many algorithms for determining the sine of an angle; most of these have points of high error. The sine routine in the Model 9100A has consistent low error regardless of quadrant. Marrying a full floating decimal calculator with unique mathematical algorithms results in accuracy of better than 10 displayed digits.