For the historical record and in order to preserve my earliest and/or unreleased efforts in the wonderful world of HP programmable calculators and pocket computers, here you'll find a selection of HP programs I wrote for various HP models ranging in capabilities from the HP-25 to the HP-71B.
The HP-25 programs are for the most part (not all) quite simple affairs, written just for practice and never intended for release, as back in 1975 I was learning programming techniques (the HP-25 was my very first programmable calc) and the HP-25 was slow and had very little RAM (49 steps, 8 registers) as well as a very limited programming paradigm (no labels, no subroutines, no flags), so don't expect anything too sophisticated (though there are a few surprises). That said, I think they're still quite enjoyable and fun to check and even convert to run on other devices.
On the other hand, most subsequent HP models (such as the HP-11C, HP-67, HP-34C, HP-41C, etc., let alone the HP-71B !) had much more RAM for both programs and data and also advanced programming capabilities, so the programs I wrote for them take full advantage of that and are significantly more complex and capable, no longer "practice" ones. Some of them were published in the past in physical media (paper magazines, solution books, CD/DVD/USB pendrives), which would-be readers (even the authors themselves) had to pay for, but now for the first time they'll be available to download for free, as will existing but still unpublished programs or even new programs I might write now and in the foreseeable future. Stay tuned !
P.S.: All titles ending in (Full Scan) are part of my Project HAM.
(62 pages, 19,638,608 bytes, in Spanish with Notes in English)
This 62-page PDF document includes a selection of 40 programs I wrote for the HP-25 (my first HP calculator) back in 1975, which serve to demonstrate just how wonderful and capable the HP-25 was back then, and the sheer enjoyment of owning it, learning from it, and making the most out of it.
Besides the 40 programs themselves (completely documented with Theory, Usage, Examples and of course the Source code), a list with the titles of all programs both in Spanish and English is given in the included Notes (in English).
Caveat lector:
Note that in 1975 I was utterly on my own as far as HP calculators were concerned. I knew nothing about PPC, or users' clubs of any sort, nor any other HP-25 user. Thus, I developed all the programs here in isolation and documented them in my own handwriting and of course in Spanish, my native language, as they were not intended to be shared with anyone else. However, as all the programs are of a mathematical nature, this doesn't detract from their understandability or usability, by simply inspecting the equations and following the given Examples.
3-page paper featuring a 37-step RPN program for the HP-25 to numerically solve 2nd-order differential equations of the form y”=f(x,y) subject to initial conditions, using the 5th-order predictor-corrector Numerov’s method. One worked example included.
2-page paper featuring a 49-step RPN program for the HP-25 to accurately evaluate the Gamma function in the interval [1, 2], as well as approximate factorials for real-valued x. Three worked examples included.
This HP-34C Solutions Book was created to enhance the sales of the then (1980) newly released HP-34C calculator, a fantastic advanced programmable RPN model, which was much more affordable than previous advanced models while providing a plethora of useful features both for using in manual calculations and for writing your own programs.
My friend Fernando del Rey and I set up to create a sufficient number of programs to be collected into a new Hewlett-Packard Spanish-language Solutions Book titled "HP-34C Matemática avanzada" (Advanced Math). In all, we created and submitted a grand total of 18 programs to HP but they selected for publication just the first 16 and the last two were excluded from the book. Now I've righted this wrong by including both at the very end of the scanned book, where you'll also find some interesting Notes (in English) on the back story of this HP-34C Solution Book and its 2021 scanning.
The book features the following 16+2 programs for the HP-34C (most will run with minor or no changes on the HP-15C):
- CAMBIOS DE BASE (Base Conversions)
- FACTORES PRIMOS, MCD, DECIMAL A FRACCION (Factorization, Least Common Divisor, Decimal to
Fraction)
- ECUACION DE 4º GRADO (4th-degree Polynomial Equations, also 3rd- and 2nd-degree)
- SISTEMAS DE ECUACIONES: f(x,y) =0 and g(x,y) = 0 (Systems of two Non-linear Equations)
- AREAS, LONGITUDES, VOLUMENES (Areas, Lengths of Arc, Volumes)
- INTEGRALES DOBLES (Double Integrals)
- SUMACION DE SERIES INFINITAS ALTERNADAS (Summation of Infinite Alternating Series)
- ECUACIONES DIFERENCIALES : y'= f(x,y) (1st-Order Differential Equations)
- SISTEMAS DE ECUACIONES DIFERENCIALES (Systems of two 1st-Order Differential Equations)
- OPERACIONES CON NUMEROS COMPLEJOS (Complex-number Operations)
- OPERACIONES VECTORIALES (Vector Operations)
- DETERMINANTE, ECUACION CARACTERISTICA, AUTOVALORES DE MATRIZ 3x3 (3x3 Determinant, Characteristic Eq., etc.)
- INTERPOLACION (Data Interpolation)
- AJUSTE DE DATOS (Data Fitting)
- ANALISIS ARMONICO (Harmonic Analysis)
- RESOLUCION DE TRIANGULOS (Triangle Solutions)
Bonus programs:
- TABLAS DE AMORTIZACION (Loan Amortization Schedule)
- CALENDARIO (Date and Calendar Operations)
2-page paper featuring a 70-step RPN program for the HP-34C to generate either a complete amortization schedule showing each period of a fully amortized loan or a partial schedule between two given periods. One worked example is included.
3-page paper featuring an 84-step RPN program for the HP-34C to quickly and accurately find the sum of infinite alternating series, even divergent ones (Euler sum). Three worked examples are included.
3-page paper featuring a 67-step RPN program for the HP-34C to compute the numeric value of a definite double integral of a user-specified f(x,y) between given limits. Four worked examples are included.
4-page paper featuring a 175-step RPN program for the HP-34C, HP-67 and HP-97 programmable calculators to compute simultaneously and non-iteratively all four real and/or complex roots of a general 4th-degree (or less) polynomial equation with real coefficients, using exact formulas. The HP-34C's SOLVE function is not used and all four real and/or complex roots are computed at once in 15-20 seconds at most.
It will also work in the HP-15C, the HP-41C series and posibly other RPN models with very minimal changes (detailed in the Notes). Four worked examples are included, solving three quartics and one cubic equation.
4-page paper featuring a 102-step RPN program for the HP-34C programmable calculator to solve a system of two arbitrary nonlinear equations in two variables. Will also work as-is in the HP-67/97 and in the HP-15C and HP-41C series with minimal changes. Two worked examples are included.
3-page paper featuring a 127-step program for the HP-34C programmable calculator to factorize an integer into its prime factors, compute the greatest common divisor (GCD) of two integers, and find integer fractions which best approximate a given real value. It will also work in the HP-41C series with trivial changes. Three worked examples are included.
3-page paper featuring an 86-step RPN program for the HP-34C to challenge your memory by testing your ability to remember what you’ve just seen and offering afterwards an accurate comment on your performance.
4-page paper featuring a 42-step RPN program for the HP-41C to find real roots of an arbitrary user-supplied equation f(x)=0 using Newton’s method and a user-given initial guess. Interactive and non-interactive versions provided. Five worked examples included.
3-page paper featuring a 28-step RPN program for the HP-41C to find extrema (maxima and/or minima) of an arbitrary user-supplied function y=f(x) by calling program RF (Root Finder) internally as part of the computation. Two worked examples are included.
3-page paper featuring a 55-step RPN program for the HP-41C to evaluate the definite integral between given limits of an arbitrary user-supplied function f(x) using the fast 3-point Gauss-Legendre quadrature formula applied over a number of subintervals. Three worked examples included.
3-page paper featuring a 90/62-step RPN program for the HP-41C programmable calculator series to simulate randomly throwing two dice, which are printed graphically followed by their sum.
It includes a subroutine which can be globally called from other programs or from the keyboard to accumulate in the printer buffer the graphics for any single die face. Both Standard and Synthetic Programming versions are included.
7-page paper featuring a 137-step program for the HP-41C programmable calculator to obtain quickly and accurately an approximate numerical solution for a system of N simultaneous first-order differential equations or, conversely, a single differential equation of the Nth-order, using a fourth-order Runge-Kutta method. It will also run in the HP-41CV, HP-41CX and the HP42S. Two worked examples included.
7-page, 13-diagram paper featuring a 285-step program for the HP-41C programmable calculator (will also run as-is in the HP-41CV or the HP-41CX and with trivial changes in the HP42S as well as in compatible devices or emulators). The program is intended to help the user practice in order to achieve the difficult basic checkmate of King, Bishop and Knight (controlled by the user) vs. King alone (controlled by the program) within a specified number of moves. The user must try and checkmate before the allotted moves elapse while the program does its best to avoid being checkmated.
Two worked examples included, one of them against the world-class chess engine Stockfish 9 (released in 2018 and rated at more than 3,300 ELO), the other against a human user.
4-page paper featuring a 129-step RPN program for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX and in the HP42S with trivial changes) to obtain a numerical solution for a system of N algebraic linear equations in N unknowns using the iterative method of Gauss-Seidel, a relaxation/overrelaxation method.
A system of up to 15 equations can be solved if using all 4 memory modules (HP-41C) and the input matrix is left unchanged by the procedure so it can be reused for further processing. Also, full details are given to modify it to use synthetic instructions to save registers, if desired. Two worked examples included.
3-page paper featuring a 142-step fun game RPN program for the HP-41C to challenge your memory by testing your ability to remember what you’ve just seen and offering afterwards an accurate comment on your performance.
2-page paper featuring an 85-step fun RPN program for the HP-41C to test your “ESP” (Extra-Sensorial Powers) by conducting a series of 10 tests, after which it reports the % of success and an evaluation of your alleged extrasensorial abilities (if any). One sample run included.
5-page paper featuring a 215-step RPN program for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX and in the HP42S with trivial changes) to find all eigenvalues of a real symmetric NxN matrix using the iterative method of Jacobi, which is fast and always converges.
Matrices up to 22x22 can be treated and full details are given about the algorithm and on how to modify the program to use synthetic instructions to save registers, if desired. One worked example and two test cases with solutions included.
4-page paper featuring a 170-step RPN program I wrote in 1980 for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX) to compute the inverse of a real NxN matrix (no Advantage module back then), where N ranges from 1 up to 16, using a non-gaussian interchange method.
The program is written so that zero pivots will cause no trouble, they’re skipped and the following pivot is tested. The locations of all zero pivots are remembered and their corresponding interchanges are performed later.
(9 pages, 3.232.120 bytes, in Spanish)
Program Submittal to the HP Users' Program Library Europe.
Este programa utiliza un metodo de Runge-Kutta de orden 4 para hallar una solucion numerica aproximada de un sistema de N ecuaciones diferenciales de primer orden. Alternativamente, tambien resuelve una ecuación diferencial de orden N. El valor de N solamente está limitado por la memoria disponible.
(14 pages, 3.613.936 bytes, aka Othello)
Program Submittal to the HP Users' Library (Corvallis).
This program allows the user to play a game of Reversi (also known as Othello) against the HP-41C. The present program includes all features required, plays quite well and will easily defeat a beginner. The program itself runs the same with or without a printer, but if one is present, it will print the board.
(20 pages, 2,907,464 bytes)
Program Submittal to the HP Users' Program Library (Corvallis).
This program challenges the user to play chess against the 41C in a 5x5 board, each player having King, Queen, Bishop, Knight, Rook and 5 pawns.
All standard rules are implemented, including pawn promotion. Full graphic capabilities, prints the board if printer is present. Includes 4 pages with barcode.
This is my original submittal to the Hewlett-Packard Users' Program Library (USA) of my HP-41C program Othello at the request of HP UPL's Sandy Canning. Besides my original submittal, I've also included here four pages of good-quality barcode to allow for fast, error-free entry of the long program into the calculator using the wand.
This program allows you to play a game of Othello (aka Reversi) against the HP-41C. You can select who moves first and the opening. The 41C can play for you, even against itself. If a printer is present, the board is (optionally) printed. Includes Notes.
(14 pages, in Spanish)
Back in 1981 I was creating paid-for custom programs on demand. One day a customer called in with an unusual programming request: he wanted me to implement a system of his own creation to try and win at the roulette, as the casino accepted the use of calculators while betting.
Though at first I was puzzled, he was actually quite serious, the wealthy owner and CEO of a medium-sized company, with a penchant for such things. We met at a renowned restaurant and he told me all about his system, which seemed complex but doable. He agreed and bought an HP-41C plus card reader and four RAM modules, so I set to the task. Includes Notes in English.
(86 pages, 72,890,952 bytes, in Spanish with Notes in English)
This 86-page PDF document preserves a notepad (Cuaderno ICAI) in which I recorded and documented about 30 of my best programs for the HP-67, complete with Listings, Theory where necessary, usage Instructions and worked Examples aplenty. Additionally, it also includes assorted topics I indulged in at the time and which I addressed with my HP-67, such as worked numerical analysis problems, mathematical topics, runs of other programs, numerical data-fitting experiments and miscellanea.(8 pages, 3.106.463 bytes, in Spanish)
Program Submittal to the HP Users' Program Library Europe.
Versión española del programa #60376D. Calcula la integral doble de una f(x,y) dada entre limites arbitrarios x0,xm,yo,yn, utilizando un metodo que da valores exactos si f(x,y) es un polinomio de grado 3 (o menos) en x, y y muy buenas aproximaciones en todo caso.
(8 pages, 3.424.258 bytes, in Spanish)
Program Submittal to the HP Users' Program Library Europe.
Version española del programa #60582D. Dada una serie infinita alternada cuyo termino general es definido por el usuario, el programa calcula rapidisimamente su suma. Implementa dos metodos: la transformacion de Euler y la transformacion de Hutton. Es posible tratar series divergentes.
(11 pages, 6.476.367 bytes, in Spanish)
Program Submittal to the HP Users' Program Library Europe.
Este programa (a variant of Battleship) permite al usuario jugar con su HP-67/97 al Juego de los Barquitos. El juego se lleva a cabo en un "mar" 10x10 en el cual la calculadora dispone al azar un cierto numero de barquitos de diversos tamaños. El usuario debe tratar de hundirlos especificando las coordenadas del punto al cual dirige su disparo.
(7 pages, 1,232,242 bytes)
Program Submittal to the HP Users' Program Library Europe.
This program will allow you to play chess against the HP-67/97. Here the calculator plays the 16 White pieces and you have only the Black King. The initial position is the standard one and in order to win the calculator has to checkmate your King in 6 moves or less, else you'll be declared the winner.
(7 pages, 3,603,904 bytes)
Program Submittal to the HP Users' Program Library Europe.
The program will compute up to 9 coefficients of the Fourier Series (harmonics) to fit N given equally spaced data points (up to 19) which are samples from a periodic function. The program also computes the sum of squared errors for each k, as well as the mean value.
(10 pages, 723,334 bytes)
Program Submittal to the HP Users' Program Library Europe.
This program is intended as a help when designing elliptic lowpass filters (or highpass, bandpass, bandstop once they've been transformed into a normalized lowpass). It will find the minimum degree of an elliptic lowpass filter that meets the standard requirements Amin (minimum stopband loss), Amax (maximum passband loss), FB (upper passband edge), FH (upper stopband edge).
If the degree N is <=30, the program also finds the zeros & poles of attenuation, and can also find the loss at any desired frequency, either manually or automatically. If you prefer an automatic plot, there's a choice between linear or logarithmic sweep.
Also, the routines for computing the Complete Elliptic Integral of the First Kind, the Complementary Elliptic Integral of the First Kind and the Elliptic Sine sn(u,k) can be executed from the keyboard without disturbing the computed zeros & poles.
(7 pages, 2,674,192 bytes, scanned by Fernando del Rey)
Program Submittal to the HP Users' Program Library Europe.
This program will find all prime factors of a positive integer N, using a fast and efficient method to test if a number is a prime or to find its prime factors.
(7 pages, 582,109 bytes)
Program Submittal to the HP Users' Program Library Europe.
Given a user-defined function which represents the equation of a 2-dimensional curve, either in rectangular or polar coordinates, this program can find the area bounded by the curve, the length of arc, and the area and volume of the solid of revolution generated by the curve when revolving around the X axis.
Routines for integration and derivation are included, as is an automatic sweep to evaluate the function. 8 excellent examples included.
(7 pages, 4,065,433 bytes)
Program Submittal to the HP Users' Program Library Europe.
Given a user-defined function y(x), this program can compute y(x), y'(x) and y"(x) for a given x, the definite integral of y(x) between limits [a, b] or [a, Infinity], a root of y(x)=0 or y'(x)=0, and automatically tabulate y(x) for a given range of x values, for plotting purposes for instance.
(7 pages, 572,330 bytes)
Program Submittal to the HP Users' Program Library Europe.
This program computes very quickly the limit of the sum of an user-defined infinite alternating series, which is most useful in cases where the convergence is rather slow. It implements both Euler's and Hutton's transformations. Divergent series can be treated as well. 6 nice examples included, with timings and comments.
COPYRIGHT NOTICE
These articles, programs, pictures, their descriptions and other materials created by me
are (c) Valentin Albillo, and can be used freely for non-profit purposes
as long as (1) the contents aren't modified in any way and (2) the copyright is acknowledged.
In plain words, you can download them and use them for non-profit purposes but do not include
them in any media and/or site for which you're asking money, do not tamper with their contents and
do not say or imply that you created them or that you don't know who created them, you must
always give due credit to me.