Valentin Albillo's HP Collection

Back Home

HP Calculators

HP Calculator Articles

Here you'll find all 32 PDF articles I wrote in the past about HP calculators and mathematical algorithms of all kinds implemented as full programs and routines for them. These articles were first published in paper form more than a decade ago and some of them were later published by me in my long defunct HP web page. At long last, the full 32-strong collection is now made available for the first time in its entirety as PDF files.

As of today, my articles feature such RPN calculators as all the Voyager Series models, HP-25, HP-34C, HP-35, HP35S, HP-41C, HP-42S as well as non-RPN ones such as the HP-71B, plus assorted modules such as the HP41C Advantage ROM and the HP-71B Math ROM, and purely math-based ones (though they'll still include relevant code for one or more models).

This Category will also feature all still unpublished articles (12 already featured) I've written in the last decade, which will be released here for the very first time (they won't be submitted to any magazine for publication), plus all new articles I may write now and in the near future. All in all, 44 articles and more than 400 pages for you to enjoy. Stay tuned !



PDF HP Article VA001 - Long Live the HP-11C

5-page article celebrating the modest but capable HP-11C, includes an 84-step program which will very quickly and accurately find the limit sum of any user-defined infinite alternating series (say S = 1/0.23-1/0.24+1/0.25-1/0.26+... = 2.221127525), no matter how slowly it does converge (if at all !). If the series does not actually converge (say S = 1-2+3-4+5-6+...) then the program computes its so-called Eulerian Sum (0.25 in this particular case).

Full documentation and three comprehensive, commented examples.

PDF HP Article VA002 - Long Live the HP-12C

6-page article celebrating the best-selling HP-12C, includes a 72-step program which will allow your HP-12C to play a challenging game of "Bridge-It!" against a human opponent in boards of any size up to 99x99. Try it on your unsuspecting financially-minded friends and see how they fare against the HP-12C !

Full instructions and detailed sample game, with figures.

PDF HP Article VA003 - Time Voyager

11-page article, featuring an original HP-related short Sci-Fi story, specifically written by me as part of Sir Isaac Newton’s Anniversary of Birth’s commemorations. It gathered a lot of interest among HP fans at the time of its release and quite a number of comments and even some pretty interesting questions, see "Article VA032 - Time Voyager Revisited.pdf" below.

PDF HP Article VA004 - HP-12C Tried and Tricky Trigonometrics

10-page article, includes a crafty 99-step program for the original HP-12 financial calculator which evaluates all six standard trigonometric functions (Sin, Cos, Tan and their respective inverses) very quickly and with full accuracy over an extended range of arguments.

The design goals were the following: (1) All six trigonometric functions in a single program, (2) Full accuracy for all functions, (3) Maximum speed and fast computation times for all functions and all inputs, (4) Convenience and ease of use, and (5) Compatibility with other RPN models. All of them were successfully met despite the many shortcomings the HP-12C has for general programming, which are detailed in the article.

Fully documented, including extensive implementation details, timings and accuracy, as well as two worked examples including using the implemented trigonometric functions to find all 5 real roots of a particular 5th-degree equation, and checking a trigonometric identity.

PDF HP Article VA005 - HP-12C Serendipitous Solver

8-page article for the HP-12C financial calculator, includes a 37-step program which makes use of the built-in microcode IRR solver and a number of assorted financial functions to find one or more real roots of polynomials up to the 14th-degree (and up to 1480th-degree or more if there are groups of repeated coefficients). The program allows for quickly entering groups of repeated coefficients and correcting wrong inputs on the fly, and can also evaluate the polynomial for any given arguments.

Both root finding and polynomial evaluation are implemented using built-in financial functions without user-code loops or branching, so it's the fastest and more convenient polynomial root solver for the whole Voyager Series calculators, surpassing even the HP-15C's SOLVE function in this regard. Frankly, one of my very best programs for any calculator and among the ones I'm proud of the most.

The program is fully commented on a step-by-step basis and 5 sample worked cases are included, among them finding real roots of polynomial equations of degrees 3, 7 and 137, and all 5 real roots of a 5th-degree equation.

PDF HP Article VA006 - Long Live the HP-15C

6-page article celebrating the peerless HP-15C, which apart from discussing in detail its many outstanding features such as the keyboard layout, the superb numerical algorithms, the astonishingly comprehensive instruction set and the advanced programming features and large RAM for its time, also features a sample 64-step program which will compute and store up to 208 decimal digits of Euler's constant e (=2.71828+), using mainly the built-in matrix operations.

The program is extensively documented and full results and timings are included as well.

PDF HP Article VA007 - HP-15C Nth-degree Polynomial Fitting

