How Do Calculators Calculate? Helmut Knaust Department of Mathematical Sciences University of Texas at El Paso

Similar documents
como trabajan las calculadoras?

Integration Using Tables and Summary of Techniques

Summer Assignment MAT 414: Calculus

Lecture 3. Lecturer: Prof. Sergei Fedotov Calculus and Vectors. Exponential and logarithmic functions

Hyperbolic functions

Accelerated Shift-and-Add algorithms

MAT100 OVERVIEW OF CONTENTS AND SAMPLE PROBLEMS

Completion Date: Monday February 11, 2008

90 Chapter 5 Logarithmic, Exponential, and Other Transcendental Functions. Name Class. (a) (b) ln x (c) (a) (b) (c) 1 x. y e (a) 0 (b) y.

CALCULUS II MATH Dr. Hyunju Ban

Practice Differentiation Math 120 Calculus I Fall 2015

A Library of Functions

On-Line Hardware Implementation for Complex Exponential and Logarithm

Chapter 1. Functions 1.1. Functions and Their Graphs

Preliminaries Lectures. Dr. Abdulla Eid. Department of Mathematics MATHS 101: Calculus I

Solutions to Problem Sheet for Week 6

5-4 Sum and Difference Identities

Continuity. The Continuity Equation The equation that defines continuity at a point is called the Continuity Equation.

Chapter 5 Logarithmic, Exponential, and Other Transcendental Functions

CHAPTER 3 ELEMENTARY FUNCTIONS 28. THE EXPONENTIAL FUNCTION. Definition: The exponential function: The exponential function e z by writing

2 Recollection of elementary functions. II

Using the CORDIC Algorithm for Fast Trigonometric Operations in Hardware

Candidates are expected to have available a calculator. Only division by (x + a) or (x a) will be required.

Complex Numbers. Integers, Rationals, and Reals. The natural numbers: The integers:

JUST THE MATHS UNIT NUMBER DIFFERENTIATION APPLICATIONS 5 (Maclaurin s and Taylor s series) A.J.Hobson

Calculus for Engineers II - Sample Problems on Integrals Manuela Kulaxizi

Math 122 Test 2. October 15, 2013

) # ( 281). Give units with your answer.

Revision Checklist. Unit FP3: Further Pure Mathematics 3. Assessment information

Further Pure Mathematics 3 GCE Further Mathematics GCE Pure Mathematics and Further Mathematics (Additional) A2 optional unit

Calculus. Weijiu Liu. Department of Mathematics University of Central Arkansas 201 Donaghey Avenue, Conway, AR 72035, USA

2. Determine the domain of the function. Verify your result with a graph. f(x) = 25 x 2

Calculus First Semester Review Name: Section: Evaluate the function: (g o f )( 2) f (x + h) f (x) h. m(x + h) m(x)

Denition and some Properties of Generalized Elementary Functions of a Real Variable

Conic Sections in Polar Coordinates

Critical Areas in 2011 Mathematics Frameworks

( ) a (graphical) transformation of y = f ( x )? x 0,2π. f ( 1 b) = a if and only if f ( a ) = b. f 1 1 f

Exponential and logarithm functions

Math 12 Final Exam Review 1

The Big 50 Revision Guidelines for C3

PRE-CALCULUS General Specific Math Skills

Test one Review Cal 2

First Midterm Examination

What students need to know for CALCULUS (Regular, AB and BC) Students expecting to take Calculus should demonstrate the ability to:

SOLVED PROBLEMS ON TAYLOR AND MACLAURIN SERIES

Solution Sheet 1.4 Questions 26-31

Considering our result for the sum and product of analytic functions, this means that for (a 0, a 1,..., a N ) C N+1, the polynomial.

SAMPLE QUESTIONS: ADVANCED MATH SKILLS ASSESSMENT (AMSA)

Getting Ready to Teach Online course Core Pure

MTH4101 CALCULUS II REVISION NOTES. 1. COMPLEX NUMBERS (Thomas Appendix 7 + lecture notes) ax 2 + bx + c = 0. x = b ± b 2 4ac 2a. i = 1.

