Hewlett-Packard HP-48G

Datasheet legend
Ab/c: Fractions calculation
AC: Alternating current
BaseN: Number base calculations
Card: Magnetic card storage
Cmem: Continuous memory
Cond: Conditional execution
Const: Scientific constants
Cplx: Complex number arithmetic
DC: Direct current
Eqlib: Equation library
Exp: Exponential/logarithmic functions
Fin: Financial functions
Grph: Graphing capability
Hyp: Hyperbolic functions
Ind: Indirect addressing
Intg: Numerical integration
Jump: Unconditional jump (GOTO)
Lbl: Program labels
LCD: Liquid Crystal Display
LED: Light-Emitting Diode
Li-ion: Lithium-ion rechargeable battery
Lreg: Linear regression (2-variable statistics)
mA: Milliamperes of current
Mtrx: Matrix support
NiCd: Nickel-Cadmium rechargeable battery
NiMH: Nickel-metal-hydrite rechargeable battery
Prnt: Printer
RTC: Real-time clock
Sdev: Standard deviation (1-variable statistics)
Solv: Equation solver
Subr: Subroutine call capability
Symb: Symbolic computing
Tape: Magnetic tape storage
Trig: Trigonometric functions
Units: Unit conversions
VAC: Volts AC
VDC: Volts DC
Years of production:   Display type: Graphical display  
New price:   Display color: Blue  
    Display technology: Liquid crystal display 
Size: 7"×3½"×1" Display size: 131×64 pixels
Weight: 10 oz    
    Entry method: Reverse Polish Notation 
Batteries: 3×"AAA" alkaline Advanced functions: Trig Exp Hyp Lreg Grph Solv Intg Ab/c Cplx Symb Fin Cmem RTC Snd Mtrx BaseN Units Const Eqlib 
External power:   Memory functions: +/-/×/÷ 
I/O: Serial port, IR port     
    Programming model: Reverse Polish Language 
Precision: 12 digits Program functions: Jump Cond Subr Lbl Ind  
Memories: 32(0) kilobytes Program display: Text display  
Program memory: 32 kilobytes Program editing: Text editor  
Chipset: Saturn   Forensic result: 8.99999864267  

hp48g.jpg (32031 bytes)The HP-48G is the "low-end" (is this term really appropriate for a machine with graphics, symbolic math, infrared and RS-232 I/O, and more features than you can imagine?) member of a series of Hewlett-Packard calculators that replaced the highly successful HP-48SX line. The new calculators are somewhat faster, and also contain upgraded software. The lower cost of the HP-48G is achieved because this model does not contain expansion ports. It does, however, have a built-in version of HP's Equation Library, a product formerly sold separately as an HP-48 accessory.

I am playing with a newly acquired HP-48G as I write this and it keeps me amazed. Other machines may have gimmicks like a color display, but in terms of functionality, the HP-48 series is far superior to anything I've ever seen. Just as keystroke programmable calculators were a perfect learning tool for the programmer of the 70s or the early 80s, this machine with its object-oriented User RPL language is the perfect learning tool for the 90s and beyond. But it's more than just a learning tool: all HP-48 calculators are serious professional instruments.

To demonstrate this, I decided to do something different. For the majority of calculators shown on this Web site (with the exception of a few very low-end machines that don't support this) the programming example I present is an implementation of the Gamma function. For the HP-28/48 series of calculators, I have already presented a complex implementation of this function, and an implementation of the incomplete Gamma function as well. There are only so many variations on a theme!

Fortunately, just a few days ago I was able to assist someone on the Internet with an HP-48 programming question, and it gave me the opportunity to practice my RPL programming skills. The question was this: how do you create a program that calculates the radius of curvature? For any function f(x), the radius of curvature at any x=x0 can be obtained by evaluating (1+(f'(x)2))3/2/f''(x). So, can we create a program that takes a number (x0) and a function as arguments on the stack, and returns a number that's the value of the radius of curvature we seek?

Few programming languages offer such a powerful feature (in fact, the only non-HP machines that I know about that are capable of this feat are the TI-89 and TI-92). Were we to use C++, we would be forced to write a sophisticated expression evaluator (or alternatively, we would have to resort to using a third party library.) Not so with User RPL, as the program below neatly demonstrates.

To use this program, enter an expression using an independent variable, the name of the independent variable, a value. For instance, enter the following arguments:

'X^3'
'X'
2

When you invoke the program (I stored it under the name ROC on my calculator) within a couple of seconds, the display will show the result: 145.50260116. You can also use ROC in algebraic expressions (e.g., 'ROC(X^3,X,2)'). Please note that using this program requires that your calculator be placed in symbolic mode (-3 CF). For this reason, you cannot use ->NUM on expressions containing ROC, nor can you use ROC as a plot function without writing a suitable wrapper function.

«
  -> fX x x0
  «
    fX x ∂ DUP -> dfX
    «
      dfX x ∂
    »
    SWAP 2 ^ 1 + 3 ^ √ SWAP / -> fR
    «
      fR x x0 2 ->LIST |
    »
  »
»