Mathematical Tools & More
Posted on Tuesday, Oct 2nd, 2007 at 8:24 PM

Recently, the Fibonacci Calculator was released. This PHP script can calculate the nth Fibonacci number at high speed, for all n below 50,000. This script, in fact, does not use a recursive formula, or even an implementation of Binet's. I've found that scripts based on those two tend to run much more slowly as n grew, whereas a certain loop (the source can be found here) ran far faster. However, this calculator, along with the Primality Tester, are only the beginning. I am currently working on an advanced PHP expression evaluator. It will be able to handle expressions like:
2^10000 10000! 2^(phi+pi^(e-log(2*sin((5*pi)/7)))) sqrt(f(10)^77) (phi^101)/(phi^202 - (-1)^101) phi^(z(pi)) 273^273 sin(cos(tan(sec(csc(cot(x))))))
In addition, it will have a huge array on functions: some to test for primality, for the prime factorization of the number, for the geometric/arithmetic/harmonic/root means, and much more. The code, once the evaluator is finished, will be available for download by anyone interested in seeing the source.
The evaluator should be a highly fast program capable of easily handling numbers around 1030,000, and with varying success after that.