FUNCTIONS OF ONE VARIABLE FUNCTION DEFINITIONS

Pre-calculus 12 Curriculum Outcomes Framework (110 hours)

Calculus 1 - Lab ) f(x) = 1 x. 3.8) f(x) = arcsin( x+1., prove the equality cosh 2 x sinh 2 x = 1. Calculus 1 - Lab ) lim. 2.

Math Academy I Fall Study Guide. CHAPTER ONE: FUNDAMENTALS Due Thursday, December 8

cos t 2 sin 2t (vi) y = cosh t sinh t (vii) y sin x 2 = x sin y 2 (viii) xy = cot(xy) (ix) 1 + x = sin(xy 2 ) (v) g(t) =

Exam Review 2 nd Semester 6-1 Operations on Functions

Chapter 3 Differentiation Rules (continued)

function independent dependent domain range graph of the function The Vertical Line Test

Paper Reference. Paper Reference(s) 6665/01 Edexcel GCE Core Mathematics C3 Advanced Level. Thursday 18 January 2007 Afternoon Time: 1 hour 30 minutes

Paper Reference. Core Mathematics C3 Advanced Level. Thursday 18 January 2007 Afternoon Time: 1 hour 30 minutes. Mathematical Formulae (Green)

Complex Trigonometric and Hyperbolic Functions (7A)

FINAL - PART 1 MATH 150 SPRING 2017 KUNIYUKI PART 1: 135 POINTS, PART 2: 115 POINTS, TOTAL: 250 POINTS No notes, books, or calculators allowed.

ADVANCED PROGRAMME MATHEMATICS: PAPER I MODULE 1: CALCULUS AND ALGEBRA

AP CALCULUS. DUE THE FIRST DAY OF SCHOOL! This work will count as part of your first quarter grade.

Final Exam A Name. 20 i C) Solve the equation by factoring. 4) x2 = x + 30 A) {-5, 6} B) {5, 6} C) {1, 30} D) {-5, -6} -9 ± i 3 14

General CORDIC Description (1A)

1 Solutions to selected problems

ARE YOU READY 4 CALCULUS

Chapter 3: Transcendental Functions

MTH 121 Fall 2007 Essex County College Division of Mathematics and Physics Worksheet #1 1

2016 FAMAT Convention Mu Integration 1 = 80 0 = 80. dx 1 + x 2 = arctan x] k2

7.1. Calculus of inverse functions. Text Section 7.1 Exercise:

Instructor: Kaddour Boukaabar Program: CMAP4 Parts A_B_C_D

REVIEW: MORE FUNCTIONS AP CALCULUS :: MR. VELAZQUEZ

MATH 1231 MATHEMATICS 1B Calculus Section 1: - Integration.

MATH1231 CALCULUS. Session II Dr John Roberts (based on notes of A./Prof. Bruce Henry) Red Center Room 3065

ENGI 3425 Review of Calculus Page then

5.3 SOLVING TRIGONOMETRIC EQUATIONS

Astronomy Using scientific calculators

MATH 1040 Objectives List

Core Mathematics 3 A2 compulsory unit for GCE Mathematics and GCE Pure Mathematics Mathematics. Unit C3. C3.1 Unit description

Root Finding For NonLinear Equations Bisection Method

Basic Math Formulas. Unit circle. and. Arithmetic operations (ab means a b) Powers and roots. a(b + c)= ab + ac

MATH : Calculus II (42809) SYLLABUS, Spring 2010 MW 4-5:50PM, JB- 138

Math 102 Spring 2008: Solutions: HW #3 Instructor: Fei Xu

Review Guideline for Final

Math 122 Fall Unit Test 1 Review Problems Set A

An angle in the Cartesian plane is in standard position if its vertex lies at the origin and its initial arm lies on the positive x-axis.

UNDERSTANDING ENGINEERING MATHEMATICS

f(g(x)) g (x) dx = f(u) du.

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition

