Sunday, February 15, 2026

Casio fx-3650P vs. Casio fx-3650P II: Programs


Here are four programs that are done with both the fx-3650P and fx-3650P II to illustrate some programming similarities and differences.


When we start a new program with the fx-3650P II, we are prompted to the choose the appropriate mode at the beginning:


COMP (main calculation with real numbers)

CMPLX (complex numbers, primarily complex number arithmetic)

SD (single-derivation mode, single-variable statistics)

REG (regression mode, two-variable statistics)

BASE (base conversions and Boolean logic)


Left:  Casio fx-3650P (2002), Right:  fx-3650P II (2013)


Program 1: Exponential Distribution


This program calculates:


PDF: e^(-X ÷ A)

CDF (lower tail): 1 - e^(-X ÷ A)


where:

A = 1/λ parameter (i.e. average waiting time, time for an event to occur/fail/succeed)

X = time parameter


fx-3650P, 25 bytes:


? → A : ? → X :

e(-X ÷ A) ÷ A ◢

1 – e(-X ÷ A)


fx-3650P II, 25 bytes:


? → A : ? → X :

e^(-X ÷ A) ÷ A ◢

1 – e^(-X ÷ A)


Example 1:

Inputs: A = 100, X = 50

Outputs: 6.065306597E-3 (*10^-3), 0.39346934


Example 2:

Inputs: A = 50, X = 3

Outputs: 0.01883529, 0.058235466


Program 2: Using Newton’s Method to get the real root of the cubic equation that is closest to zero:


x^3 + A * x^2 + B * x + C = 0


Using Newton’s Method:


x1 = x0 – f(x0) / f’(x0) [ let y = f(x0) / f’(x0) ]


x1 = x0 - (x^3 + A * x^2 + B * x + C) / (3 * x^2 + 2 * A * x + B)



fx-3650P, 72 bytes:


? → A : ? → B : ? → C : 0 → X :

Lbl 0 :

(X³ + AX² + BX + C) ÷ (3X² + 2AX + B) → Y :

√(Y²) → D :

X – Y → X :

D ≥ 1E-8 ⇒ Goto 0 : X


√(Y²) returns Abs(Y) in Comp mode.

D is set up to be the control variable, where

D = abs((x^3 + A * x^2 + B * x + C) / (3 * x^2 + 2 * A * x + B))



fx-3650PII, 67 bytes:


? → A : ? → B : ? → C : 0 → X : 1 → Y :

While Abs(Y) ≥ 1E-8 :

(X³ + AX² + BX + C) ÷ (3X² + 2AX + B) → Y :

X – Y → X :

WhileEnd: X


We could have used the derivative function (d/dx) but typing out the derivative took less room.


Example 1: X³ + 2X² – 5X + 4 = 0

Inputs: A = 2, B = -5, C = 4

Output: -3.663076827


Example 2: X³ – 3X² + 9X + 6 = 0

Inputs: A = -3, B = 9, C = 6

Output: -0.5481911635



Program 3: Sum of the polynomial: Σ((AX + B)^C, X = 1 to Y)


fx-3650P, 57 bytes:


0 → M : ? → A : ? → B : ? → C : ? → Y : 1 → X :

Lbl 0 :

(AX + B)^C M+ : X + 1 → X : X > Y ⇒ Goto 1 : Goto 0 :

Lbl 1 : M



fx-3650PII, 41 bytes:


0 → M : ? → A : ? → B : ? → C : ? → Y : 1 → X :

For 1 → X To Y : (AX + B)^(C) M+ : Next : M



Example 1: Σ((5X – 3)^2, X = 1 to 8)

Inputs: A = 5, B = -3, C = 2, Y = 8

Output: 4092



Example 2: Σ((2X + 1)^3, X = 1 to 10)

Inputs: A = 2, B = 1, C = 3, Y = 10

Output: 29160


Program 4: Complex Roots of Unity


x^n = 1


where:

x = cos(2 * m * π / n) + i * sin(2 * m * π / n) = r * e^(2 * m * i / n)

m = 0 to n – 1, i = j = √-1


fx-3650P, 47 bytes:


Switch to complex mode. The CMPLX indicator will be displayed but not shown as a step.


Rad : ? → A : 0 → B :

Lbl 0 :

cos(2 B π ÷ A) + i × sin(2 B π ÷ A) ◢

1 + B → B : A > B ⇒ Goto 0 : 1


We must have an else condition when the jump command is used, that is why the second one is there. Also, that one “indicates” the end.


fx-3650PII, 34 bytes:


Rad : ? → A :

For 0 → B To A :

cos(2 B π ÷ A) + i × sin(2 B π ÷ A) ◢

Next : 1


The second one “indicates” the end and can be omitted.


In complex mode, the real and imaginary parts are displayed on part at a time. A settle R←→I indicator displays at the right hand side of the screen. Switch between seeing the parts by pressing [ SHIFT ] [ EXE ].


