The new decimal library is in place, and the new firmware now feels a lot more responsive when using trig functions, getting an instantaneous response, when before there used to be a slight delay.

In order to measure the speed of the new library, a new benchmark was prepared that uses transcendental functions and compares the speed to the 50g doing the exact same calculation. The same program was executed on a 50g with stock firmware and a 50g with newRPL. The objective of the program is to compute 100 points of a damped oscillatory function. The function in question is A*e^(-w0*c*t) * SIN( sqrt(1-c^2)*w0*t). In both cases the parameters used to run the program were: A=10, c=0.3, w0=1.25. The points are calculated from t=0 to 10 seconds, with a step of 0.1. The resulting userRPL program was:

<< -> A c w0 << 0 10 FOR t A c w0 t * * NEG EXP * 1 c DUP * - [SQRT] w0 * t * SIN * 0.1 STEP >> >>

And it was executed by a wrapper that gave the parameters:

<< 10. 0.3 1.25 OSC >>

Here are the results of the benchmark:

TEST CASE |
TIME [sec] |

Stock firmware (12 digits) | 3.507 |

newRPL (12 digits) | 0.794 / 0.369 |

newRPL (32 digits - DEFAULT) | 1.041/ 0.613 |

newRPL (120 digits) | 3.466 / 3.033 |

newRPL (200 digits) | 6.847 / 6.423 |

newRPL (1000 digits) | 97.846 |

newRPL (2000 digits) | 335.348 |

newRPL has 2 results for each test. The left one is the time "as the user perceives it", including the first 300 ms running in slow mode, then switching into full speed. The second number is "raw throughput", measures after the CPU is running at full speed, and gives a good idea of the computing power.

This benchmark executes about 700 multiplications, and 300 transcendental functions (100 SIN, 100 EXP and 100 SQRT) in that time. At comparable precision, newRPL is about 9.5x faster than the stock firmware. At around 120 digits of precision, newRPL finishes the task in about the same time as the stock firmware.

Unofficially, the same program was executed on an older version of the firmware still using the mpdecimal library. At the default precision of 36 digits, execution took about 8 seconds but can't be reported for 2 reasons: the ROM didn't have proper TICKS support therefore couldn't measure time accurately, and because it produced incorrect results, so it was disqualified from the comparison (although the number of operations was the same (despite having a bug somewhere), so times were indeed comparable).