Sets. 1.2 Find the set of all x R satisfying > = > = > = - > 0 = [x- 3 (x -2)] > 0. = - (x 1) (x 2) (x 3) > 0. Test x = 0, 5

4.1 Exponential and Logarithmic Functions

Math 181, Exam 2, Fall 2014 Problem 1 Solution. sin 3 (x) cos(x) dx.

Math 181, Exam 2, Study Guide 2 Problem 1 Solution. 1 + dx. 1 + (cos x)2 dx. 1 + cos2 xdx. = π ( 1 + cos π 2

VCE. VCE Maths Methods 1 and 2 Pocket Study Guide

Essential Mathematics

Centre No. Candidate No. Paper Reference(s) 6665 Edexcel GCE Core Mathematics C3 Advanced Level Mock Paper

Trigonometric substitutions (8.3).

Questions. x 2 e x dx. Use Part 1 of the Fundamental Theorem of Calculus to find the derivative of the functions g(x) = x cost2 dt.

Transcription:

How Do Calculators Calculate? Helmut Knaust Department of Mathematical Sciences University of Texas at El Paso Helmut Knaust How Do Calculators Calculate? April 25, 1997 1 / 18

History 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. Helmut Knaust How Do Calculators Calculate? April 25, 1997 2 / 18

History 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. Helmut Knaust How Do Calculators Calculate? April 25, 1997 3 / 18

Introduction 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: 1 Addition and Subtraction 2 Storing in memory and Retrieving from memory 3 Digit shift (multiplication/division by the base) 4 Comparisons Helmut Knaust How Do Calculators Calculate? April 25, 1997 4 / 18

Introduction The CORDIC Algorithm is a unified computational scheme to perform 1 multiplication and division 2 computations of the trigonometric functions sin, cos, arctan 3 computations of the hyperbolic trigonometric functions sinh, cosh, arctanh 4 and consequently can also compute the exponential function, the natural logarithm and the square root Helmut Knaust How Do Calculators Calculate? April 25, 1997 5 / 18

Introduction The CORDIC Algorithm (Binary Version) x k+1 = x k mδ k y k 2 k (1) y k+1 = y k + δ k x k 2 k (2) z k+1 = z k δ k ε k (3) δ k = ±1 (depending on y k or z k ) (4) The ε k s are prestored constants. m = 0, ±1 (5) Helmut Knaust How Do Calculators Calculate? April 25, 1997 6 / 18

Example 1 A Warm-Up Example: Multiplication To compute the product of a and b for a 2 and b 2 we let The scheme becomes m = 0, ε k = 2 k. x k+1 = x k (= x 0 ) (6) y k+1 = y k + δ k x k 2 k (7) z k+1 = z k δ k 2 k (8) δ k = sgn(z k ) (9) x 0 = a (10) y 0 = 0 (11) Helmut Knaust How Do Calculators Calculate? April 25, 1997 7 / 18

Example 1 From the previous examples we suspect that z n 0 and that y n ab. Let s check: Theorem z n+1 2 n Proof by induction: By the restriction placed on b z 0 = b 2 ( 1) = 2. Now suppose z n 2 (n 1) = 2 n+1. By definition z n+1 = z n sgn(z n )2 n. There are two cases to consider: If 0 z n 2 n+1, then sgn(z n ) = 1, and consequently 2 n z n+1 2 n. If on the other hand 2 n+1 z n < 0, then sgn(z n ) = 1, and consequently 2 n z n+1 2 n. Helmut Knaust How Do Calculators Calculate? April 25, 1997 8 / 18

Example 1 Theorem y n+1 ab 2 n+1 Proof: Note that the iterative formulas imply: n z n+1 = z 0 δ k 2 k, k=0 and Consequently y n+1 = y 0 + ( n ) δ k 2 k x 0. k=0 y n+1 ab = y n+1 x 0 z 0 = (y 0 + (z 0 z n+1 )x 0 ) x 0 z 0 = 0 z n+1 x 0 2 n 2 = 2 n+1 Helmut Knaust How Do Calculators Calculate? April 25, 1997 9 / 18

Example 2 An Example: Computing sin and cos To compute sin θ and cos θ for θ π/2 we let m = 1, ε k = arctan(2 k ). We also define n C = cos(ε k ). k=0 The scheme becomes x k+1 = x k δ k y k 2 k (13) y k+1 = y k + δ k x k 2 k (14) z k+1 = z k δ k ε k (15) δ k = sgn(z k ) (16) x 0 = C (17) y 0 = 0 (18) z 0 = θ (19) Helmut Knaust How Do Calculators Calculate? April 25, 1997 10 / 18

The CORDIC Theorem Theorem The Cordic Representation Theorem Suppose (ε k ) n k=0 is a decreasing sequence of positive real numbers satisfying n ε k + ε n j=k+1 for k = 0, 1,..., n, and suppose r is a real number such that n r ε j. ε j k=0 If s 0 = 0, and s k+1 = s k + δ k ε k, for k = 0, 1,..., n, where δ k = sgn (r s k ). Then n r s n+1 = r δ k ε k < ε n. Proof: By induction. k=0 Helmut Knaust How Do Calculators Calculate? April 25, 1997 11 / 18

The CORDIC Theorem The previous theorem and some computations tell us that it is possible to write the angle r = θ as a combination of the angles ε k, more precisely, we can choose δ k = ±1 so that Set s n+1 = n k=0 δ kε k. θ n δ k ε k < ε n. k=0 Helmut Knaust How Do Calculators Calculate? April 25, 1997 12 / 18

The CORDIC Theorem 0.6 1 0.5 3 6 5 0.4 4 0.3 2 0.2 0.1 Θ 0 0.2 0.4 0.6 0.8 1.0 x Helmut Knaust How Do Calculators Calculate? April 25, 1997 13 / 18

The CORDIC Theorem We then have the following Theorem If x 0 = n k=0 cos ε k and y 0 = 0, then x n+1 = cos s n+1 and y n+1 = sin s n+1. Proof (by induction, sketch): x n+1 = x n δ n y n 2 n = (cos s n cos ε n ) δ n (sin s n cos ε n ) tan ε n = cos s n cos ε n δ n sin s n sin ε n = cos(s n + δ n ε n ) = cos(s n+1 ) Helmut Knaust How Do Calculators Calculate? April 25, 1997 14 / 18

Computing Transcendental Functions m = 1 1 x n+1 cos θ, y n+1 sin θ: Trigonometric Functions ε k = arctan(2 k ), δ k = sgn z k, x 0 = n k=0 cos(ε k), y 0 = 0, z 0 = θ 2 z n+1 arctan(y 0 /x 0 ): ε k = arctan(2 k ), δ k = sgn y k, z 0 = 0 Helmut Knaust How Do Calculators Calculate? April 25, 1997 15 / 18

Computing Transcendental Functions m = 1 1 x n+1 cosh θ, y n+1 sinh θ, and thus x n+1 + y n+1 e θ : Hyperbolic Functions ε k = arctanh(2 k ) (repeated), δ k = sgn z k, x 0 = C, y 0 = 0, z 0 = θ 2 z n+1 arctanh(y 0 /x 0 ), x n+1 C x 2 0 y 2 0, and thus we obtain an approximation of ln x = 2 arctanh ε k = arctanh(2 k ) (repeated), δ k = sgn y k, z 0 = 0 ( ) x 1 : x + 1 Helmut Knaust How Do Calculators Calculate? April 25, 1997 16 / 18

Multiplication and Division Multiplication and Division m = 0 1 y n+1 x 0 z 0 : ε k = 2 k, δ k = sgn z k, y 0 = 0 2 z n+1 y 0 /x 0 : ε k = 2 k, δ k = sgn y k, z 0 = 0 Helmut Knaust How Do Calculators Calculate? April 25, 1997 17 / 18

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. Beamer version: December 2012. Helmut Knaust How Do Calculators Calculate? April 25, 1997 18 / 18