# Free42 explored in comparison with the sharp El 506W

## Introduction

Free42 is a simulator (not an emulator) of the HP 42s, and it is a neat work.

This article is made as a byproduct of exploring the Free42 while trying to find out if the functions mentioned in the manual of the sharp el 506w (produced in the early 2000, the manual was made for 506w and 546w models), a scientific calculator not programmable and not graphing, are present on the HP 42s or better on the Free42. From now on the Free42 is mentioned as f42 or and the sharp el 506w is mentioned as 506w.

It is like an exploration by comparison and of course it will miss functions that are partially mentioned or absent on the sharp 506w. The same comparison can be made with other non-programmable non-graphing scientific calculators. Why scientific calculators? Because the HP 42s is advertised so, rather than being programmable.

Moreover the exploration may miss functions declared as “not there” but being implemented in the free42. Indeed it is an exploration.

During the comparison, some operations, assumed to be “common” would be skipped. The HP 42s (or Free 42) uses the RPN notation that is assumed known by the reader. If the reader does not know the RPN, nevertheless the examples here written (one should deduce the syntax thought) or the documentation provided by the Free42 homepage would be enough to master it. Also the 506w commands can be read on the manual, so I would post non-obvious procedures only for the F42.

## Comparison

### Constant calculations

On the 506w there is the possibility to do constant calculation. For example:

# finding multiples of 117
# one types
117 x 1 = 117
2 = 234
3 = 351

# adding a number to 63
5 + 63 = 68
8      = 71
4      = 67

The f42 achieve this with how the stack registers ( X, Y, Z , T ) are designed. In short, when numbers are entered they lift the stack, when they are “consumed” the stack drops replicating the last register, T.

typing: 117 enter enter enter (check with Rdown that the stack is full of 117)
typing: 1 x
res: 117
typ: 2 x
res: 234
typ: clx 3 x
res: 351

typ: 63 enter enter enter
typ: 5 +
res: 68
typ: clx 8 +
res: 71
typ: clx 4 +
res: 67

# actually with this operation we never activate the stack drop,
# because we just used the register X together with Y but Y is not consumed.
# This is how the CLX function works (or clx).

# last X can be used to but in cooperation with drop of the register X
# because if I type 63 5 + (= 68)and then last X without clearing X before
# then 68 goes in Y. If instead I clear X, Y is not affected because the stack
# list is disabled.

### Numerical differentiation

We have $f(x) = x^2$ so $f'(x) = 2x$ , what about computing it in $\sqrt{6}$ and $8$ ?