7-page article, includes a 42-step program for the HP-15C which will compute explicitly the coefficients of the polynomial of degree N (2<=N<=6) which exactly fits (passes through) a given set of data points (x,y). The program prompts for the data points, then computes and outputs the coefficients of the polynomial fit, using the HP-15C's powerful built-in matrix operations for maximum speed and accuracy.

The program and algorithm are fully documented, with detailed usage instructions, plus there are three fully worked examples including data fitting and predictions, constructing a polynomial knowing its roots and performing inverse interpolation.

PDF HP Article VA008 - Long Live the Advantage ROM

9-page article celebrating the awesome Advantage ROM for the HP41C series, which includes a 62-step, user-friendly, fully-prompting, fully-commented (step-by-step) implementation for the HP-41C/Advantage ROM of the HP-15C program featured in the article "HP-15C Nth-degree Polynomial Fitting" but extended to handle degrees much higher than 6, in fact limited only by available RAM. Also, if you have Extended Memory installed the program will take advantage (pun intended !) of it and use no main registers at all so it will run even at SIZE 000 regardless of the polynomial's degree.

The article also includes a thorough discussion of the differences between both approaches and no less than than four fully-developed application examples, including fitting, interpolation, inverse interpolation, finding a polynomial given its roots, and exposing polynomials disguised as trigonometrics :-)

PDF HP Article VA009 - HP-71B Modest Mater

12-page article for the HP-71B featuring a 160+ line program that recursively solves arbitrary "Mate-in-N" chess problems like the ones you typically find in magazines. The program can search for a mate in a specific number of moves or in any number of moves up to a given maximum, can search all legal moves or only moves by the mating side which check the opponent's king, will consider pawn promotions and underpromotions, understands stalemates, and can store the given position in a file and read the file afterwards for further use.

Fully commented on a section-by-section basis with many algorithmic details explained, plus two complete, amazing sample chess positions solved by the program: a middle-game typical Mate-in-2 problem and a famous Mate-in-3 endgame problem whose unique solution is an amazing pawn underpromotion to a Knight no less !

PDF HP Article VA010 - Long Live the HP42S

14-page article celebrating the HP42S, includes a comprehensive 423-line professional-looking program to solve the classic "8 Queens Puzzle", written specifically for the occasion in order to demonstrate many interesting 42S programming techniques and methodology, from user menus and matrices to error handling and fast graphics, ergonomy, how to use complex numbers for efficient multi-indexing, growing and shrinking matrices, indexing two matrices at a time, and many other advanced techniques, all considered from a didactic viewpoint.

Full explanation of the programming details and techniques, including the algorithm to detect and optionally filter out derived solutions (symmetries, rotations), is provided, as well as a complete run including all 92 solutions found and the filtered subset of just the 12 primary ones. As a bonus, the original barebones 9-line BASIC program for the SHARP PC-1211 which was used as the basis for this one is included as well.

PDF HP Article VA011 - HP-71B Math ROM Bakers Dozen (Vol. 1)

10-page article, first part of a two-part article featuring in all 13 assorted mini-topics discussing novel, unusual, or otherwise interesting and little-known aspects of using the extremely powerful and versatile Math plug-in ROM for the HP-71B.

The 7 mini-topics discussed in this first Part deal with choice Math ROM capabilities, such as implementing missing matrix operations efficiently using norms and other simple techniques, implementing the missing complex-case for some standard math functions, implementing special transcendental functions such as Mittag-Leffler and Lambert W, quirks of the built-in solver, tips & tricks using complex operations to optimize real results, techniques to generalize subprograms to also seamlessly accept and work with complex data, etc.

Full documentation is provided, including plenty of code snippets, short programs and sample results to demonstrate the points discussed in detail.

PDF HP Article VA012 - HP-71B Math ROM Bakers Dozen (Vol. 2)

8-page article, second part of the Baker's Dozen compendium of assorted mini-topics discussing interesting uses of the HP-71B's powerful Math ROM. The 6 remaining mini-topics discussed in this second Part deal with advanced applications such as polynomial data fitting for real or complex datasets, multidimensional integration, solving systems of non-linear equations, finding all eigenvalues of arbitrary matrices, and matrix operation benchmarks. The purpose is to show just how easily these usually complicated tasks can be dealt with thanks to the incredibily powerful Math ROM features.

Fully documented and, like the first Part, it includes many code snippets, short programs discussing the points presented and even templates for you to use when doing your own multidimensional integration or solving non-linear systems.

PDF HP Article VA013 - HP-71B Short and Sweet Sudoku Solver

10-page article which includes a Sudoku-solver short program (just 35 lines) which can automatically solve any solvable Sudoku puzzle without requiring human intervention, using recursion to any depth if needed, and optionally printing status information as the search progresses as well as the solution once found. It will also recognize when a puzzle has been incorrectly entered and/or there is no solution.

