Showing posts with label DM 41L. Show all posts
Showing posts with label DM 41L. Show all posts

Sunday, October 27, 2019

HP 12C and HP 41C/DM41L: Rounding Numbers

HP 12C and HP 41C/DM41L:  Rounding Numbers

Introduction

The following program rounds positive numbers to the desired decimal amount of places.  For example,  √3 rounded to 3 places is 1.732.  e^2 rounded to 2 places is 7.39. 

Set up your stack like this:
Y:  number
X: number of decimal places

HP 12C Program: Rounding

Step;  Code;   Key
01;  1;  1
02;  0;  0
03;  34;  x<>y
04;  21;  y^x
05;  36;  ENTER
06;  33;  R↓
07;  20;  *
08;  36;  ENTER
09;  43,24;  FRAC
10;  40;  +
11;  43, 25;  ITNG
12;  33;  R↓
13;  33;  R↓
14;  33;  R↓
15;  10;  ÷
16;  43,33,00;  GTO 00

HP 41C Program:  Rounding

01  LBL^T ROUND
02  10↑X
03  STO T
04 *
05 ENTER↑
06 FRC
07 +
08 INT
09 R↑
10 /
11 RTN
12 END

Examples:

Round √3 rounded to 3 places

Y:  3, sqrt   (√3)
X:  3

Result:  1.732

Round e^2 rounded to 2 places. is 7.39. 

Y: 2,  e^x  (e^2)
X:  2

Result:  7.39

Eddie

All original content copyright, © 2011-2019.  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.

Monday, August 19, 2019

HP 41/DM41L and TI-60X: Exponentiation of Large Numbers

HP 41/DM41L  and TI-60X:  Exponentiation of Large Numbers

But Why a Program when we have Button?

This is true.  What this program does is allow for calculation of y^x when results in answers greater than 9.999999999 * 10^9.  The number is broken up into the form:

mantissa * 10^exponent

Let n = y^x.  Then:

n = y^x

Taking the logarithm of both sides:

log n = log (y^x)
log n = x log y

A number can be split into its fractional and integer part:

log n = frac(x log y) + int(x log y)

Take the antilog of both sides:

n = 10^( frac(x log y) + int(x log y) )
n = 10^( frac(x log y) ) * 10^( int(x log y) )

where
mantissa = 10^( frac(x log y) )
exponent = int(x log y)

HP 41/DM 41L Program BIGPOW

Input:
Y stack:  y
X stack:  x

Output:
Y:  mantissa (shown first)
X:  exponent

01 LBL T^BIGPOW
02 X<>Y
03 LOG
04 *
05 ENTER↑
06 FRC
07 10↑X
08 STOP
09 X<>Y
10 INT
11 RTN

TI-60 Program:  Big Powers

Input:
Store y in R1 and x in R2

Output:
R1 = mantissa (shown first), R2 = exponent

(Step,  Key Number, Key)
00, 71, RCL
01, 02, 2
02, 65, *
03, 71, RCL
04, 01, 1
05, 43, log
06, 95, =
07, 61, STO
08, 02, 2
09, 78, Frac
10, 12, INV
11, 43, log
12, 61, STO 
13, 01, 1
14, 13, R/S
15, 71, RCL
16, 02, 2
17, 79, Intg
18, 13, R/S
19, 22, RST

Examples

Example 1:  25^76.   y = 25, x = 76

Result: 
Mantissa = 1.75162308
Exponent = 106
25^76 ≈ 1.75162308 * 10^106

Example 2:  78^55.25,  y = 78, x = 55.25

Result:
Mantissa = 3.453240284
Exponent = 104
78^55.25 ≈ 3.543240284 * 10^104

Eddie

All original content copyright, © 2011-2019.  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.

Thursday, March 21, 2019

DM 41L: A Song of Irrational Numbers

Tones of the first ten digits of the constants π, √2, Zeta(2), Phi (Golden Ratio constant), and e (Euclidean constant) using the Swiss Micros DM 41L


