Saturday, February 4, 2023

Casio fx-9750GIII: Effects of Rounding

 Casio fx-9750GIII:  Effects of Rounding



How Accurate?


The program ROUNDS compare true results against the true results in one of five calculations:


1.  A × B × C

2.  A × B ÷ C

3.  √(A^2 + B^2 - C^2)

4.  A ÷ B ÷ C

5.  (A + 1 ÷ B)^C


The rounded result is calculated after rounding after each step.


For example:  A × B × C


True result:  

T = A × B × C


Rounded Result:

R = round(A × B)

R = round(R × C)


The absolute error percentage is calculated.   



Casio fx-9750GIII Program:  ROUNDS


"2022-11-23 EWS"

"EFFECTS OF ROUNDING"

"# OF PLACES"?→N

"A"?→A

"B"?→B

"C"?→C

Menu "SELECT OPERATION",

"A×B×C",A

"A×B÷C",B

"√(A^2 + B^2 - C^2)",C

"A÷B÷C",D

"(A+1÷B)^C",E

Lbl A

RndFix(A×B,N)→R

RndFix(R×C,N)→R

A×B×C→T

Goto 1

Lbl B

RndFix(A×B,N)→R

RndFix(R÷C,N)→R

A×B÷C→T

Goto 1

Lbl C

RndFix(A²+B²,N)→R

RndFix(√(R-C²),N)→R

√(A²+B²- C²)→T

Goto 1

Lbl D

RndFix(A÷B,N)→R

RndFix(R÷C,N)→R

A÷B÷C→T

Goto 1

Lbl E

RndFix(A+1÷B,N)→R

RndFix(R^C,N)→R

(A+1÷B)^C→T

Goto 1

Lbl 1

RndFix(100×Abs (R-T)÷T,5)→E

ClrText

Locate 1,3,"ROUNDED:"

Locate 9,3,R

Locate 1,4,"ACTUAL:"

Locate 9,4,T

Locate 1,5,"ERROR%:"

Locate 9,5



Example:


Let A = 13.946, B = 11.9765, C = π^3/4

Round to 2 decimal places (N = 2)


1.  A × B × C

Rounded:  1294.67

Actual:  1294.700174

Error:  2.33*10^-3 %


2.  A × B ÷ C

Rounded: 21.55

Actual:  21.54715585

Error:  0.0132%


3.  √(A^2 + B^2 - C^2)

Rounded: 16.67

Actual:  16.66855254

Error:  8.68*10^-3 %


4.  A ÷ B ÷ C

Rounded: 0.15

Actual: 0.1502208155

Error: 0.14699%


5.  (A + 1 ÷ B)^C

Rounded: 778927217

Actual:  778710708.2

Error:  0.0278%



Enjoy,  


Eddie 


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Casio fx-CG50 and Swiss Micros DM32: HP 16C’s Bit Summation

  Casio fx-CG50 and Swiss Micros DM32: HP 16C’s Bit Summation The HP 16C’s #B Function The #B function is the HP 16C’s number of...