Both the outer Shell (12 lines) and the inner Search subprogram (22 lines), which employs advanced techniques such as the use of bitboards, boolean operations and recursivity, are extensively discussed and commented section by section, including 5 selected Sudoku puzzles ranging from 30 occupied cells to as low as just 19, which are fully soved and commented as well.

PDF HP Article VA014 - HP-71B Fantastic FOUR

8-page article, which discusses an amazing and, to most people, unexpected application of the rarely used Math ROM's FOUR keyword, namely how you can use Fast Fourier Transforms (FFT), and then an inverse transform (which are what FOUR does) to multiply two very high-precision numbers faster than with most any other algorithms currently known.

Includes a very short subprogram (10-line, can be formatted to just 8 lines) which will accept two multiprecision numbers up to 1024 digits long and will ouput their product (up to 2048 digits long), implementing the desired functionality by using FOUR at THREE different places no less! :-). Running time is nearly linear in the size of the inputs compared to quadratic times for the usual "school" algorithm. For instance, multiplying two 512-digit numbers using FFT is already 4 times faster on the HP-71B than doing it with the usual method. Full documentation and examples included.

PDF HP Article VA015 - HP-71B Sudoku Solver Sublime Sequel

9 pages, a sequel to my original 35-line "HP-71B Short & Sweet Sudoku Solver", which includes additional techniques to detect even more forced digits earlier and so avoid the need for recursion altogether or else having it deal with fewer empty cells, thus speeding the solving process enormously (up to 100 times faster in the most difficult puzzles) at the expense of just 10 additional lines of code.

Together both articles form a combined 19-page article which discusses important techniques for this kind of solvers (e.g., bitboards and boolean operations, updating the bitboards more efficiently, using the Conjugate Criterium to fill-in additional forced digits, etc.), plus it includes an additional very carefully crafted, comprehensive 15-puzzle Test Suite, fully commented, with solutions and timings, which, besides showing this solver's performance in action, can also be useful to you in order to test other solvers or even you own Sudoku abilities

PDF HP Article VA016 - Mean Matrices

11-page article, which introduces some new specially designed small matrices I created myself ("Albillo Matrices", AM for short :-) ), which are extremely troublesome to handle for the purposes of system solving, matrix inversion or determinant computation. Unlike the well-known symmetrical Hilbert matrices, whose elements can't be represented exactly in finite floating-point calculators, my matrices include only small, exactly representable 2-digit positive integer values, are balanced (all elements are about the same order of magnitude) and non-symmetrical, yet even for small dimensions (7x7, say) they're nearly intractable by anything short of exact, arbitrary-precision arithmetic.

