Recently, I read that it is the first time that human finds 3 integers x, y and z which make x^3+y^3+z^3=33, where the finding is (8866128975287528)^3+(-8778405442862239)^3+(-2736111468807040)^3 in this March 2019. Till March 2019, we still can't find x, y and z for some numbers, for example, 42, 114, 165, 390, 579
Firstly I think we can make a three-variant-for-loop to find the answer. But obviously it is not a good solution. Maybe GPU can do better than CPU.
Then I think some rules may be used: the end number of x^3 can be used to judge. But the if-else maybe takes more time then for-loop
So, do you have any idea?
but it wasn't meant to compete with hand-optimized C / Fortran / Assembly language.
Sure it was. By design C-like Nim code has no overhead.
but it wasn't meant to compete with hand-optimized C / Fortran / Assembly language.
Sure it was. By design C-like Nim code has no overhead.
I should have just said "hand-optimized Assembly language"...
Well, in any case a trivial implementation will have no chance to succeed whatsoever, Nim, C or Assembly. If you want to replicate the result, you should at the very least use the methods described in the paper https://people.maths.bris.ac.uk/~maarb/papers/cubesv1.pdf Even then, consider the following quote from the paper:
The total computation used approximately 15 core-years over three weeks of real time.
:-)