This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
benchmarks:savage [2019/01/07 11:26] jdb2 Fixed resultand absolute error values for HP48GX Saturn assembly entries |
benchmarks:savage [2019/01/07 14:14] (current) jdb2 Minor "HP 48gx, SATURN ASM ( screen and keyboard scanning turned off )" cleanup |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Calc bench: Savage ====== | ||
+ | **The idea** \\ | ||
+ | [[http:// | ||
+ | My discussion is limited to calculators that do finite precision BCD floating point arithmetic. | ||
+ | |||
+ | In the V8N1 issue of Datafile, Wlodek Mier-Jedrzejowicz had an article about the " | ||
+ | |||
+ | It is, in HP71 Basic: \\ | ||
+ | < | ||
+ | 5 RADIANS //the calculation is performed with the angle mode in radians. | ||
+ | 10 A=1 | ||
+ | 20 FOR I=1 TO 2499 | ||
+ | 30 A=TAN(ATN(EXP(LOG(SQR(A*A)))))+1 | ||
+ | 40 NEXT I | ||
+ | 50 PRINT A | ||
+ | </ | ||
+ | Upon first examination, | ||
+ | |||
+ | **Similar benchmarks** \\ | ||
+ | A lot of similar benchmarks have been made about the accuracy, but if they test different operations, can't be stricly compared. It seems that the Savage benchmark is quite popular, so we focus on this. (If you know similar benchmarks, report them in other wiki pages!) | ||
+ | |||
+ | **About the accuracy** \\ | ||
+ | [[http:// | ||
+ | |||
+ | More on accuracy: (from a discussion on MoHPC' | ||
+ | > I really really dislike that version of the Savage Benchmark: | ||
+ | > ... | ||
+ | > 2. It first squares the number, then takes the square root. That's a little cheesy, because if every other result were perfect the " | ||
+ | >> I disagree. Because if you do 2*2 and the square root, you have a chance to get 2. If you do square root of 2 first you have no chances to get 2, due to the fact that sqrt(2) is irrational and the calculators has a limited memory. But even you can't get 2 back if you do computations numerically, | ||
+ | |||
+ | **What do we check?** \\ | ||
+ | Both times of execution and accuracy (the result should be: 2500) in terms of absolute error |result-n| (done at maximum precision, i'm computing it with powertoycalc for windows with 512 bit of precision). **Note**: maybe the calculator is more accurate that what it shows! Check in any way the entire register of the result! | ||
+ | |||
+ | **How to report the results** \\ | ||
+ | < | ||
+ | A result is composed by the following list | ||
+ | - the device used plus the language used, eventual overclock, eventual custom firmware and so on. | ||
+ | - the number of digits used by the device [optional] | ||
+ | - time elapsed for a given n in seconds (see below). NOTE: with same accuracy the faster speed is preferred in the accuracy section and a result with the time is preferred to one without it. | ||
+ | - the result printed [optional] | ||
+ | - the code used. | ||
+ | </ | ||
+ | |||
+ | ===== Speed section within an error of 1 (2499) ===== | ||
+ | |||
+ | ==== Physical calculators ==== | ||
+ | - Casio FX-9860GSD SDK C | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 0.42 secs @29mhz | ||
+ | * Result: ? | ||
+ | * Absolute error: assuming less than 1 | ||
+ | * Code: ? | ||
+ | - HP 50g, 2.15, HPGCC | ||
+ | * Source: [[https:// | ||
+ | * ? digits | ||
+ | * Time: around 0.5 secs @75mhz | ||
+ | * Result: 2500 | ||
+ | * Absolute error: 0 | ||
+ | * Code: ((<code c> | ||
+ | Just out of curiosity, I ran the same benchmark with HPGCC double: | ||
+ | int main() | ||
+ | { | ||
+ | double f; | ||
+ | |||
+ | f=1.0; | ||
+ | while(f< | ||
+ | { | ||
+ | f=sqrt(f); | ||
+ | f=f*f; | ||
+ | f=log(f); | ||
+ | f=exp(f); | ||
+ | f=atan(f); | ||
+ | f=tan(f); | ||
+ | f+=1.0; | ||
+ | } | ||
+ | |||
+ | sat_push_real(f); | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | - HP Prime | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: 0.48 s | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.135300e-4 | ||
+ | * Code: ((<code modula2> | ||
+ | EXPORT SAVAGE() | ||
+ | BEGIN | ||
+ | A:=1; | ||
+ | FOR I FROM 1 TO 2499 DO | ||
+ | A: | ||
+ | END; | ||
+ | END; | ||
+ | </ | ||
+ | - HP 39gII | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: 3.6 s | ||
+ | * Result: 2499.99946106 | ||
+ | * Absolute error: 5.3894 e-4 | ||
+ | * Code: < | ||
+ | EXPORT SAVAGE() | ||
+ | BEGIN | ||
+ | A:=0 | ||
+ | FOR I FROM 1 TO 2500 DO | ||
+ | | ||
+ | END: | ||
+ | END; </ | ||
+ | - HP 30b | ||
+ | * Source: [[http:// | ||
+ | * Note: This is the version which starts at 1, and runs the transcendental functions 2499 times, adding 1 after each iteration. | ||
+ | * ? digits | ||
+ | * Time: around 7.5 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.135300e-4 | ||
+ | * Code: ((< | ||
+ | 00 - SH* @ assign to shift-multiply button | ||
+ | 01 - 2 | ||
+ | 02 - 4 | ||
+ | 03 - 9 | ||
+ | 04 - 9 | ||
+ | 05 - STO 0 | ||
+ | 06 - 1 | ||
+ | 07 - LBL 00 | ||
+ | 08 - X^2 | ||
+ | 09 - [sqrt] | ||
+ | 10 - Ln | ||
+ | 11 - e^X | ||
+ | 12 - Math | ||
+ | 13 - Input | ||
+ | 14 - Down | ||
+ | 15 - Down | ||
+ | 16 - Down | ||
+ | 17 - Input @ ATAN | ||
+ | 18 - Tan | ||
+ | 19 - 1 | ||
+ | 20 - + | ||
+ | 21 - DSE 0 | ||
+ | 22 - Gto 00 | ||
+ | </ | ||
+ | - Casio fx-CG 10 PRIZM, OS version 01.04.3200, Casio-BASIC | ||
+ | * Source: [[http:// | ||
+ | * digits: 9 | ||
+ | * Time: | ||
+ | * 19 s @94.3 | ||
+ | * 33 s @58 mhz | ||
+ | * Result: 2499.999981 | ||
+ | * Absolute error: 1.9 e-5 | ||
+ | * Code: (( < | ||
+ | Rad | ||
+ | Fix 9 | ||
+ | 1->A | ||
+ | For 1->I To 2499 | ||
+ | (tan tan^-1 e^ln sqrt(A*A))+1-> | ||
+ | Next | ||
+ | A | ||
+ | </ | ||
+ | - HP 15c LE | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 48 secs | ||
+ | * Result: 2499.969898 | ||
+ | * Absolute error: 3.0102 e-2 | ||
+ | * Code: ((< | ||
+ | 001 LBL B | ||
+ | 002 STO 0 | ||
+ | 003 RAD | ||
+ | 004 FIX 9 | ||
+ | 005 0 | ||
+ | 006 LBL 0 | ||
+ | 007 1 | ||
+ | 008 + | ||
+ | 009 SQRT | ||
+ | 010 X^2 | ||
+ | 011 LN | ||
+ | 012 e^X | ||
+ | 013 ARCTAN | ||
+ | 014 TAN | ||
+ | 015 DSE 0 | ||
+ | 016 GTO 0 | ||
+ | 017 DEG | ||
+ | 018 RTN | ||
+ | </ | ||
+ | * Source: Message #8 Posted by Tom Grydeland on 17 Sept 2013 on [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 50 secs | ||
+ | * Result: 2499.970322 | ||
+ | * Absolute error: 2.9678 e-2 | ||
+ | * Code: ((< | ||
+ | 43,22,11 @ LBL A | ||
+ | 2 | ||
+ | 4 | ||
+ | 9 | ||
+ | 9 | ||
+ | 44 1 @ STO 1 | ||
+ | 1 | ||
+ | 43,22, 0 @ LBL 0 | ||
+ | 43 11 @ x^2 | ||
+ | 11 @ SQRT | ||
+ | 43 12 @ LN | ||
+ | 12 @ e^x | ||
+ | 43 25 @ ATAN | ||
+ | 25 @ TAN | ||
+ | 1 | ||
+ | 40 @ + | ||
+ | 42, 5, 1 @ DSE 1 | ||
+ | 22 0 @ GTO 0 | ||
+ | 43 32 @ RTN | ||
+ | </ | ||
+ | - HP 50g, 2.15 with HPGCC patch, SATURN ASM | ||
+ | * Source: [[http:// | ||
+ | * 12 digits - that the number is stored in BCD with 3 digits for the exponent (one of them also stores the exponent sign - positive for 0...4, negative for 5...9), 12 digits for the mantissa and 1 separate digit for the mantissa sign (either 0 for positive or 9 for negative) | ||
+ | * Time: 52.5085 s | ||
+ | * Result: 2499.99948647 | ||
+ | * Abs err: 5.1353 e-4 | ||
+ | * Notes: The loop has a 2499 and 0 as parameter (ZERO_DO provides the 0 for me) because the end is always exclusive, not inclusive like with FOR loops in Basic-like languages. So if I want to run it 2499 times, I must write 2499 0 DO (or collapse the 0 DO into ZERO_DO, which is a single command) instead of 2498 0 DO. | ||
+ | * Code: ((< | ||
+ | :: | ||
+ | %1 | ||
+ | 2500 ZERO_DO | ||
+ | DUP %* %SQRT | ||
+ | %LN %EXP | ||
+ | %ATAN %TAN | ||
+ | %1+ | ||
+ | LOOP | ||
+ | ; | ||
+ | </ | ||
+ | * Source: [[http:// | ||
+ | * 15 digits - extended reals have two additional exponent digits and three additional mantissa digits, just like on the HP48. | ||
+ | * Time: 72.7184 s | ||
+ | * Result: 2499.99999106989 @extended reals | ||
+ | * Abs err: 8.93011 e-6 | ||
+ | * Notes: Extended reals with the [double %]ATAN solution posted [[http:// | ||
+ | * Code: ((< | ||
+ | :: | ||
+ | %%1 | ||
+ | 2499 ZERO_DO | ||
+ | DUP %%* %%SQRT | ||
+ | %%LN %%EXP | ||
+ | %%1 SWAPDUP %%* %%1 %%+ %%SQRT %%/ %%ACOSRAD | ||
+ | %%TANRAD | ||
+ | %%1+_ | ||
+ | LOOP | ||
+ | ; | ||
+ | </ | ||
+ | - HP 48gx, SATURN ASM ( screen and keyboard scanning turned off ) | ||
+ | * Source: Usenet message on comp.sys.hp48 by Jonathan Busby [[https:// | ||
+ | * 15 digits | ||
+ | * Time: around 62 secs | ||
+ | * Result: 2499.99998450891 | ||
+ | * Absolute error: -1.549108e-5 | ||
+ | * Code: (( < | ||
+ | And here is the code for your reference ( Jazz syntax ): | ||
+ | |||
+ | CODE | ||
+ | |||
+ | speedup | ||
+ | |||
+ | SQRTF EQU #2B9F3 | ||
+ | LNF EQU #2B698 | ||
+ | EXPF EQU #2B6AA | ||
+ | ATANF EQU #2B6FB | ||
+ | TANF EQU #2B6F2 | ||
+ | GETANGMODE EQU #2AEF6 | ||
+ | PUSH%%LOOP EQU #2A235 | ||
+ | |||
+ | GOSBVL | ||
+ | |||
+ | IF speedup | ||
+ | GOSBVL | ||
+ | INTOFF | ||
+ | ENDIF | ||
+ | |||
+ | A=0 W | ||
+ | B=0 W | ||
+ | P= 14 | ||
+ | B=B+1 P | ||
+ | P= 0 | ||
+ | LC(5) #2498 | ||
+ | R4=C.F | ||
+ | | ||
+ | GOSBVL | ||
+ | |||
+ | SETDEC | ||
+ | |||
+ | - C=B W | ||
+ | D=C W | ||
+ | C=A W | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | | ||
+ | | ||
+ | C=0 W | ||
+ | D=0 W | ||
+ | P= 14 | ||
+ | D=D+1 P | ||
+ | |||
+ | GOSBVL | ||
+ | |||
+ | C=R4.F | ||
+ | C=C-1 A | ||
+ | R4=C.F | ||
+ | GONC - | ||
+ | |||
+ | IF speedup | ||
+ | GOSBVL | ||
+ | INTON | ||
+ | ENDIF | ||
+ | |||
+ | GOVLNG | ||
+ | ENDCODE | ||
+ | </ | ||
+ | - HP 48gx, SATURN ASM ( screen and keyboard scanning turned on ) | ||
+ | * Source: Usenet message on comp.sys.hp48 by Jonathan Busby [[https:// | ||
+ | * 15 digits | ||
+ | * Time: around 70 secs | ||
+ | * Result: 2499.99998450891 | ||
+ | * Absolute error: -1.549108e-5 | ||
+ | * Code: (( < | ||
+ | And here is the code for your reference ( Jazz syntax ): | ||
+ | |||
+ | CODE | ||
+ | |||
+ | speedup | ||
+ | |||
+ | SQRTF EQU #2B9F3 | ||
+ | LNF EQU #2B698 | ||
+ | EXPF EQU #2B6AA | ||
+ | ATANF EQU #2B6FB | ||
+ | TANF EQU #2B6F2 | ||
+ | GETANGMODE EQU #2AEF6 | ||
+ | PUSH%%LOOP EQU #2A235 | ||
+ | |||
+ | GOSBVL | ||
+ | |||
+ | IF speedup | ||
+ | GOSBVL | ||
+ | INTOFF | ||
+ | ENDIF | ||
+ | |||
+ | A=0 W | ||
+ | B=0 W | ||
+ | P= 14 | ||
+ | B=B+1 P | ||
+ | P= 0 | ||
+ | LC(5) #2498 | ||
+ | R4=C.F | ||
+ | | ||
+ | GOSBVL | ||
+ | |||
+ | SETDEC | ||
+ | |||
+ | - C=B W | ||
+ | D=C W | ||
+ | C=A W | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | GOSBVL | ||
+ | | ||
+ | | ||
+ | C=0 W | ||
+ | D=0 W | ||
+ | P= 14 | ||
+ | D=D+1 P | ||
+ | |||
+ | GOSBVL | ||
+ | |||
+ | C=R4.F | ||
+ | C=C-1 A | ||
+ | R4=C.F | ||
+ | GONC - | ||
+ | |||
+ | IF speedup | ||
+ | GOSBVL | ||
+ | INTON | ||
+ | ENDIF | ||
+ | |||
+ | GOVLNG | ||
+ | ENDCODE | ||
+ | </ | ||
+ | - HP 50g, 2.15, userRPL | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 65 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: ((< | ||
+ | @ " | ||
+ | @ 48 series checksum: # ECAh | ||
+ | @ 48 series size: 159 | ||
+ | @ 49 series checksum: # B0C9h | ||
+ | @ 49 series size: 159. | ||
+ | \<< | ||
+ | STD @ Force standard display mode. | ||
+ | RCLF @ Get original flags. | ||
+ | -55. SF @ Force last arguments disabled. | ||
+ | 64. STWS @ Force wordsize. | ||
+ | RAD @ Force radians mode. | ||
+ | MEM DROP @ Force a GC. | ||
+ | TICKS @ Initial system time. | ||
+ | 1. @ Initial value. | ||
+ | 1. 2499. @ Loop start/stop values. | ||
+ | START @ | ||
+ | DUP * @ Square. | ||
+ | \v/ @ Square root command. | ||
+ | LN @ | ||
+ | EXP @ | ||
+ | ATAN @ | ||
+ | TAN @ | ||
+ | 1. + @ | ||
+ | NEXT @ | ||
+ | TICKS @ Ending system time. | ||
+ | ROT @ Move initial time to level 1. | ||
+ | - @ Elapsed time. | ||
+ | B\-> | ||
+ | " | ||
+ | \-> | ||
+ | DUP @ | ||
+ | 8192. / @ Convert ticks to seconds. | ||
+ | 3. RND @ Round to 3 decimal places. | ||
+ | " | ||
+ | \-> | ||
+ | 4. ROLL STOF @ Restore original flags. | ||
+ | \>></ | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 65 secs | ||
+ | * Result: 2499.99946106 | ||
+ | * Absolute error: 5.3894 e-4 | ||
+ | * Code: ((< | ||
+ | << | ||
+ | RAD TICKS | ||
+ | 0. | ||
+ | 1. 2500. START | ||
+ | 1. + sqrt SQ LN EXP ATAN TAN | ||
+ | NEXT | ||
+ | SWAP TICKS SWAP - B->R 8192. / | ||
+ | DEG | ||
+ | 800. 2. BEEP | ||
+ | >> </ | ||
+ | - Ti 92+, TI-ASM (BCD) | ||
+ | * Source: [[https:// | ||
+ | * 14 digits | ||
+ | * Time: around 70 secs | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: ? | ||
+ | - HP 86b | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 82 secs | ||
+ | * Result: 2499.99942403 | ||
+ | * Absolute error: 5.7597 e-4 | ||
+ | * Code: < | ||
+ | 5 RAD | ||
+ | 7 t=TIME | ||
+ | 10 A=1 | ||
+ | 20 FOR I=1 TO 2499 | ||
+ | 30 A=TAN (ATN (EXP (LOG (SQR (A*A)))))+1 | ||
+ | 40 NEXT I | ||
+ | 50 PRINT A | ||
+ | 55 PRINT HMS$ (TIME -t) | ||
+ | 60 END | ||
+ | </ | ||
+ | - HP 49g sysRPL | ||
+ | * Source: [[https:// | ||
+ | * 12 digits | ||
+ | * Time: around 96 secs with sysRpl | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: ((< | ||
+ | %%1 | ||
+ | SWAP | ||
+ | DUP | ||
+ | %%* | ||
+ | %%1 | ||
+ | %%+ | ||
+ | %%SQRT | ||
+ | %%/ | ||
+ | %%ACOSRAD | ||
+ | </ | ||
+ | * Source: [[https:// | ||
+ | * 15 digits | ||
+ | * Time: around 138 secs with sysRpl | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: same as before | ||
+ | - Ti 89T HW4 AMS 3.10 patched with tiosmod+amspatch, | ||
+ | * Source: [[http:// | ||
+ | * 16 digits BCD floats | ||
+ | * Time: around 97 secs | ||
+ | * Result: 2500.000002527092 | ||
+ | * Absolute error: 2.527092 e-9 | ||
+ | * Code: (( <code c> | ||
+ | // savage.c: Savage benchmark | ||
+ | |||
+ | #define MIN_AMS 101 | ||
+ | #define USE_TI89 | ||
+ | #define USE_TI92P | ||
+ | #define USE_V200 | ||
+ | #define USE_TI89T | ||
+ | #define NO_CALC_DETECT | ||
+ | #define OPTIMIZE_ROM_CALLS | ||
+ | #define RETURN_VALUE | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | #define TIMER_START_VAL (100000UL) | ||
+ | |||
+ | /* | ||
+ | 5 RADIANS | ||
+ | 10 A=1 | ||
+ | 20 FOR I=1 TO 2499 | ||
+ | 30 A=TAN(ATN(EXP(LOG(SQR(A*A)))))+1 | ||
+ | 40 NEXT I | ||
+ | 50 PRINT A | ||
+ | */ | ||
+ | |||
+ | void _main(void) { | ||
+ | uint16_t i; | ||
+ | short orig_rate = PRG_getRate(); | ||
+ | unsigned short orig_start = PRG_getStart(); | ||
+ | unsigned long val = 0; | ||
+ | double a = 1; | ||
+ | |||
+ | // Make the system timer an order of magnitude more precise; | ||
+ | // NOTE: this code assumes a HW2+ TI-68k, i.e. anything since 1999. | ||
+ | PRG_setRate(1); | ||
+ | PRG_setStart(0xCE); | ||
+ | |||
+ | // The PRG_getStart() above effectively waited for the interrupt to trigger, so we don't need another wait. | ||
+ | / | ||
+ | while (!OSTimerExpired(USER_TIMER)); | ||
+ | OSFreeTimer(USER_TIMER); | ||
+ | OSRegisterTimer(USER_TIMER, | ||
+ | |||
+ | // Main loop :) | ||
+ | for (i = 1; i < 2500; i++) { | ||
+ | a = tan(atan(exp(log(sqrt(a * a))))) + 1; | ||
+ | } | ||
+ | |||
+ | // Retrieve timer value. | ||
+ | val = TIMER_START_VAL - OSTimerCurVal(USER_TIMER); | ||
+ | OSFreeTimer(USER_TIMER); | ||
+ | |||
+ | // Push arguments onto the RPN stack: clean arguments up, then create a list. | ||
+ | while (GetArgType (top_estack) != END_TAG) { | ||
+ | top_estack = next_expression_index (top_estack); | ||
+ | } | ||
+ | top_estack--; | ||
+ | push_END_TAG(); | ||
+ | push_Float(a); | ||
+ | push_longint(val); | ||
+ | push_LIST_TAG(); | ||
+ | |||
+ | // Restore old system state. | ||
+ | PRG_setRate(orig_rate); | ||
+ | PRG_setStart(orig_start); | ||
+ | } | ||
+ | |||
+ | Compiler options: | ||
+ | tigcc -v -O3 -Wall -W -mpcrel --optimize-code --cut-ranges --reorder-sections --remove-unused --merge-constants -fmerge-all-constants -Wa, | ||
+ | </ | ||
+ | - HP 49g userRPL | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 111 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: See 50g | ||
+ | - Hp 48g | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 118 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: '' | ||
+ | - HP 48gx | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 118 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: See 50g | ||
+ | - HP 48Sx | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 193 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: See 50g | ||
+ | - Ti 92+, ti basic | ||
+ | * Source: [[https:// | ||
+ | * 14 digits | ||
+ | * Time: | ||
+ | * around 210 secs in approx mode | ||
+ | * around 1'400 in exact mode | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: ? | ||
+ | - HP 200 LX | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 210 secs | ||
+ | * Result: 2499.999999998308 | ||
+ | * Absolute error: 1.692 e-9 | ||
+ | * Code: < | ||
+ | 0*L(A, | ||
+ | 0*L(A, | ||
+ | +L(B, | ||
+ | |||
+ | 2499 N and solving for B | ||
+ | </ | ||
+ | - HP 28s | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 251 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: ((< | ||
+ | @ " | ||
+ | @ A 28C must be in HEX mode when this program is entered to ensure | ||
+ | @ that the correct address is supplied to SYSEVAL! | ||
+ | \<< | ||
+ | STD @ | ||
+ | RCLF @ Get original flags. | ||
+ | 31 CF @ Force last arguments disabled. | ||
+ | 64 STWS @ Force wordsize. | ||
+ | RAD @ Force radians mode. | ||
+ | MEM DROP @ Force a GC. | ||
+ | |||
+ | @ Uncomment the binary integer in one of the following 3 lines. | ||
+ | @ #123E @ @ For 28C ROM version 1BB. | ||
+ | @ #1266 @ @ For 28C ROM version 1CC. | ||
+ | @ #11CAh @ @ For 28S ROM version 2BB. | ||
+ | |||
+ | |||
+ | SYSEVAL | ||
+ | 1 @ Initial value. | ||
+ | 1 2499 @ Loop start/stop values. | ||
+ | START @ | ||
+ | DUP * @ Square. | ||
+ | \v/ @ Square root command. | ||
+ | LN @ | ||
+ | EXP @ | ||
+ | ATAN @ | ||
+ | TAN @ | ||
+ | 1 + @ | ||
+ | NEXT @ | ||
+ | |||
+ | |||
+ | @ Uncomment the binary integer in one of the following 3 lines. | ||
+ | @ #123E @ @ For 28C ROM version 1BB. | ||
+ | @ #1266 @ @ For 28C ROM version 1CC. | ||
+ | @ #11CAh @ @ For 28S ROM version 2BB. | ||
+ | |||
+ | |||
+ | SYSEVAL | ||
+ | ROT @ Move initial time to level 1. | ||
+ | - @ Elapsed time. | ||
+ | B\-> | ||
+ | DUP @ | ||
+ | \-> | ||
+ | " | ||
+ | SWAP + @ | ||
+ | SWAP @ | ||
+ | 8192 / @ Convert ticks to seconds. | ||
+ | 3 FIX RND @ Round to 3 decimal places. | ||
+ | \-> | ||
+ | " | ||
+ | SWAP + @ | ||
+ | 4 ROLL STOF @ Restore original flags. | ||
+ | \>> | ||
+ | </ | ||
+ | - HP 27 | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 280 s | ||
+ | * Result: ? | ||
+ | * Absolute error: ? Assuming that it's less than 1 | ||
+ | * Code: ? | ||
+ | - Ti 81, ti basic | ||
+ | * Source: [[https:// | ||
+ | * 14 digits | ||
+ | * Time: 345 s | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: ? | ||
+ | - HP 20s | ||
+ | * Source: [[http:// | ||
+ | * 12 digits | ||
+ | * Time: around 350 s | ||
+ | * Result: 2499.99946106 | ||
+ | * Absolute error: 5.3894 e-4 | ||
+ | * Code: ((< | ||
+ | Example of Algebraic version on HP 20S: (Put 2500 in display and execute B) | ||
+ | |||
+ | LBL B | ||
+ | RAD | ||
+ | STO 0 | ||
+ | 0 | ||
+ | LBL 1 | ||
+ | + | ||
+ | 1 | ||
+ | = | ||
+ | sqrt | ||
+ | X^2 | ||
+ | LN | ||
+ | E^X | ||
+ | ATAN | ||
+ | TAN | ||
+ | STO 1 | ||
+ | 1 | ||
+ | STO-0 | ||
+ | RCL 0 | ||
+ | X=0? | ||
+ | GTO 2 | ||
+ | RCL 1 | ||
+ | GTO 1 | ||
+ | LBL 2 | ||
+ | STO 1 | ||
+ | DEG | ||
+ | RTN | ||
+ | </ | ||
+ | - HP 19BII | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 360 secs | ||
+ | * Result: 2500.00005173 | ||
+ | * Absolute error: 5.173 e-5 | ||
+ | * Code: < | ||
+ | 0*L(A, | ||
+ | 0*L(A, | ||
+ | +L(B, | ||
+ | |||
+ | 2499 N and solving for B | ||
+ | </ | ||
+ | - HP71 Basic | ||
+ | * Source: [[http:// | ||
+ | * 12 digits | ||
+ | * Time: 365 [[http:// | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Note: All the other Saturn based machines, such as the HP48, should get this result also (but maybe they have more digits!) | ||
+ | * < | ||
+ | >RADIANS | ||
+ | >1 T=TIME @ A=0 @ FOR I=1 TO 2500 @ B=SQR(A+1) @ A=TAN(ATAN(EXP(LN(B*B)))) @ NEXT I | ||
+ | >2 DISP A;TIME-T | ||
+ | </ | ||
+ | - HP 32SII | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 390 | ||
+ | * Result: 2499.99946106 | ||
+ | * Absolute error: 5.3894 e-4 | ||
+ | * Code: ? | ||
+ | - HP 28s | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 398 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.1353 e-4 | ||
+ | * Code: see 28s | ||
+ | - HP 32S | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 400 s | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.13530e-4 | ||
+ | * Code: ((< | ||
+ | LBL S @ 015.5 bytes; CHKSUM=C573 | ||
+ | RAD | ||
+ | 2499 | ||
+ | STO U | ||
+ | 1 | ||
+ | LBL U @ 016.5 bytes; CHKSUM=EC87 | ||
+ | x^2 | ||
+ | SQRT | ||
+ | LN | ||
+ | e^x | ||
+ | ATAN | ||
+ | TAN | ||
+ | 1 | ||
+ | + | ||
+ | DSE U | ||
+ | GTO U | ||
+ | </ | ||
+ | - Ti 86, ti basic | ||
+ | * Source: [[https:// | ||
+ | * 14 digits | ||
+ | * Time: around 430 secs | ||
+ | * Result: ? | ||
+ | * Absolute error: ? | ||
+ | * Code: ? | ||
+ | - HP 33s | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: 475 s [[http:// | ||
+ | * Result: 2499.99942403 | ||
+ | * Absolute error: 5.7597 e-4 | ||
+ | * Code: see the note ((< | ||
+ | LBL A | ||
+ | 1 | ||
+ | STO A | ||
+ | STO I | ||
+ | LBL B | ||
+ | RCL A | ||
+ | x^2 | ||
+ | \|x (Square root of x) | ||
+ | LN | ||
+ | e^x | ||
+ | ATAN | ||
+ | TAN | ||
+ | 1 | ||
+ | + | ||
+ | STO A | ||
+ | 1 | ||
+ | STO+ I | ||
+ | RCL I | ||
+ | 2,499 | ||
+ | x>=y? | ||
+ | GTO B | ||
+ | RCL A | ||
+ | RTN | ||
+ | </ | ||
+ | - HP 42s | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 600 secs | ||
+ | * Result: 2499.99946106 | ||
+ | * Absolute error: 5.3894 e-4 | ||
+ | * Code: ((< | ||
+ | 01 LBL " | ||
+ | 02 RAD | ||
+ | 03 0 | ||
+ | 04 LBL 01 | ||
+ | 05 1 | ||
+ | 06 + | ||
+ | 07 SQRT | ||
+ | 08 X^2 | ||
+ | 09 LN | ||
+ | 10 E^X | ||
+ | 11 ATAN | ||
+ | 12 TAN | ||
+ | 13 DSE ST Y | ||
+ | 14 GTO 01 | ||
+ | 15 BEEP | ||
+ | 16 DEG | ||
+ | 17 END | ||
+ | </ | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 600 secs | ||
+ | * Result: 2499.99948647 | ||
+ | * Absolute error: 5.13530e-4 | ||
+ | * Code: ((< | ||
+ | {32-Byte Prgm} | ||
+ | LBL " | ||
+ | RAD | ||
+ | 2499 | ||
+ | 1 | ||
+ | LBL 00 | ||
+ | X^2 | ||
+ | SQRT | ||
+ | LN | ||
+ | EXP | ||
+ | ATAN | ||
+ | TAN | ||
+ | 1 | ||
+ | + | ||
+ | DSE ST Y | ||
+ | GTO 00 | ||
+ | END | ||
+ | </ | ||
+ | - HP 35s | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 630 secs | ||
+ | * Result: 2499.99939863 | ||
+ | * Absolute error: 6.0137 e-4 | ||
+ | * Code: ? | ||
+ | - fx-115ES Plus | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 1'100 secs | ||
+ | * Result: ? | ||
+ | * Absolute error: ? Assuming it is small enough | ||
+ | * Code: ? | ||
+ | - fx-115ES Plus | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 1'250 secs | ||
+ | * Result: ? | ||
+ | * Absolute error: ? Assuming it is small enough | ||
+ | * Code: ? | ||
+ | - HP 41cx | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 2'932 secs | ||
+ | * Result: 2499.970322 | ||
+ | * Absolute error: 2.9678e-2 | ||
+ | * Code: ((< | ||
+ | LBL ' | ||
+ | TIME | ||
+ | RAD | ||
+ | 2499 | ||
+ | 1 | ||
+ | LBL 00 | ||
+ | X^2 | ||
+ | SQRT | ||
+ | LN | ||
+ | E^X | ||
+ | ATAN | ||
+ | TAN | ||
+ | 1 | ||
+ | + | ||
+ | DSE Y | ||
+ | GTO 00 | ||
+ | TIME | ||
+ | R^ | ||
+ | HMS- | ||
+ | BEEP | ||
+ | </ | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 3'300 secs | ||
+ | * Result: 2499.969898 | ||
+ | * Absolute error: 3.0102 e-2 | ||
+ | * Code: ((< | ||
+ | 01 LBL B | ||
+ | 02 RAD | ||
+ | 03 STO I | ||
+ | 04 0 | ||
+ | 05 LBL 1 | ||
+ | 06 1 | ||
+ | 07 + | ||
+ | 08 SQRT | ||
+ | 09 X^2 | ||
+ | 10 LN | ||
+ | 11 e^X | ||
+ | 12 ATAN | ||
+ | 13 TAN | ||
+ | 14 DSE I | ||
+ | 15 GTO 1 | ||
+ | 16 DEG | ||
+ | 17 RTN | ||
+ | </ | ||
+ | - HP 15c | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 5'840 secs | ||
+ | * Result: 2499.969898 | ||
+ | * Absolute error: 3.0102 e-2 | ||
+ | * Code: see 15c le | ||
+ | - HP 67 | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 5'840 s | ||
+ | * Result: 2499.976148 | ||
+ | * Absolute error: 2.3852 e-2 | ||
+ | * Code: ((< | ||
+ | 01 LBL B | ||
+ | 02 RAD | ||
+ | 03 ST I | ||
+ | 04 0 | ||
+ | 05 LBL 1 | ||
+ | 06 1 | ||
+ | 07 + | ||
+ | 08 SQRT | ||
+ | 09 X^2 | ||
+ | 10 LN | ||
+ | 11 e^X | ||
+ | 12 ATAN | ||
+ | 13 TAN | ||
+ | 14 DSZ I | ||
+ | 15 GTO 1 | ||
+ | 16 DEG | ||
+ | 17 RTN | ||
+ | </ | ||
+ | - HP 25 | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 5' | ||
+ | * Result: 2499.079996 | ||
+ | * Absolute error: 9.20004 e-1 | ||
+ | * Code: ((< | ||
+ | 01 RAD | ||
+ | 02 STO 0 | ||
+ | 03 0 | ||
+ | 04 STO 1 | ||
+ | 05 RCL 1 | ||
+ | 06 1 | ||
+ | 07 + | ||
+ | 08 SQRT | ||
+ | 09 X^2 | ||
+ | 10 LN | ||
+ | 11 e^X | ||
+ | 12 ATAN | ||
+ | 13 TAN | ||
+ | 14 STO 1 | ||
+ | 15 RCL 0 | ||
+ | 16 1 | ||
+ | 17 - | ||
+ | 18 STO 0 | ||
+ | 19 X=0? | ||
+ | 20 GTO 22 | ||
+ | 21 GTO 05 | ||
+ | 22 RCL 1 | ||
+ | 23 DEG | ||
+ | 24 GTO 00 | ||
+ | </ | ||
+ | - HP 19c | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 6' | ||
+ | * Result: 2499.976148 | ||
+ | * Absolute error: 2.3852 e-2 | ||
+ | * Code: ? | ||
+ | - HP 34c | ||
+ | * Source: [[http:// | ||
+ | * ? digits | ||
+ | * Time: around 7'530 secs | ||
+ | * Result: 2499.969898 | ||
+ | * Absolute error: 3.0102 e-2 | ||
+ | * Code: ((< | ||
+ | 01 LBL B | ||
+ | 02 RAD | ||
+ | 03 STO I | ||
+ | 04 0 | ||
+ | 05 LBL 1 | ||
+ | 06 1 | ||
+ | 07 + | ||
+ | 08 SQRT | ||
+ | 09 X^2 | ||
+ | 10 LN | ||
+ | 11 e^X | ||
+ | 12 ATAN | ||
+ | 13 TAN | ||
+ | 14 DSE I | ||
+ | 15 GTO 1 | ||
+ | 16 DEG | ||
+ | 17 RTN | ||
+ | </ | ||
+ | - Electronika Mk-61 | ||
+ | * Source: [[http:// | ||
+ | * 8 digits | ||
+ | * Time: around 10'000 secs | ||
+ | * Result: 2269.0879 | ||
+ | * Absolute error: a lot (with 1 e0 as reference), almost disqualified! But it is really old so it's ok. | ||
+ | * Code: ((< | ||
+ | 00 1 | ||
+ | 01 STO 0 | ||
+ | 02 STO 1 | ||
+ | 03 2499 | ||
+ | 07 STO 2 | ||
+ | 08 RCL 2 | ||
+ | 09 RCL 1 | ||
+ | 10 - | ||
+ | 11 x!=0 29 | ||
+ | 13 RCL 0 | ||
+ | 14 x^2 | ||
+ | 15 SQRT | ||
+ | 16 LN | ||
+ | 17 e^x | ||
+ | 18 ATAN | ||
+ | 19 TAN | ||
+ | 20 1 | ||
+ | 21 + | ||
+ | 22 STO 0 | ||
+ | 23 RCL 1 | ||
+ | 24 1 | ||
+ | 25 + | ||
+ | 26 STO 1 | ||
+ | 27 GTO 08 | ||
+ | 29 R/S | ||
+ | </ | ||
+ | | ||
+ | ==== Emulators on mobile/ | ||
+ | |||
+ | ===== Accuracy ===== | ||
+ | See [[benchmarks: |