Four such 7x7 AM matrices are presented (#1, #2, #3 and #7) and full results are given using AM #1 as a test case with useful extensive comments (sections "What can be done ?", "Can it get any worse ?", "Righting the wrongs" and "Conclusions and recommendations") and exact Mathematica-produced results are also included for comparison purposes.

Note: These AM matrices proved to be very popular with knowledgeable people posting at the "Museum of HP calculators" forum and many threads were created (some very long) with tons of additional results for most advanced HP calculators having built-in matrix capabilities or even for program suites implementing matrix operations. Ultimately this resulted in a great number of very thorough, comprehensive comments and lots of worthwhile and enlightening discussions. Also, I introduced several additional AM matrices and variants thereof, to test even further the achievable accuracy.

PDF HP Article VA017 - HP-71B Minimax Polynomial Fit

12-page article including two programs. For starters I give a 3-liner to compute the Least-Squares Nth-degree Polynomial which best fits a given set of (x,y) datapoints in the least-square sense, while for the main course there's a 50-line fully-commented program to compute the Minimax Nth-degree polynomial fit to a given set of datapoints (x,y), where the data can be entered either from the keyboard, automatically generated by evaluating a user-provided function, or read/stored from/to a data file. Additionally, five amazing, comprehensive worked examples are thoroughly discussed.

By definition, the Minimax polynomial is the approximating polynomial which has the smallest maximum deviation from the true function in absolute value. Thus, we’re minimizing ABS(P(x)-f(x)) instead of (P(x)-f(x))^2 as Least-Squares does. The user can specify the degree of the polynomial or else specify instead a maximum absolute error and let the program automatically select the lowest degree which will achieve it. Once the coefficients have been computed the user can evaluate the resulting polynomial at any given arguments right from the keyboard (even as part of more complicated expressions), and can also check the quality of the fit by automatically scanning any given interval for maximum errors in it, at whatever step size desired.

Minimax polynomial fitting is an incredibly powerful technique to add to one’s own data-fitting arsenal. Though the internal details are complex enough and it does require a lot of computing muscle when compared to other well-known strategies such as Least Squares, the final reward is the improved accuracy it provides for any given degree or, conversely, the lowest possible degree for any given accuracy. It may take longer to compute, but typically you do that just once, then evaluate the resulting polynomial many times, which, being of lower degree than the ones obtained by any other methods, will then evaluate faster, thus saving time in the long run.

PDF HP Article VA018 - Long Live the HP-16C

5-page article, which commemorates that wonderful "Programmer's model", the unique Voyager-series HP-16C. It includes an interesting 91-step program that highlights some exclusive functionalities of this model (such as variable word size) applied to solve the "Towers of Hanoi" puzzle for N discs (the original puzzle has N=64) by mimicking recursion to very deep levels. Matter of fact, using a word size of 8 bits allocates as much as 111 registers available for the emulated recursion stack.

Additionally and by way of comparison and to further explain the algorithm used, HP-71B recursive (2-line) and non-recursive (6-line) versions are provided as well.

PDF HP Article VA019 - 25 years of Othello

8-page article to commemorate the 25th Anniversary of my HP-41C "Othello"-playing program. For those of you who feel nostalgic about the golden past of classic HP calculators, this article reminisces on those wonderful times back when the HP-41C was brand-new and everything seemed possible and everyone was in awe at it.

The article tells the whole story about how my HP-41C "Othello" program came to be, with its downs and its ups (like being featured at the time in an issue of the "Wall Street Journal" magazine), and including previously unpublished letters sent from HP Corvallis to me ("The program has generated a lot of interest in our division"), asking me to submit it to the HP-41C User's Library and awarding me a special "Certificate for Outstanding Contributions" in return.

Also included is a recreation of the original HP-41C "Othello" for the HP-71B, which is a 43-line program with full instructions and sample run so that you can test your wits playing this challenging 8x8 board game against it, to try and feel what HP-41C users felt at the time when seeing it for the first time 25 years ago.

PDF HP Article VA020 - Long Live the HP-25

7-page article to commemorate the jaw-dropping original HP-25, my very first HP calculator ever and one of the most memorable classics ever made. The article includes some fond personal remembrances of those golden times, as well as a thorough explanation of why the HP-25 made such an impact back then, all of it conveniently laced with two truly awesome programs written in the 70's by two hyper-enthusiastic youngsters (one of my friends and myself) to numerically solve user-defined 1st-order differential equations using 3rd-order (36 steps, 3 function calls per step) and 4th-order (39 steps, 4 function calls per step) Runge-Kutta methods ... on a 49-step tiny RPN calculator with NO subroutine capability and no flags !!.

Single-stepping through the programs is a revealing experience, allowing you to fully appreciate what can be done in less than 40 steps and how everything fits together and works as if by magic, a real epiphany of sorts. Additionally, two very interesting non-trivial sample runs are included, with full step-by-step explanations and results.

PDF HP Article VA021 - HP-71B Sudoku Generator and Coach

14-page article which completes my Sudoku Trilogy, featuring a "Sudoku Generator & Coach" program which can generate an essentially infinite number of puzzles per the user's specifications, including number of empty cells, symmetries and optionally guaranteed uniqueness and solvability of the generated Sudoku puzzle without guessing ever being necessary. The resulting Sudoku puzzle is then output in a fully ergonomic, printable format so that you can generate a number of unique, solvable Sudoku puzzles and print them to later solve on the go.

The Coach part can give appropriate hints of various types, one at a time, guaranteed to be logically deductible by the user in the given order, either fully completing the puzzle or stopping midway, and can do that for both the self-generated puzzles and for arbitrary externally provided ones (say, taken from some magazine), which you can input for coaching.

PDF HP Article VA022 - Know Thy Foe A New Contender

12-page article which describes and compares the two greatest contemporary, ground-breaking machines of the early 80's: the RPN flagship HP-41C versus the very first pocket computer, the BASIC-programmable SHARP PC-1211.

The article includes six excellent side-to-side pictures comparing specific key design features of both models, as well as a thorough technical description of their differences (display, keyboard, usability in manual calculations, programming, mass storage, documentation) and two test-case programs, each of them written for both models to better see them in action while dealing with the very same programming task but each using their unique programming paradigms ("Hand to hand: a casual duel").

Finally, four additional short sample programs for the SHARP PC-1211 are included (all of them less than 9 lines long) yet successfully dealing with fairly non-trivial tasks with utmost ease.

PDF HP Article VA023 - Long Live the HP-34C

9-page article dedicated to the groundbreaking HP-34C, a true landmark of vintage HP calculator design in many aspects, which introduced for the first time a number of state-of-the-art computing capabilities such as built-in solve and integrate functionalities, linear regression, gamma function, automatic memory allocation, etc., many of them never seen before in any HP handheld device, let alone at such a relatively cheap price and with full advanced programmability to boot.

The article includes fond personal remembrances related to this model, as well as a 66-step application program taking full advantage of some of its most advanced built-in capabilities to perform numerical two-dimensional integration of a user-defined f(x,y) between given limits. Four excellent, fully documented examples are included and last but not least, by changing just the one "DSE" instruction to "DSE I" this program will also run *as is* in the HP-15C !

PDF HP Article VA024 - Long Live the HP-71B

12-page article celebrating the astounding HP-71B, which discusses its ultra-advanced capabilities in detail and further includes two wonderful pics as well as a brand-new program I've written specifically for the occasion, which in just 6 lines of code (!!) manages to generate and output user-defined ASCII-based stereograms, viewable from the printed page or monitor output (an Emu71-emulated HP-IL monitor, for instance) in full, glorious 3-D !

The underlying theory is explained in detail and the program is very extensively commented section by section (about 70 lines of explanation for the 6 lines of code !), as are the 3 awesome examples which generate just as many fully 3-D viewable ASCII stereograms, one of them being a 3-D HP logo :-). Finally, a section on "Seeing Stereograms" is included for the benefit of people not used to them.

