Fast prime factorisation calculator. Minimum on scripts, maximum on speed and efficiency. Use Turbowarp to speedup factorisation: https://turbowarp.org/414793532?turbo For factorising large numbers, you can get an estimate of the maximum computation time needed(this will be the case if the input number is prime) by means of a benchmark. The benchmark measures the time taken to attempt to factorise the number 497401731493 (which is prime), which equates to calculating ~235,000 divisors. Usage of the benchmarking tool will only be needed for the first time you use this program after visiting this webpage.
Do not enter any number less than 2, or greater than 9007199254740992(floating point limitation, there will be inaccuracies in division for numbers above 2^53). Floating point numbers will be treated as prime. (calculated times in brackets) 2647815347 - Instantaneous (22 ms) 97963175833 - 0.132 sec. (140.9 ms) 566770454443 - 0.792 sec. (0.813 s) 2387335466917 - 1.652 sec. (1.67 s) Divisor/sec. = 304904 Now optimized to 924413/sec. Update: Optimized the algorithm further by fixing a logic error I oversaw that prevented the optimization. The algorithm now only calculates sqrt(x) divisors, instead of x/2. At a rate of 990,000 divisors per second(330,000 calculations/sec.), the program can now calculate the prime factors of any 12-digit number in less than 1 second. In an earlier version the same computation would take ~10^5 seconds, or 1.75 days. Shortly after this optimization, another one was made that increased the rate of checking useful divisors, by ignoring those that are divisible by 2. Surprisingly, instead of a 2x optimization as predicted, the algorithm was ~2.8x faster. However, ignoring divisors that were also divisible by 3 did not speed it up. In fact, the extra computations made to ignore fewer divisors incurred a slight slowdown in its speed. (Update: A very slight increase in speed is now observed, due to bypassing the division operations previously done. The program now uses modulus logic to skip divisors divisible by 2 or 3. Attempts to apply similar logic to ignore divisors also divisible by 5 significantly slowed down the program.) Using Turbowarp will speed up computation by 5 to 10 times. This figure was measured by calculating ~17,430,000 divisors, by attempting to factorise the prime number 2733944327177339. Update: Changed the divisor-checking subroutine to an older version, because that version was found to be faster. The other version of the subroutine, which can be found inside the project, uses an additional counter to alternately skip between 1 and 3 divisors (to ignore divisors divisible by 2 and 3)