[Michel Jean] asked a question few others might: what exactly is going on under the hood of a classic HP scientific calculator when one presses the ∫ key? A numerical integration, sure, but how exactly? There are a number of useful algorithms that could be firing up when the integral button is pressed, and like any curious hacker [Michel] decided to personally verify what was happening.
[Michel] implemented different integration algorithms in C++ and experimentally compared them against HP calculator results. By setting up rigorous tests, [Michel] was able to conclude that the calculators definitely use Romberg-Kahan, developed by HP Mathematician William Kahan.
Selected by HP in 1979 for use in their scientific calculators, the Romberg-Kahan algorithm was kept in service for nearly a decade. Was it because the algorithm was fast and efficient? Not really. The reason it was chosen over others was on account of its robustness. Some methods are ridiculously fast and tremendously elegant at certain types of problem, but fall apart when applied to others. The Romberg-Kahan algorithm is the only one that never throws up its hands in failure; ideal for a general-purpose scientific calculator that knows only what its operator keys in, and not a lick more.
It’s a pretty neat fact about classic HP calculators, and an interesting bit of historical context for these machines. Should you wish for something a bit more tactile and don’t mind some DIY, it’s entirely possible to re-create old HP calculators as handhelds driven by modern microcontrollers, complete with 3D-printed cases.
Thanks to [Stephen Walters] for the tip!

That HP-34C might actually use Romberg-Kahan (having been introduced in 1979), but I wonder what that HP-67 on the left uses: The one that has the “NUMERICAL INTEGRATION” card inserted. It’s from 1976.
No need to wonder. The code is published at hpmuseum.org. The HP-67 program uses Simpson’s rule for functions, or good old trapezoidal rule in the discrete case.
hehe. Just found some of my own code there too. From 1982. Fun times.
Indeed, the choice of the image is somewhat misleading, since the first to use Romberg–Kahan was the HP-34. I placed the 67 next to the 34 only to illustrate the diversity of methods.
Paul, what was the assembly language you used to program that hp-67, please?
My contributed code isn’t assembly. Like most library code for these machines, until plug-in ROM modules came along in the HP41, it is simply keystroke sequence programming. The 67 (and 41) stored them on magnetic cards.
Saved up my bucks and bought an HP-25 for grad school. Loved it and still have it. I have a v41 emulator on my PC. RPN for life!
Reverse Polish Notation:
https://ffii.org/ffii-and-epo-announce-binaries-as-prior-art/
I’m ashamed at how long it took me to notice the April 1 date on that article.
This one as well:
https://ffii.org/microsoft-trains-unified-patent-court-judges-to-count-to-5-with-its-new-ai-assistant/
In 1982, the integration algorithm of the HP 34 helped me to calculate values of Bessel functions (they were needed for the spectrum of a phase modulation). I couldn’t find the values in any tables with sufficient accuracy, so I decided to calculate them using the integral representation of Bessel functions. The calculator took a total of about two days to complete the calculation! The effort was worth it: I won first prize in a competition on communications engineering.
Wasn’t the algorithm called Cautious Romberg Integration?
According to Google, “Cautious Romberg” is an adaptation of de Boor’s approach to numerical integration that is used to approximate the value of a definite integral by applying Richardson extrapolation to the trapezoidal rule. It typically refers to a numerical method used in mathematics for estimating integrals with high accuracy. It is a refinement of the standard Romberg’s method that incorporates specific error-checking to ensure the stability of the extrapolation process.
My Casio FX-180P also supports an integration function which integrates the function in P1 or P2, but uses a trapezoid algorithm and you can set the number of segments it calculates based on a power of 2.
It was very useful for checking my calculations in my UK ‘A’ level exams in the mid-1980s (and yes, I cleared the program areas in front of the invigilator before doing the exams!).
In the 70’s I couldn’t afford an HP. I still have my college Pickett slide rule and it’s hard case ready for the apocalypse
Slide Rule !!!
The most worked tool in a (1950’s) Engineer’s toolbox
Ah! the good old days !