Can my CAS Savage benchmark be improved? CAS newbie
04-05-2017, 09:51 AM
Post: #4
 StephenG1CMZ Senior Member Posts: 979 Joined: May 2015
RE: Can my CAS savage benchmark be improved? CAS newbie
Here's my latest code, using local variables and L1...
My attempt at using MAKELIST doesn't give the desired result, but the other versions are fine.

Code:
 SAVAGEPPL()  BEGIN   LOCAL AA;   AA:=1;   FOR I FROM 1 TO 2499 DO     AA:=TAN(ATAN(EXP(LN(√(AA*AA)))))+1   END;  END; #CAS SAVAGECAS1(f):=  BEGIN   LOCAL aa;   aa:=1;   FOR I FROM 1 TO 2499 DO     aa:=TAN(ATAN(EXP(LN(√(aa*aa)))))+1   END;   RETURN (aa);  END; #END SAVAGECAS2()  BEGIN   LOCAL aa;   aa:=1;   FOR I FROM 1 TO 2499 DO     aa:=CAS(TAN(ATAN(EXP(LN(√(aa*aa))))))+1;   END;   RETURN aa;  END; SAVAGEML()  BEGIN   L1:={1};      L1:=MAKELIST(CAS(TAN(ATAN(EXP(LN(√(L1(0)*L1(0)))))))+1,I,1,2499);     RETURN L1(0);  END; EXPORT SAVAGE()  BEGIN   LOCAL RR;   PRINT();   PRINT({" PPL1: ",TEVAL(RR:=SAVAGEPPL()),RR});   PRINT({" CAS1: ",TEVAL(RR:=SAVAGECAS1("")),RR});     PRINT({" CAS2: ",TEVAL(RR:=SAVAGECAS2()),RR});   PRINT({"ML1:WRONG: ",TEVAL(RR:=SAVAGEML()),RR});   PRINT("DONE");  //RETURN {TEVAL(RR:=SAVAGED()),RR,TEVAL(RR:=SAVAGEDCAS()),RR};  END;

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
 « Next Oldest | Next Newest »

 Messages In This Thread Can my CAS Savage benchmark be improved? CAS newbie - StephenG1CMZ - 04-03-2017, 02:44 PM RE: Can my CAS savage benchmark be improved? CAS newbie - Han - 04-04-2017, 04:00 AM RE: Can my CAS savage benchmark be improved? CAS newbie - StephenG1CMZ - 04-04-2017, 08:22 PM RE: Can my CAS Savage benchmark be improved? CAS newbie - AlexFekken - 12-04-2017, 08:21 AM RE: Can my CAS savage benchmark be improved? CAS newbie - StephenG1CMZ - 04-05-2017 09:51 AM RE: Can my CAS Savage benchmark be improved? CAS newbie - toml_12953 - 12-04-2017, 08:38 AM RE: Can my CAS savage benchmark be improved? CAS newbie - StephenG1CMZ - 12-04-2017, 07:08 AM RE: Can my CAS Savage benchmark be improved? CAS newbie - StephenG1CMZ - 12-04-2017, 09:32 AM RE: Can my CAS Savage benchmark be improved? CAS newbie - cyrille de brébisson - 12-05-2017, 06:17 AM RE: Can my CAS Savage benchmark be improved? CAS newbie - Han - 12-05-2017, 06:54 PM RE: Can my CAS Savage benchmark be improved? CAS newbie - StephenG1CMZ - 12-05-2017, 11:05 PM

User(s) browsing this thread: 1 Guest(s)