Expression Evaluator

From MFSP Wiki

Jump to: navigation, search

The MFSP Expression Evaluator will be a powerful and fast calculator written entirely in PHP. After finding the Google Calculator insufficient for some of my needs, I am creating the MFSP Expression Evaluator. It will be able to handle things like

<math>5^{1000}</math>

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))
666^666
sin(cos(tan(sec(csc(cot(x))))))

and maybe even

2^1000000

Several by-products of this project have already popped up: the Fibonacci Calculator, and the soon-to-come Factorial/Power Evaluator. The following are all the commands that the MFSP Expression Evaluator is/will be/hopefully be able to handle:

Current Features/Features in Development:

x + y      ---  Addition
x - y      ---  Subtraction
x * y      ---  Multiplication
x / y      ---  Division
x % y      ---  Modular Division
x!         ---  x Factorial
x$         ---  x Primorial
x ^ y      ---  Exponentiation (Including stuff like x^(1/pi))
p-> x <-   ---  Primality Test ("Is x prime?")
pf-> x <-  ---  Perfection Test ("Is x perfect?")
f(n)       ---  nth Fibonacci number (Up to f(50000))
l(n)       ---  nth Lucas number (Up to l(50000))
sqrt(x)    ---  Square Root
sin(x)     ---  Sine of x
cos(x)     ---  Cosine of x
tan(x)     ---  Tangent of x
sec(x)     ---  Secant of x
csc(x)     ---  Cosecant of x
cot(x)     ---  Cotangent of x  
sinh(x)    ---  Hyperbolic Sine of x
cosh(x)    ---  Hyperbolic Cosine of x
tanh(x)    ---  Hyperbolic Tangent of x
sech(x)    ---  Hyperbolic Secant of x
csch(x)    ---  Hyperbolic Cosecant of x
coth(x)    ---  Hyperbolic Cotangent of x  
pi         ---  The number pi, ~3.1415926...
e          ---  The number e, ~2.7182818...
phi        ---  The number phi, ~1.618033...
(x)        ---  Parentheses handling

Planned/Hopeful Features:

log[x](y)  ---  The log of y, base x. (log(y) is by default base 10)
ln(x)      ---  The natural logarithm of x
sci-> x <- ---  Display number in scientific notation
z(x)       ---  The Riemann Zeta function of x
i          ---  The square root of -1

A beta test of the Expression Evaluator should begin in less than a month. The limits of the calculator's most basic arithmetic operation should only start to occur somewhere around 10300,000, and the calculator will display numbers in full unless you use the command 'sci-> x <-'. One will also be able to select a precision of within 10-5,000 of the number's value (5,000 decimal places).

Personal tools