PDF HP Article VA025 - Long Live the HP-35

5-page article, belonging to my "Long Live" series, which is intended as a commemorative article for the HP-35's 35th anniversary, and I think you'll agree it's quite an original approach to it.

It highlights all the groundbreaking capabilities of the HP-35 and their importance from a historical point of view, and further it includes three examples featuring four small "programs" (for a non-programmable calculator no less !), addressing such topics as root finding and numerical integration among others, as well as providing the appropriate historical context and a few personal anecdotes to spice it all. As you'll see, it's certainly a one-of-a-kind article.

PDF HP Article VA026 - Boldly Going - Matrix Square Root

6-page article, the first of my "Boldly Going" series which, as its name implies, is intended to effectively go "where no HP calc has gone before", dealing with unusually difficult programming tasks in a straightforward manner, thus expanding the limits of what you can do with your HP calc and how simply can you do it. For instance, can you use your HP calculator to find the matrix square root of these two neat little matrices

      |   56   97   17   89  |       |  4 +  i   7 +  i   3 -  i   4 + 2i  |
  A = |   33  -68  -42    5  |,  A = |  6 -  i   9 + 4i   8 – 3i   3 – 2i  |
      | -206  -48  -34 -104  |       |  1 + 3i   1 – 2i   4 + 2i   3 +  i  |
      |  -39   92   27   30  |       |  2 -  i   1 + 4i  -3 + 4i   1 +  i  |

that is, to find a real/complex matrix R so that R*R = A, in each case ?

This article discusses in detail just that, finding the matrix square root of square matrices. Two full programs are featured: a 7-line subprogram for the HP-71B which can deal with real- or complex-valued NxN matrices, and a 45-step program for the HP-15C which will find the square root of real-valued matrices up to 4x4. Four examples are provided, with full comments and notes, as well as the underlying algorithm.

PDF HP Article VA027 - Small Fry - Primes Acounting

1-page article belonging to my "Small Fry" series, which is intended to feature very small articles (maximum 1 page or two) while still keeping all the flavour and bite of the usual longer ones.

This article deals with the topic of prime counting, i.e., finding out how many prime numbers there are up to a given limit N. For large N, generating all primes up to N and returning the count is prohibitively expensive in terms of running time and/or memory usage, so: What can we do about it when N goes sky-high (say 10^10, 10^15, or more) ? The article features an 8-line user-defined function for the HP-71B to accomplish the feat very quickly with relative error as low as 0.000000004% for N as high as 40,000,000,000,000,000, as well as several comparative examples against other well-known prime counting procedures.

PDF HP Article VA028 - Small Fry - Let's Be Rational

2-page article which includes a 4-line subprogram to very quickly convert a user-given real value to the simplest equivalent rational fraction within a user-specified maximum relative error. Fully documented, including a simple modification which allows you to see the underlying continued fraction representation of a given real value, and yet another equally simple modification which will output the successive ever-more-accurate fractions (convergents) as they’re being computed.

Additionally, examples are given to approximate Pi by a fraction, perform exact rational arithmetic and reduce fractions to lowest terms.

PDF HP Article VA029 - Boldly Going - Identifying Constants

14-page article which includes the original version (v1.0) of my truly awesome (if simple) program which allows "ye goode olde" HP-71B to perform some rather impressive "symbolic" feats. The program does not require any additional ROMs or files, just a bare bones HP-71B, and can be converted to any other suitably fast HP model or emulator with minimum effort.

The program provides basic functionality for an advanced, very useful and most impressive feature which is nevertheless absent in all HP calculators' instruction sets, namely identifying numeric constants, i.e., the capability of, given some real numeric value, to try and identify its exact symbolic form if possible, and that failing, to provide an approximate symbolic expression of user-specified relative accuracy.

