QPI v4.2 Mika Heiskanen -------- mheiskan@delta.hut.fi Based on QPirac by A.Coulom and MuPAD rationalize command. QPI approximates any floating point numbers by a rational number, square root, multiple of PI, exponential or a logarithm depending on which approximation seems best. QPI should work in all ports of any HP48 SX/GX model. Allowed argument types are real number --> symbolic / real number complex number --> symbolic / real number identifier --> identifier local name --> local name symbolic --> symbolic array of real/complex --> list of symbolic/real constants (PI,e) --> constant list of above --> list of above The rational approximation algorithm is taken from MuPAD, and works quite well for numbers of any scale. The decision procedure for the minimal approximation of real numbers is as follows If x=zero then return (x) nom,den=approximate(x) If den < 100 then return (nom/den) % Early abort nom2,den2=approximate(x*x) If (x*x<5E5) & (den2<1000) & (den20) & (den2<50) & (den2 { { '-5/7' '-SQRT(2)' } { 'LN(2/3)' 'EXP(1/9)' } { '-7/9*PI' '5/7*SQRT(11/13' } }