Eddie

All original content copyright, © 2011-2019.  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. 

Sunday, December 16, 2018

DM 41L and HP 41C: Generating a Polynomial Given Its Roots

DM 41L and HP 41C:  Generating a Polynomial Given Its Roots

Introduction

Generate the coefficients of a polynomial (up to the order 4) with the roots a_0, a_1, a_2, and a_3.   The resulting polynomial is:

p(x) = (x - a_0) * (x - a_1) * (x - a_2) * (x - a_3) * (x - a_4)

p(x) = r_4 * x^4 + r_5 * x^3 + r_6 * x^2 + r_7 * x + r_8

The default is a polynomial where the lead coefficient is positive.   If you want a polynomial where the lead coefficient is negative, multiply every coefficient by -1.

Instructions

Store the four roots in registers R00, R01, R02, and R03 respectively.  Run POLY4.  Coefficients are shown briefly as they are calculated.  They are can be recalled by the registers in decreasing order of x:  R04, R05, R06, R07, and R08.

DM 41L and HP 41C Program: POLY4

01  LBL^T POLY4
02 1
03 STO 04
04 PSE 
05 RCL 00
06 CHS
07 RCL 01
08 -
09 RCL 02
10 -
11 RCL 03
12 -
13 STO 05
14 PSE
15 RCL 01
16 RCL 02
17 +
18 RCL 03
19 +
20 RCL 00
21 * 
22 RCL 02
23 RCL 03
24 +
25 RCL 01
26 *
27 +
28 RCL 02
29 RCL 03
30 *
31 +
32 STO 06
33 PSE
34 RCL 01
35 RCL 02
36 *
37 RCL 01
38 RCL 03
39 *
40 +
41 RCL 02
42 RCL 03
43 *
44 +
45 RCL 00
46 *
47 CHS
48 RCL 01
49 RCL 02
50 *
51 RCL 03
52 *
53 -
54 STO 07
55 PSE
56 RCL 00
57 RCL 01
58 *
59 RCL 02
60 *
61 RCL 03
62 *
63 STO 08
64 RTN

Example

Roots x = -3, x = 3, x= 4, and x= 6

Coefficients: 
R04 = 1
R05 = -10
R06 = 15
R07 = 90
R08 = -216

Polynomial:  p(x) = x^4 - 10 * x^3 + 15 * x^2 + 90 * x - 216

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

Monday, August 27, 2018

HP 12C Platinum and DM 41L: Rounding Numbers


HP 12C Platinum and DM 41L:  Rounding Numbers

Introduction

The following programs will round any positive number to any number of decimal places, regardless of your fix/float settings.  The formula for rounding x to n decimal places:

int(10^n * x + 0.5) / 10^n

HP 12C Platinum Program (also for HP 12C): Rounding a positive number

Step
Key Code
Key

001
1
1

002
0
0

003
34
x<>y

004
21
y^x

005
20
*

006
43, 40
LST x
For HP 12C regular: the code is 43, 36
007
34
x<>y

008
48
.

009
5
5

010
40
+

011
43, 25
ITNG

012
34
x<>y

013
10
÷

014
43, 33, 000
GTO 000


DM 41L (also for HP 41C) Program ROUND: Rounding a positive number

01 LBL ROUND
02 10^X
03 *
04 LASTx
05 x<>y
06 .5
07 +
08 INT
09 x<>y
10 /
11 RTN

Examples

Instructions:  Enter x, press [ENTER], enter n, execute the program

x
n
Result
0.83
1
0.8
8.21365
4
8.2137
170561.7737
0
170562
π
4
3.1416

Source:

Keith Oldham, Jan Myland, and Jerome Spanier  An Atlas of Functions Second Edition,  Springer.  2009 ISBN 978-0-387-48806-6

Eddie

All original content copyright, © 2011-2018.  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.  Please contact the author if you have questions.

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...