This allows us to perform some pretty nifty feats, such as attempting to give exact, symbolic results for definite integrals (even if they can’t be expressed in terms of elementary functions), finite or infinite summations, limits, specific values of transcendental functions and exact arithmetic with fractions, among other imaginative uses.

The full 14-page article includes more than 40 fully worked examples as well as three detailed extensions, the last being an "exercise' for the reader", solution included of course ! :-)

PDF HP Article VA030 - HP35S Storing Lotsa Lotsa Numbers

4-page article which discusses my brand-new 16-line (185-byte) implementation to pack three full-precision real numbers into a single variable, thus making it possible to store and recall in excess of 2300 floating-point values in HP35s’ indirect variables. It consists of three main, externally callable routines which implement the essential Initialization, Store, and Recall functionalities, all of them within the address space of a single label.

The implementation is such that you can convert any program using standard variables to use virtual variables instead by just calling the Initialization routine once, then changing each STO(I) and RCL(I) to the appropriate calls, which work exactly like the originals as far as stack behavior is concerned, LASTX included. Full examples given, including a 21-step tester program to check that the routines are working properly.

PDF HP Article VA031 - Boldly Going - Going Back to the Roots

7-page article which includes a small 48-step program that will allow you to find a real or complex root of an arbitrary equation with real and/or complex coefficients starting from just one real or complex initial guess. The root will be displayed as labeled output and left both in the X stack register and direct register X. Roots will be returned as genuine real/complex values as appropriate, i.e., a computed real root will be a proper real value, not a complex value with a zero or very small imaginary component.

