[VA] SRC #013 - Pi Day 2023 Special
|
03-28-2023, 03:10 PM
(This post was last modified: 03-29-2023 02:22 AM by DavidM.)
Post: #29
|
|||
|
|||
RE: [VA] SRC #013 - Pi Day 2023 Special
(03-27-2023 07:46 PM)Valentin Albillo Wrote: Probably something like this may be affecting DavidM's program and the solution might possibly be along the same lines. That was indeed the problem. I've updated the SysRPL code in post #22 to reflect a fix for the issue. Unfortunately there is no built-in SysRPL operator for integer division with real/approximate arguments, so I couldn't use the same approach that Valentin was able to use. I could have opted to refactor the code using ZINTs (exact integers) so as to use the supported integer division operator for those, but that would reduce the performance gains that I was seeking. A simple test showed about a 10% runtime hit going that route. While there's no supported integer division operator that I could tap into, there is a %MOD operator that allowed me to "back into" the integer quotient by subtracting the remainder from N prior to dividing by i^2. Although somewhat convoluted, it works in this situation and only cost about a 2-3% penalty in runtime. I'm still working on documenting the new runtimes, and will update post #22 when I've got the corrected data. Edit: Runtimes have now been updated as well as the program code. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)