Example 1: x^3 = 1

Input: A = 3

Outputs:

1 + 0 i

-0.5 + 0.866025403 i

-0.5 - 0.866025403 i


Example 2: x^5 = 1

Input: A = 5

Outputs:

1 + 0 i

0.309016994 + 0.951056516 i

-0.809016994 + 0.587785252 i

-0.809016994 - 0.587785252 i

0.309016994 - 0.951056516 i


Eddie


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

Spotlight: Casio fx-3650PII and Comparison with the fx-3650P and fx-50FH (II)

 Spotlight: Casio fx-3650PII and Comparison with the fx-3650P and fx-50FH (II)




Quick Facts: fx-3650P II



Model: fx-3650P II

Company: Casio

Type: Solar Scientific Algebraic, Programmable with battery backup: 1 x LR44/AP76

Memory: 7 memory registers: A, B, C, D, X, Y, M (M has memory addition and subtraction)

Programming Memory: 390 bytes, 4 program slots

Years in Production: 2013 (per fx-3650PII manual) to Present

Primary Market: Asia

Display: 10 digits


Casio’s fx-3650PII web page: https://www.casio.com/intl/scientific-calculators/product.FX-3650PII/


The fx-3650P II is the successor to the fx-3650P. The interface, menu structure, and the display of the fx-3650PII match that of Casio’s other current dual-powered programmable, the fx-50FH series (current as this blog entry fx-50FHII).



The modes available for the fx-3650 PII are:


COMP: This is our main calculator mode, with all the scientific functions available.

CMPLX: Complex Number mode: features complex arithmetic, conjugate, modulus (Abs), argument, rectangular/polar conversions.

BASE: Base conversions of integers between the four well known bases: binary, decimal, octal, and hexadecimal. The mode contains the standard Boolean operations.

SD: Single variable statistics (formerly named standard deviation mode)

REG: Regressions/two-variable statistics. A is usually the y-intercept and B is the slope.


The regressions available are:

Linear: y = a + b * x

Logarithmic: y = a + b * ln x

e-Exponential: y = a * e^(b* x)

Power: y = a * x^b

Inverse: y = a + b / x

Quadratic: y = a + b * x + c * x^2

ab-Exponential: y = a * b^x


Casio fx-3650P vs Casio fx-3650P II



Both of these calculators are (or were) sold primarily in Asia.  They are dual-powered: solar with a backup battery.  



Casio fx-3650P



*  Years Released: 2002 – about 2013

*  Pressing [ e^x ] types e. e(n) takes e^n not e × n.

*  Program space: 4 programs, total of 360 bytes

*  Absolute value function (Abs) is available in complex number mode (CMPLX) mode only.


The [ MODE ] key:  

Page 1: 1: COMP, 2: CMPLX

Page 2: 1: SD, 2: REG, 3: BASE

Page 3: 1: PRGM, 2: RUN, 3: PCL

Page 4: 1: Deg, 2: Rad, 3: Grad

Page 5: 1: Fix, 2: Sci, 3: Norm

Page 6: 1: Disp (display setup, fractions, rectangular/polar in complex mode)


CMPLX (complex numbers, primarily complex number arithmetic)

SD (single-derivation mode, single-variable statistics)

REG (regression mode, two-variable statistics)

BASE (base conversions and Boolean logic)



Program Functions (P-CMD), which is a limited set:

Page 1: ? (prompt), → (store), : (separator), ◢ (output/pause)

Page 2: ⇒ (jump/if-then-else), =, ≠, >, ≥

Page 3: Goto, Lbl



To exit program editing mode, press [ MODE ], [ MODE ], select 2 for RUN



fx-3650 PII


*  Production: 2013 – current? (not in United States, but in Asia)

