## How Do Calculators Calculate?

Helmut Knaust
Department of Mathematical Sciences
University of Texas at El Paso

### Introduction

We give an introduction to the CORDIC method used my most handheld calculators (such as the ones by Texas Instruments and Hewlett-Packard) to approximate the standard transcendental functions.

The CORDIC algorithm does not use Calculus based methods such as polynomial or rational function approximation.

The CORDIC (= COordinate Rotation DIgital Computer) algorithm was developed by Jack E. Volder in 1959.

His objective was to build a real-time navigational computer for use on aircrafts, so he was primarily interested in computing trigonometric functions.

Subsequently, the CORDIC scheme was extended by J. Walther in 1971 to other transcendental functions.

Hand-held calculators do not convert numbers to base 2. They use a binary-coded decimal (BCD) system instead.

Calculators can only perform four operations inexpensively:

2. Storing in memory and Retrieving from memory
3. Digit shift (multiplication/division by the base)
4. Comparisons

The CORDIC Algorithm is a unified computational scheme to perform

1. multiplication and division
2. computations of the trigonometric functions
3. computations of the hyperbolic trigonometric functions
4. and consequently can also compute the exponential function, the natural logarithm and the square root

### An Example:

Computing and

To compute and for we let

We also define

The scheme becomes

The Cordic Representation Theorem

Suppose is a decreasing sequence of positive real numbers satisfying

for , and suppose r is a real number such that

If , and , for , where

then

Proof: By induction.

The previous Theorem and some computations tell us that it is basically possible to write the angle as a combination of the angles , more precisely, we can choose so that

Set . We then have the following

Theorem. If and , then and .

Proof (by induction, sketch):

### Implementation for various functions:

Trigonometric Functions

1. , :

, ,
, ,

2. :

, ,

Hyperbolic Functions

1. , ,
and thus :

(repeated), ,
, ,

2. , ,
and thus we obtain an approximation of :

(repeated), ,

Multiplication and Division

1. :

, ,

2. :

, ,

### References

1. Charles W. Schelin
Calculator Function Approximation
American Math. Monthly 90, 1983, 317-325.
2. Jack E. Volder
The CORDIC Trigonometric Computing Technique
IRE Transcactions EC-8, 1959, 330-334
3. Richard J. Pulskamp and James A. Delaney
Computer and Calculator Computation of Elementary Functions
UMAP Module 708, 1991.

More information can be found on Bruce H. Edwards' Cordic Algorithm page.

Helmut Knaust
Wed Sep 17 12:16:32 MDT 1997. Reference updated Dec 5 2005.