1: never ever write math routines in anything fancy. (let alone Vš
Use C or C++. You don't need all the fancy crapola, just data-in and data-out.
2: write a program that accepts data on the commandline or stdin, and that writes the results to stdout. that way you can receive the output from the program back into PHP using system().
$output=system("math_program -data=1,4,76,8,8,9,5,3,455,4,6");
echo $output;