HP 15C Quick Reference
HP 15C Quick Reference
HP 15C Quick Reference
1
HP-15C
Clearing Data
← RUN mode: Deletes either the last digit during number entry
or the entire X-register in case number entry has
been terminated.
PRGM mode: Delete the currently displayed program step
CLEAR ∑ Clear stack and summation registers 0-5
CLEAR PRGM RUN mode: Set program counter to 000
PRGM mode: Erase entire program memory
CLEAR REG Clear all storage registers
CLEAR Clear prefix key and briefly display all 10 digits of the mantissa
PREFIX
CL X RUN mode: Clear X-register
PRGM mode: Store the CLX command as a program
command
2
HP-15C
Functions (Selection)
Trigonometric Functions
General The statistics registers occupy the storage registers 2-7, see
calculator's back label. See section Clearing Data for statistics
register deletion.
Stats registers can also be used for vector addition and
substraction!
3
HP-15C
Register usage: 2=n, 3=∑x, 4=∑x2, 5=∑y, 6=∑y2, 7=∑xy
∑+ Add X and Y to the stats registers.
STO ∑+ This will display the total number of entries and disable stack lift
so that the next entry will overwrite the count.
∑- Substract X and Y from the stats registers
RCL ∑+ Recall ∑x and ∑y from the summation registers into X & Y
x Calculate ∑x & ∑y mean value and place result in X & Y.
Requires n>0
s Calculate ∑x & ∑y standard deviation and place result in X & Y.
sx=SQRT[ {n∑x2 – (∑x) 2} / {n(n-1)} ]
Requires n>1
L.R. Linear regression. Calculates a straight line thru the (X,Y) data
points and returns the slope of the line in Y and the y-offset in X.
Requires n>1
y,r This function assumes a straight line thru the (X,Y) data points
and calculates for a given X the approximatedy value which is
returned in X.
In Y this function returns an estimate how close the data points
come to a straight line. +1 indicates that all points lie on a line
with positive slope, -1 indicates that all points lie on a line with
negative slope, 0 indicates that an approximation by a straight
line isn't possible.
Requires n>1
Programming
Complex Numbers
6
HP-15C
1/x ex NOTE: To calculate sqrt(-1) the complex mode must be
hyp sin cos tan already enabled or otherwise an error occurs!
hyp-1 sin cos
tan
ABS Calculates magnitude of complex number
+ - x ÷ yx All these binary functions work in complex mode as well
sin cos tan Trigonometric functions are only executed in radians (2π )
sin-1 cos-1 tan-1
→P Convert from rectangular coordinates (real=X, imaginary=Y)
to polar coordinates (real=R, imaginary=θ ).
This operation is affected by the current trigonometric
setting (DEG,RAD, GRD)
→R Convert from polar coordinates (real=R, imaginary=θ ) to
rectangular coordinates (real=X, imaginary=Y).
This operation is affected by the current trigonometric
setting (DEG,RAD, GRD)
Conditional These tests work for complex numbers and operate on both
tests the real and imaginary part: x=y, TEST 0 (X≠ 0), TEST 5
(X=Y), TEST 6 (X≠ Y)
All other tests ignore the imaginary part of the complex
number
7
HP-15C
Matrix Operations
8
HP-15C
RCL +–x÷ A-E,
(i)
9
HP-15C
STO g A-E, (i) Same as above but the stack's Y register contains the row
number and X the column number, starting from 1.
The value must be present in Z.
Both X & Y will be popped from the stack so that the value
ends up in X.
STO g A-E, (i) Same as above but the stack's Y register contains the row
RCL g A-E, (i) number and X the column number, starting from 1.
RCL will pop X & Y from the stack and then push the matrix
element into X
STO MATRIX A-E X is a number: Store the value of X in all matrix elements.
X is a matrix: Copy matrix in X to the specified matrix. The
destination matrix will be redimensioned
RCL MATRIX A-E Put the matrix descriptor of the specified matrix in X
x↔ A-E, (i) Exchange X with the matrix element of A-E specified by
R1/R0. R1 & R0 are not affected
DSE A-E, (i) Decrements/increments the matrix element of A-E or (i)
ISG A-E, (i) specified by R1/R0. R1 & R0 are not affected. See DSE &
ISG in section Programming
RESULT A-E Specifies the result matrix (default is A). This is the matrix
that will hold the result of a matrix operation. Not all
operations require a result matrix. The result matrix will
automatically be dimensioned so that it can properly hold
the result. For some matrix operations the result matrix can
be identical to one of the input matrices
STO RESULT When a matrix descriptor is already present in X then this
matrix will be used as the result matrix
RCL RESULT Recalls the descriptor of the result matrix into X
Unary matrix Result in X Effect on matrix Effect on RESULT
operations specified in X matrix
CHS None Changes sign of all None as long as
matrix elements X<>RESULT
1/x Descriptor of None as long as Inverse of matrix
RESULT. X<>RESULT X. If it is singular,
X must be square then 1/x will
calculate the
inverse of a matrix
that is close to X.
MATRIX 4 None Replaced by None as long as
transpose X T
X<>RESULT
MATRIX 7 Row norm: None None
Largest sum of
absolute values
of all rows
MATRIX 8 Frobenius or None None
Euclidian norm of
X: Square root of
the sum of all
matrix elements
MATRIX 9 Determinat of None as long as LU decomposition
10
HP-15C
matrix. X<>RESULT of matrix X
X must be square
Scalar matrix operations
Operation between a matrix and a scaler (=a plain number)
+ If X is a matrix and Y a scalar (or vice versa) the scalar will be
added to each element of the matrix
x If X is a matrix an Y a scalar (or vice versa) each element of the
matrix will be multiplied by the scalar
X=scalar, Y=matrix X=matrix, Y=scalar
- Substract scalar from each Substracts each matrix
matrix element element from scalar
÷ Divide each matrix element by Calculates the inverse of the
scalar matrix and then multiplies
each matrix element with
scalar
Binary matrix operations
X and Y contain matrix descriptors
+ Add X+Y → RESULT, where RESULT may be X or Y.
X & Y must have the same dimensions
- Substract Y-X → RESULT, where RESULT may be X or Y.
X & Y must have the same dimensions
x Multiply Y•X→ RESULT, where RESULT may neither be X or Y.
X & Y must have the compatible dimensions
÷ Calculate X-1•Y→ RESULT, where RESULT may be Y but not X.
X will be replaced by its LU decomposition. If X is singular it is
replaced by a non-singular matrix close to X.
Note that the order of X and Y is reversed! It corresponds to
the Y/X order. X must be square and have dimensions
compatible with Y
MATRIX 5 Calculate YT•X→ RESULT, where RESULT may neither be X nor
Y.
X & Y must have compatible dimension
MATRIX 6 Calulatest the residual: RESULT – Y•X→ RESULT
The descriptor of RESULT is placed in X.
RESULT may neither be X nor Y. X & Y must have compatible
dimension
Matrix in LU Its descriptor is displayed with two dashes after the matrix
form name A-E. Operations ÷ and determinate (MATRIX 9)
calculate a LU decompsed matrix. The following operations
can be performed with the LU decomposition as with the
original matrix: 1/x, ÷ (X=matrix) and MATRIX 9
Complex matrices
Refer to pg. 160ff of the Owner's Manual.
Complex matrix operations are not supported directly. However, these
operations can be rewritten so that they can be solved using only real
matrices. The HP-15C provides a number of functions to simplify the
conversions between complex and corresponding real matrixes
Py,x Converts XC → XP. Number of rows of X must be even
Cy,x Converts XP → XC. Number of columns of X must be even
11
HP-15C
MATRIX 2 Expand XP toX. Number of rows of X must be even
MATRIX 3 CollapseX to XP. Number of columns of X must be even
GSB I, GTO I If I contains a matrix then the natrix name A-E is used as the
target label of the GSB or GTO
12
HP-15C
Memory The solver needs 5 registers. These are allocated from the
uncommitted registers space, see MEM. The solver and the
numerical integrator (see below) share their registers
SOLVE 0-9, Finds real root of a function. This is a value X where the
.0-.9, A-E function f(X) evaluates to 0.
• SOLVE expects two initial guesses for X in X and Y. These
values can be used to narrow down the serach for a root in
case f(x) has multiple roots. X=Y is permissable
• It then makes repeated GSB calls to the label with the
current X value being present in the stack's X, Y, Z and T
register
• The program at the label must calculate the function f(X)
and return the result in X before it executes the RTN
• When SOLVE finally ends the stack will contain the following
values:
X: Value for which f(X)=0, this is the "root"
Y: X value of the 2nd to last evaluation step
Z: f(X) at the root value – should be 0!
• If no root can be found Error 8 occurs (in RUN mode)
• Note that SOLVE eats up two of the seven possible GSB
levels: One for SOLVE and one for the calls to the user
function
13
HP-15C
• The program which calculates f(x) must not call SOLVE (no
nesting)
Complex SOLVE ignores the complex stack and can only calculate real
mode roots
14
HP-15C
SOLVE in a If SOLVE can find a root the next program line is executed,
program otherwise skipped
Misc • To speed up the root finding process rewrite your function
f(x) so that it returns 0 if |f(x)|<ε . Or count the number of
iterations inside the calculation of f(x) and stop when a limit
has been reached
• Even if no root can be found the stack registers contain the
above mentioned values. These often give a hint why the
root finding failed
• To find multiple roots eliminate an already known root R by
dividing the function by (x-R)
• Fore more details see HP-15C Owner's Handbook, Appendix
D, pg.220ff and The HP-15C Advanced Functions Handbook
Numerical Integration
Memory The integrator needs 23 registers. These are allocated from the
uncommitted registers space, see MEM.
The integrator and the solver (see above) share their registers
∫ xy 0-9, Integrates function f(X) at the given label for X values running from
.0-.9, A- Y to X
E • ∫ xy makes repeated GSB calls to the specified label with the
current X value being present in the stack's X, Y, Z and T register
• The program at the label must calculate the function f(X) and
return the result in X before it executes the RTN
• When ∫ xy ends the stack wil contain these values:
X: The integral of f(x)
Y: The uncertainty of the result: ∫ xy f(x) = X± Y
Z: Upper integration limit
T: Lower integration limit
• Note that ∫ xy eats up two of the seven possible GSB levels: One
for ∫ xy and one for the calls to the user function
• The program which calculates f(x) must not call ∫ xy (no nesting).
However, SOLVE and ∫ xy can be nested
Accurac The integral is only evaluated to the accuracy specified by the
y current FIX, SCI or ENG format! The more digits have been specified
the more accurate the integral will be – but calculating it will take
longer
Misc • Initially, ∫ xy will evaluate f(x) only at a few sample points. Then
the number of sample points are increased until the calculated
integral doesn't change any more. This has one important
consequence: The integration limits should be close to the area
where the function is "interesting". Ie. exp(-x²) around x=0 – if
this function is integrated from 1E-50 to 1E+50 then the result
will be 0 because the algorithm missed the interesting part
around 0
• Fore more details see HP-15C Owner's Handbook, Appendix E,
pg.240ff and The HP-15C Advanced Functions Handbook
15
HP-15C
16