Further, a real initial guess may find a complex root and vice versa. The program implements an optimized version of an advanced, cubically-convergent numerical method that typically converges very quickly to a root with speed comparable to that of the built-in Solver (which can't generally find complex roots) or better, and which, unlike Newton’s method, will foray into the complex domain if need be, even when starting from a real initial guess.

Full documentation, with emphasis on programming techniques, as well as 5 comprehensive examples duly annotated.

PDF HP Article VA032 - Time Voyager Revisited

3-page article having to do with my short Sci-Fi story "Time Voyager", featured in my "Article VA003 - Time Voyager.pdf" (which you can download using the link above in this page). The original story was well liked by a number or readers, and some people even took the trouble to let me know their enthusiastic opinion about my story, which was much appreciated of course, but certain readers went even further to ask some amusing questions about its fine details, even to the point of suggesting the possibility of trying to check whether it actually might hold some water by combing the original manuscripts and locations for telltale indicia ! LOL !

However, among all the questions there was one in particular which actually was a pretty good one which I never stopped to consider in the first place and I really felt at the time that the question was interesting enough for other people who did read the story to be able to consider it and get to know my (hopefully also interesting) answer, so I included it in the present article for the benefit of all interested readers.

Nevertheless, as the answer to the question entails spoiling the catchy end of the story, I strongly advise all of you intent on reading this "sequel" article who haven’t yet read the original story to please read it first (using the link above), then return to this article for the question & answer. The original story is a short 11 pages and it would make much more sense to read it first, trust me.

PDF HP Article VA038 - DOMINOKU – Swiftly Solving Domino Grids

10-page article, this time featuring a program I wrote years ago for the HP-71B to solve a newspaper-style domino puzzle which goes by assorted names (“Domino Logic”, “Domino Hunt”, “Domino Dilemma”, “Dominosa”, etc.) where you’re given all 56 numbers (pips) corresponding to the full set of 28 dominoes already placed on a grid, and you must find the exact location for each domino.

The program can solve grids of any shape up to 9x9, even with holes inside, and as was the case with my Sudoku solver, it is a nice example of how recursion can be extremely useful to simplify the programming by implementing a search procedure which calls itself to go deeper and deeper until the puzzle is completely solved or else determined to be inconsistent and thus have no solution. 8 fully worked examples included.

PDF HP Article VA040a - Boldly Going - Mandelbrot Set Area (HP42S)

8-page, 4-figure article belonging to my "Boldly Going" series, which includes a 98-step RPN program I wrote in 2019 for the HP-42S and physical/virtual compatibles, addressing and succeeding at the difficult task of computing an accurate estimation of the Mandelbrot Set's area in very reasonable times.

First of all, the various approaches in the literature are introduced and commented, then state-of-the-art results are presented, and finally the techniques used here are discussed at length, including comprehensive references. Two sample runs are featured as well as a main, "ultimate" run which achieves excellent accuracy in quite a short running time.

PDF HP Article VA040b - Boldly Going - Mandelbrot Set Area (HP-71B)

8-page, 4-figure article belonging to my "Boldly Going" series, which includes a 9-line BASIC program I wrote in 2019 for the HP-71B and virtual compatibles, addressing and succeeding at the difficult task of computing an accurate estimation of the Mandelbrot Set's area in very reasonable times.

First of all, the various approaches in the literature are introduced and commented, then state-of-the-art results are presented, and finally the techniques used here are discussed at length, including comprehensive references. Two sample runs are featured as well as a main, "ultimate" run which achieves excellent accuracy in quite a short running time.

PDF HP Article VA041 - HP-41C Mate w King Bishop Knight Practice

7-page, 13-diagram article including a 285-step RPN program which I wrote in 1980 for the HP-41C and compatibles (will run as-is in the HP-41CV/CX and with trivial or no changes in other compatible models such as the HP42S). 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 the program's King before the allotted moves elapse, while the program does its best to avoid being checkmated.

It implements a simple, very fast (a few seconds per move on a physical calculator) but quite effective positional strategy which will frequently succeed in avoiding being checkmated against human players not too experienced with this basic checkmate, and even against vintage computer programs or dedicated machines not having access to the appropriate endgame tablebase.

Full instructions included as well as two worked examples, one of them using no less than world-class chess engine Stockfish 9 (3,300 ELO !!) to conduct the winning pieces against this program.

PDF HP Article VA042a - Boldly Going - Outsmarting PROOT (42S)

15-page article belonging to my "Boldly Going" series, which includes a small 131-step RPN subprogram, PZER (plus an optional 75-step driver, ZPOL) for the HP-42S and compatibles (DM42, Free42, Emu42, etc.), which deals with a glaring limitation of the built-in function set of the HP-42S, namely the absence of a function equivalent to the HP-71B Math Pac’s keyword PROOT, the polynomial root finder which finds all roots of a real polynomial of degree N.

The HP-42S includes ample built-in functionality akin to the one provided by the HP-71B Math Pac, such as complex numbers and operations, matrix operations, even Solver and Integrate tools, but it lacks any equivalent of PROOT, which by the way works only for polynomials having real coefficients. On the other hand, PZER works efficiently and accurately for polynomials whose coefficients are real and/or complex.

Includes tables detailing performance and relative speeds for the various devices, plus 10 fully worked examples, among them one comparing PZER's performance vs. PROOT when finding all 100 complex roots of a 100th-degree polynomial to 12-digit accuracy, two examples solving polynomials having multiple roots (double, triple, ...), and two examples finding roots with up to 34 correct digits when using a physical DM42 or the virtual Free42 Decimal.

PDF HP Article VA042b - Boldly Going - Outsmarting PROOT (71B)

15-page article belonging to my "Boldly Going" series, which includes an 11-line BASIC subprogram, PZER (plus an optional 5-line driver, ZPOL) for the HP-71B and compatibles (Emu71/DOS, Emu71/Win, go71b, etc.), which deals with a serious limitation, namely the fact that the HP-71B Math Pac’s keyword PROOT, the polynomial rootfinder which finds all roots real and/or complex of a polynomial of degree N, works only for polynomials having all coefficients real, it can't deal with complex coefficients at all.

On the other hand, PZER works efficiently and accurately for polynomials whose coefficients are real and/or complex, and together with subprogram PCHAR it can be used to find all real/complex eigenvalues of a real/complex NxN matrix using just two statements, the call to PCHAR to find the Characteristic Polynomial and the subsequent call to PZER to find all its roots, which are the matrix eigenvalues.

Includes a table detailing its performance, plus 11 fully worked examples, among them two comparing PZER's performance vs. PROOT when finding all 100 complex roots of a 100th-degree polynomial to full accuracy, and four examples solving polynomials having several multiple roots (double, triple, ...).

PDF HP Article VA043 - HP-71B Advanced Uses of STRNGLEX

6-page article, this time featuring STRNGLEX, a most useful LEX (Language Extension) binary file for the HP-71B, which provides much-needed string handling support to complement the sorely lacking set of built-in string functions. First, all 11 functions provided are summarily described for the sake of completeness, then the focus centers on 4 of its less known keywords (MEMBER, SPAN, SBIT and SBIT$), whose full syntax and capabilities are described with basic examples aplenty as well as more elaborate examples which are discussed in detail.

PDF HP Article VA044 - HP-71B Math Pac 2 Comments and Proposals

25-page article, extensively detailing the new keywords and functionalities I propose for the HP-71 Math Pac 2, an undergoing new exciting project of Jean-François Garnier, the author of Emu71/DOS.

Now I’ve been very carefully considering what would be the most useful additions to the original Math Pac set which would still fit in the 5 Kb or so of unused ROM space available, while optimizing the usefulness and minimizing the implementation difficulty, and this article is the set of comments and proposals I came up with. It proposes and fully describes 22 new keywords, each graded for priority and difficulty, documented in HP-Manual-style fashion with description, syntax, parameter types, relevant comments, full-fledged worked examples, and a substantial rationale on its usefulness and why it was selected.

A future sequel article (VA045) will include my optimized BASIC-code implementations of all the functionalities described here (which I actually used to create the worked examples and their results), to be used as a reference for the eventual conversion to Saturn Assembler code (as new keywords and/or binary subprograms), as well as being of use by themselves in the meantime, by simply calling them from user programs.

PDF HP Article VA046 - Boldly Going - Abundant but Rare

7-page article belonging to my “Boldly Going” series, this time dealing with a most fascinating topic in Number Theory, namely finding a particularly rare kind of so-called abundant numbers.

The qualifier “abundant” refers to a classification of the positive integers which considers them as being either deficient, perfect or abundant depending on the sum of their proper divisors, and we’re boldly going to find a most rare variety of the latter, so rare in fact that up to 10210 there are only seven of them, A1 to A7, the last being a 205-digit number no less.

Anyway, we’ll use our trusty vintage HP-71B to quickly find and display all seven, exactly. It also contains a useful 5-line user-defined function to compute the "Sum of Proper Divisors" number-theoretical function and variants of it, also including several interesting examples of use.

PDF HP Article VA047 - Boldly Going - Eigenvalues and Friends

15-page article, featuring a subprogram, PCHAR, which deals with an advanced funtionality very frequently needed in all sort of disciplines in Science, Engineering and Computing, yet not covered at all in the HP-71 Math Pac ROM, namely the task of computing all eigenvalues real and complex of an arbitrary real or complex square matrix.

Subprogram PCHAR is very short (6 lines, 271 bytes) yet capable of quickly and accurately computing the Characteristic Polynomial of an arbitrary NxN real or complex square matrix in a format ready for computing all its real and complex eigenvalues with a single call to MAT..PROOT or PZER, so you get the task done using just two statements: calling PCHAR and executing MAT..PROOT or PZER.

Additionally and as a big bonus, it also computes real/complex determinants and inverse matrices with accuracy far exceeding in some significant cases what the assembler-code MAT..INV, MAT..SYS and DET keywords can achieve (none of which can compute complex determinants, by the way), and at no extra cost whatsoever either in memory usage or computing time.

Many relevant, fully worked-out and commented examples included, as well as a detailed discussion on how to convert PCHAR to a binary subprogram or keyword.

PDF HP Article VA049 - Boldly Going - HP-16C Scientific Functions Part 2

7-page article, featuring the second part of the mini-series of articles dedicated to provide the HP-16C Computer Scientist calculator with a comprehensive set including the main scientific functions usually available in most HP scientific models, and some of them even in financial models such as the HP-12C.

Here I address the implementation of the seven inverse functions, namely arcsin(x), arccos(x), arctan(x), arcsinh(x), arccosh(x), arctanh(x) and ln(x), corresponding to the direct ones already discussed and implemented in Part 1. Many examples included covering the whole range for each function.

PDF HP Article VA051 - Boldly Going - Climbing Project Euler

12-page article, featuring Project Euler, a fantastic project which attempts (and succeeds, in spades !) at providing a huge supply of challenging math+programming problems which are immensely fun to try and solve, learning loads of new concepts while sharpening your skills in the process.

In this article I tell my story with Project Euler and how I dealt with it back in 2011 using the vintage 1984 HP-71B (emulated & physical), which is orders of magnitude slower and less capable than the hardware/software combinations Project Euler's problems are intended for (i.e.: fast modern CPUs + high-level compiled languages), thus enormously upping the ante when tackling them with ancient hardware and interpreted BASIC. See for yourself how I did !

Seven carefully-selected sample PE problems discussed and solved.

PDF HP Article VA054 - My suggested New Features for Free42

16-page article, these are my well-pondered and researched suggestions of functionalities which could be implemented in Thomas Okken’s awesome HP-42S simulator, Free42, to very significantly increase its capabilities with minimum effort. All of them are based on the functionalities that I’ve frequently found necessary to use in my own programs to either simplify the programming effort or to very significantly increase the speed but alas, they weren’t currently available at the moment I needed them. This might be the time to remedy these omissions for good !

The article includes all proposed functions and functionalities grouped in the following 7 categories: Math functions (including Basic functions, Advanced functions, Number Theoretic functions, Statistics functions), Matrix operations and functions, Polynomial-related functions, Constants, Loop-related functions and functionalities, Utility keywords and Additional useful functionalities. Each function is described and classified for both its usefulness and implementation difficulty, with examples and stack diagrams where appropriate and a rationale for why am I proposing it and why should it be desirable to implement it.


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.