# 506w
typing: alpha X x^2 2ndF d/dx  (typing the main function, not f')
(answer to X?) sqrt(6) cannot be typed, so we type only 8.
(answer to dx?) we leave default

result = 16. Ok.

# typing sqrt(6) using the variable A and then recalling its value when the question is asked
res: 4.898979481
note that 2 * sqrt(6) on the calculator returns the same value.

Something a tad more difficult involving fractions $f(x) = \frac{1}{3} \cdot x^{3}$ we should get $f'(x) = x^2$ , again in $\sqrt{6}$ and $8$ .

# 506w (typing 1/3 as fraction with the command "a b/c" )
# typing the main function, not f'
result sqrt(6): cannot be typed.
result 8: 64 , ok.

# sqrt(6) stored in A and then recalled when asked.
res: 5.999999989 (it should have been 6)

At the moment numerical differentiation seems not available as built in function in f42. Surely there exist a listing providing them (TODO: find them and showing how to integrate them), but the point that are not built in.

### Numerical integration, basic programming needed on Free42

We integrate $1/3 \cdot x^3$ between 5 and 12, then $sin(x)$ between 0 and $2 \cdot \pi$

#506w
# 1/3 * x^3
# 1/3 typed as fraction of the type "a b/c"
# n=100
# takes a bit
res: 1675.916667

# sin(x)
# 2*pi cannot be entered, so it is saved first in a variable, like A, then recalled.
res: 0.344169068

Free42

# we have to program a function to make a numerical integration
# a bit more tedious than the 506w, but it will be good to introduce some basic programming.

# actually the solver allows constant in the integration, but this will be shown in another example
# hopefully.

#To start programming mode
GTO ..
# this creates a new program area (programs areas are delimited by a starting label and and END
PRGM
# the new program area is shown by a 0-byte program
# END is shown, we will not have to type it when typing whatever program
#
# PRGM works also if by mistake one leaves the programming mode, typing it again
# shows the current program
PGM.FCN
LBL
# now we can name the program, max 7 characters.  We need to select the chars
# We want a function so
"X3I" (enter to submit)
arrow_down (for the next instruction)
# (X^3 integral)
# we need to name variables with MVAR for the solver
# and those have to be declared right after the label
shift intfx
MVAR "X" EXIT
arrow_down 1
arrow_down 3
division
RCL alpha X
3
y^x
EXIT

# use PRINT PRUSR to see that the program is there.

#now let's open the solver
intfx
X3I
select X
5
LLIM
12
ULIM
0.001
ACC
# pres the simbol of integral
int
res: 5027

# a bit off, something went wrong, let's check the program again.
EXIT EXIT EXIT
PRGM
# review with arrows up and down
# yes, the multiplication between 1/3 and x^3 is missing.
# place the cursor where Y^X
*
EXIT

# let's check that all is fine
PRINT
PRP
X3I
# check the printer output in f42

# Once again let's go to the solver
intfx
X3I
X
5 LLIM
12 ULIM
0.001 ACC
int

res: 1675.9166667

######
######
# now we compute the sin

GTO ..
PRGM
PGM.FCN
LBL
"ISIN" (enter to submit)
arrow down (for the next instruction)
shift intfx
MVAR "X" EXIT
RCL alpha X arrow_down
SIN
EXIT

# use PRINT PRUSR to see that the program is there.

#now let's open the solver
intfx
ISIN
select X
0 LLIM
2 ENTER
pi
multiplication
# showing 6.2831... now
ULIM
0.001 ACC
int

res: 3.44169..e-1

# note:
# backspace clears lines
# inserting inserts program lines after the current program line visualized
# so on line 3, if we type, we go on line 4.

### Conversion between 3600 degrees, 400 degrees and radians

Free42:

#Use the convert menu
#it is possible to convert degrees to radians (and back), then hours-minutes-seconds (and back),
#but no 400 degrees conversion, for that surely routines exists

### Using variables

The 506w has some single letter variables (or better, registers). Like a dozen of them.

Free42

# One can use named named variables up to seven chars
105
STO
Alpha
"t1"
ENTER
-50
ENTER
# -50 now in register y
RCL
select T1
+

res (in x) : 55

# storing in the register is the same of the named variables
# only one has to type a double digit 00 to 24 (normal available registers)

# What is interesting is to use one of the four stack register
105
STO
.
ST Z (the second last register, remember stack lift)
0 (stack lift)
RCL
.
ST T (the last register, remember stack lift)

### Functions

Free42

# we want to save the program pi * radius^2
GTO
..
PRGM
PRGM.FCN
LBL
CAR (circle area)
ENTER
arrow_down
x^2 #the program assumes the variable in register X
PI
multiplication
EXIT

# now executing with a radius of 5
5
XEQ
CAR
res: 78.53981..

## Useful Free42 actions

shift clear CLST

### Printing

(to access through the advanced options of Free42)

shift print PRP: prints a program, if not selected, the current.
PRST: prints the stack (useful to visualize the registers)
PRUSER: prints user variables and programs
PRX: prints X register
PRLCD: prints the actual content of the screen

## Notation for special keys

• Free42
• Aup or arrow_up: arrow up
• Adown or arrow_down: arrow down
• Rdown: the command under the second mode PI, to roll down the stack.
• shift: the orange button. Activate second mode.
• clx: the backspace key, it works differently according to the context. Normally it clears the register X. In program mode deletes the current line of the program.
• intfx: the second mode over the key 8.

# a scan of the 42s manual on the ed2k network since it is not provided by HP anymore.
ed2k://|file|hp42s-programming-examples.pdf|5120078|F4321890CC18DD006D31BCDD9C9DBE5C|h=2PC3NLSYBRFDNZOSW73OBEQYSVWZPU7D|/