Re: Optimizing programs: Writing a number VS calling a variable Message #4 Posted by Don Shepherd on 8 July 2010, 1:57 a.m., in response to message #1 by Pablo P (Spain)
Well, here are the "surprizing" results for the HP-32s, optimized by placing subroutines W and Z at the beginning of code.
Factoring 99,999,989 (a prime number)
Old method, using numeric constants 2, 1, 4, and 6: 144 seconds
New method, assigning 2, 1, 4, and 6 to variables A, B, C, and D (outside the loops) and RCL them: 146 seconds
So this would indicate the 32s does not seem to suffer from this malady.
|