*  Pressing [ e^x ] types e^(. This is gives a clear indication that we are using a function (exponential).

*  Program space: 4 programs, total of 390 bytes

*  Absolute value function (Abs) is available in all modes.



The [ MODE ] key: 

Page 1: 1: COMP, 2: CMPLX, 3: BASE

Page 2: 4: SD, 5: REG, 6: PRGM


CMPLX (complex numbers, primarily complex number arithmetic)

SD (single-derivation mode, single-variable statistics)

REG (regression mode, two-variable statistics)

BASE (base conversions and Boolean logic)


The SET UP menu, use arrows to navigate:

Page 1, Angles: 1: Deg; 2: Rad; 3: Gra

Page 2, Fraction: 1: a b/c; 2: d/c

Page 3, Complex Number: 1: a+bi; 2: r∠Θ

Page 4, Statistical Frequency: 1: FreqOn; 2: FreqOff

Page 5, Contrast Setting


Operating structure has adopted the structure of the fx-50FH (a past model, it’s since been updated to the fx-50FHII).


Program Commands (P-CMD), available on both the fx-3650PII and fx-50FH series:

Page 1: ? (prompt), → (store), : (separator), ◢ (output/pause)

Page 2: ⇒ (jump/if-then-else), =, ≠

Page 3: >, <, ≥, ≤

Page 4: Goto, Lbl

Page 5: While, WhileEnd

Page 6: Next, Break

Page 7: For, To, Step

Page 8: Else, IfEnd

Page 9: If, Then


To exit program editing mode, press [ MODE ], [ MODE ], select 2 for RUN


When entering a new program, you are prompted to select the type of program at the start: COMP, CMPLX, SD, REG, or BASE.



Casio fx-3650 PII vs. Casio fx-50FH (II)


The main difference is that the fx-3650 PII has the numerical calculus functions integration and derivative, while the fx-50 FH has a library of scientific constants and 23 built in formulas. The fx-50FH has 680 bytes of programming memory.


The next post will have four programs that are done with both the fx-3650P and fx-3650P II to illustrate the programming differences.




Eddie


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

Saturday, February 14, 2026

RPN: Absolute Value Equations with the HP 11C and DM41X

RPN: Absolute Value Equations with the HP 11C and DM41X



Introduction: Solving |z * w + y| = x


Today’s blog focuses on solving the absolute value equation:


|z * w + y| = x


for the variable w, and the values of z, y, and x are given and are on the Classic RPN stack.


For example, in the problem |5 * w + 7| = 2, the stack would be set up as:


t: (anything, it doesn’t matter)

z: 5

y: 7

x: 2


(This is why I set the variable as w instead of the usual x.)


One approach is to use memory registers and other uses only stack operations. Today’s algorithm focuses on the latter.


Caution: In the above equation, x will always be non-negative. The equation will never be valid if x is negative.



The Algebra


Solve for w:

|z * w + y| = x


This leads us to solve the two equations:


(I)

z * w + y = -x

z * w = -x – y

w = -x/z – y/z


Let w- = -x/z – y/z = (-x/z) + (-y/z)


(II)

z * w + y = x

z * w = x – y

w = x/z - y/z


Let w+ = x/z – y/z = (x/z) + (-y/z)


Then:


w- = -x/z – y/z

w- = (-x/z) + (-y/z)

w- = (-x/z) + (-y/z) + (-x/z) + (x/z)

w- = 2 * (-x/z) + (x/z) + (-y/z)

w- = 2 * (-x/z) + w+


RPN Code: HP 11C (adoptable for other RPN calculators)


LBL A

001

42, 21, 11

Program start

R↓

002

33


R↓

003

33


X<>Y

004

34


R↓

005

33


1/x

006

15


×

007

20


LST x

008

43, 36


X<>Y

009

34


R↓

010

33


×

011

20


LST x

012

43, 36


R↑

013

43, 33


X<>Y

014

34


R↓

015

33


X<>Y

016

34


CHS

017

16


X<>Y

018

34


+

019

40


ENTER

020

36


ENTER

021

36


LST x

022

43, 36


-

023

30


LST x

024

43, 36


-

025

30


RTN

026

43, 32

Program end


RPN Code: DM41X (HP 41C series, no module is required)


LBL “ASBEQ”

RDN

RDN

X<>Y

RDN


1/x

×

LAST X

X<>Y

RDN

×

LAST X

R↑

X<>Y


RDN


X<>Y

CHS

X<>Y


+

ENTER

ENTER

LAST X

-

LAST X

-


RTN



Notes:

* RDN is shown as R↓

* To enter R↑, press XEQ, ALPHA, R, SHIFT, ENTER, ALPHA



Subroutines Used


We used several techniques to manipulate the stack. They are presented below:


Rotate stack from X, Y, Z, T to Z, X, Y, T

R↓

R↓

X<>Y

R↓


Source:

Ball, John A. Algorithms for RPN Calculators John Wiley & Sons: New York. 1978. ISBN 0-471-03070-8. pg. 78



Multiply Y and Z by 1/X. Stack: X, Y, Z, T → X, Y/X, Z/X, T


1/x

×

LAST X

X<>Y

R↓

×

LAST X

R↑

X<>Y


Change X, Y to Y+ X, Y – X


+

ENTER

ENTER

LAST X

-

LAST X

-


The resulting stack is:


z

z

y + x

y – x


Doing LAST X, -, twice is effectively subtracting whatever is in L register twice.



Examples


|4 * w – 6| = 5


Stack:

z: 4

y: -6

x: 5


Results:

y: 2.75

x: 0.25


|2 * w + 5| = 3


Stack:

z: 2

y: 5

x: 3


Results:

y: -1

x: -4




Eddie


All original content copyright, © 2011-2026. 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-3650P vs. Casio fx-3650P II: Programs Here are four programs that are done with both the fx-3650P and fx-3650P II to illustrate...