I am trying to solve a system of nonlinear functions in java. Particularly I have 3 equations with 3 unknown variables. Although I have managed to solve simple equations, my final goal is to solve some pretty big ones. For example, each equation consists of hundreds of lines (sometimes even thousands) in the form of:
public static double f2 (double x, double y, double z) {
double result = (0.49*Math.exp(-y - x)*Math.pow(x,2)*
(1 - Math.pow(z,94)*(0.00666 +
0.98*Math.exp(-y - x) + 0.98*Math.exp(-y - x)*
y*x + 0.245*Math.exp(-y - x)*Math.pow(y,2)*
Math.pow(x,2) + 0.02722*
Math.exp(-y - x)*Math.pow(y,3)*Math.pow(x,3) +
0.00170*Math.exp(-y - x)*
Math.pow(y,4)*Math.pow(x,4) + 0.00006*
Math.exp(-y - x)*Math.pow(y,5)*Math.pow(x,5) +
1.89043*Math.pow(10,-6)*Math.exp(-y - x)*
Math.pow(y,6)*Math.pow(x,6) + 3.85802*Math.pow(10,-8)*
Math.exp(-y - x)*Math.pow(y,7)*Math.pow(x,7) +
6.02816*Math.pow(10,-10)*Math.exp(-y - x)*
Math.pow(y,8)*Math.pow(x,8) + 7.44217*Math.pow(10,-12)*
Math.exp(-y - x)*Math.pow(y,9)*Math.pow(x,9) +
7.44217*Math.pow(10,-14)*Math.exp(-y - x)*
Math.pow(y,10)*Math.pow(x,10))))/(0.01333 +
0.98*Math.exp(-y - x)*y +
0.49*Math.exp(-y - x)*Math.pow(y,2) +
0.16333*Math.exp(-y - x)*Math.pow(y,3) +
0.04083*Math.exp(-y - x)*Math.pow(y,4) +
0.00816*Math.exp(-y - x)*Math.pow(y,5) + .....
The problem is that two of my classes are significantly larger than 65k, particularly 650k/ class so I am out of limitations.
Is there any way to run/ compile my code, overcoming this limits?
My 3 equations have been generated from another language (wolfram) but I need to implement my goal in java (mathematical/matlab etc is not n option).
This answer suggests using .properties but I cannot see how this can help in my case ("Code too large" compilation error in Java)