
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* t_1 t_3))
(t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_7 (- t_3 3.0)))
(if (<=
(+
x1
(+
(+ x1 (+ (+ (* t_2 (+ (* (* (* x1 2.0) t_3) t_7) t_5)) t_4) t_0))
t_6))
INFINITY)
(+
x1
(+
t_6
(+
x1
(+
t_0
(+
t_4
(*
t_2
(+
t_5
(*
t_7
(*
(* x1 2.0)
(*
(fma 3.0 (pow x1 2.0) (- (* 2.0 x2) x1))
(/ 1.0 (fma x1 x1 1.0))))))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_1 * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_6 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_7 = t_3 - 3.0;
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * t_7) + t_5)) + t_4) + t_0)) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (t_7 * ((x1 * 2.0) * (fma(3.0, pow(x1, 2.0), ((2.0 * x2) - x1)) * (1.0 / fma(x1, x1, 1.0)))))))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_1 * t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_7 = Float64(t_3 - 3.0) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * t_7) + t_5)) + t_4) + t_0)) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_2 * Float64(t_5 + Float64(t_7 * Float64(Float64(x1 * 2.0) * Float64(fma(3.0, (x1 ^ 2.0), Float64(Float64(2.0 * x2) - x1)) * Float64(1.0 / fma(x1, x1, 1.0)))))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 - 3.0), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$7), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$2 * N[(t$95$5 + N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_1 \cdot t_3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
t_6 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_7 := t_3 - 3\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot t_7 + t_5\right) + t_4\right) + t_0\right)\right) + t_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_4 + t_2 \cdot \left(t_5 + t_7 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2 - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.5%
associate--l+99.5%
associate-*r*99.5%
fma-udef99.5%
fma-def99.5%
div-inv99.6%
pow299.6%
Applied egg-rr99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.5e+102) (not (<= x1 1e+92)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 1e+92)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5.5d+102)) .or. (.not. (x1 <= 1d+92))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 1e+92)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5.5e+102) or not (x1 <= 1e+92): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.5e+102) || !(x1 <= 1e+92)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.5e+102) || ~((x1 <= 1e+92))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.5e+102], N[Not[LessEqual[x1, 1e+92]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102} \lor \neg \left(x1 \leq 10^{+92}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102 or 1e92 < x1 Initial program 14.6%
Taylor expanded in x1 around 0 12.5%
Taylor expanded in x1 around inf 12.5%
Taylor expanded in x1 around inf 99.0%
if -5.49999999999999981e102 < x1 < 1e92Initial program 99.5%
Taylor expanded in x1 around 0 98.7%
mul-1-neg56.4%
unsub-neg56.4%
*-commutative56.4%
Simplified98.7%
Taylor expanded in x1 around inf 99.2%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.6e+102) (not (<= x1 1.35e+154)))
(+ x1 (* (pow x1 2.0) (* x2 14.0)))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.6e+102) || !(x1 <= 1.35e+154)) {
tmp = x1 + (pow(x1, 2.0) * (x2 * 14.0));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5.6d+102)) .or. (.not. (x1 <= 1.35d+154))) then
tmp = x1 + ((x1 ** 2.0d0) * (x2 * 14.0d0))
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.6e+102) || !(x1 <= 1.35e+154)) {
tmp = x1 + (Math.pow(x1, 2.0) * (x2 * 14.0));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5.6e+102) or not (x1 <= 1.35e+154): tmp = x1 + (math.pow(x1, 2.0) * (x2 * 14.0)) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.6e+102) || !(x1 <= 1.35e+154)) tmp = Float64(x1 + Float64((x1 ^ 2.0) * Float64(x2 * 14.0))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.6e+102) || ~((x1 <= 1.35e+154))) tmp = x1 + ((x1 ^ 2.0) * (x2 * 14.0)); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.6e+102], N[Not[LessEqual[x1, 1.35e+154]], $MachinePrecision]], N[(x1 + N[(N[Power[x1, 2.0], $MachinePrecision] * N[(x2 * 14.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;x1 + {x1}^{2} \cdot \left(x2 \cdot 14\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 1.35000000000000003e154 < x1 Initial program 1.2%
Taylor expanded in x1 around 0 1.2%
*-commutative1.2%
fma-def1.2%
+-commutative1.2%
mul-1-neg1.2%
unsub-neg1.2%
+-commutative1.2%
unpow31.2%
unpow21.2%
distribute-lft-out1.2%
cancel-sign-sub-inv1.2%
metadata-eval1.2%
+-commutative1.2%
Simplified1.2%
Taylor expanded in x1 around inf 72.3%
Taylor expanded in x2 around inf 44.6%
*-commutative44.6%
associate-*l*44.6%
Simplified44.6%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 98.8%
mul-1-neg53.4%
unsub-neg53.4%
*-commutative53.4%
Simplified98.8%
Taylor expanded in x1 around inf 99.3%
Final simplification81.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* 3.0 (- (* x2 -2.0) x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 3.0 t_3))
(t_5 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_6 (* (* x1 x1) (- (* t_5 4.0) 6.0)))
(t_7 (- t_5 3.0)))
(if (<= x1 -9.5e+101)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 6.8e-6)
(+
x1
(+
t_2
(+
x1
(+
t_1
(+ t_4 (* t_0 (+ t_6 (* t_7 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(if (<= x1 4.9e+151)
(+
x1
(+
(+ x1 (+ t_1 (+ (* t_0 (+ (* (* (* x1 2.0) t_5) t_7) t_6)) t_4)))
(* 3.0 (* x2 -2.0))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * t_3;
double t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double t_7 = t_5 - 3.0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 6.8e-6) {
tmp = x1 + (t_2 + (x1 + (t_1 + (t_4 + (t_0 * (t_6 + (t_7 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + t_4))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = 3.0d0 * t_3
t_5 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_6 = (x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)
t_7 = t_5 - 3.0d0
if (x1 <= (-9.5d+101)) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 6.8d-6) then
tmp = x1 + (t_2 + (x1 + (t_1 + (t_4 + (t_0 * (t_6 + (t_7 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else if (x1 <= 4.9d+151) then
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((((x1 * 2.0d0) * t_5) * t_7) + t_6)) + t_4))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * t_3;
double t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double t_7 = t_5 - 3.0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 6.8e-6) {
tmp = x1 + (t_2 + (x1 + (t_1 + (t_4 + (t_0 * (t_6 + (t_7 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + t_4))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = 3.0 * ((x2 * -2.0) - x1) t_3 = x1 * (x1 * 3.0) t_4 = 3.0 * t_3 t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0) t_7 = t_5 - 3.0 tmp = 0 if x1 <= -9.5e+101: tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 6.8e-6: tmp = x1 + (t_2 + (x1 + (t_1 + (t_4 + (t_0 * (t_6 + (t_7 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) elif x1 <= 4.9e+151: tmp = x1 + ((x1 + (t_1 + ((t_0 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + t_4))) + (3.0 * (x2 * -2.0))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(3.0 * t_3) t_5 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) t_7 = Float64(t_5 - 3.0) tmp = 0.0 if (x1 <= -9.5e+101) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 6.8e-6) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_1 + Float64(t_4 + Float64(t_0 * Float64(t_6 + Float64(t_7 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); elseif (x1 <= 4.9e+151) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_7) + t_6)) + t_4))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = 3.0 * ((x2 * -2.0) - x1); t_3 = x1 * (x1 * 3.0); t_4 = 3.0 * t_3; t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0); t_7 = t_5 - 3.0; tmp = 0.0; if (x1 <= -9.5e+101) tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 6.8e-6) tmp = x1 + (t_2 + (x1 + (t_1 + (t_4 + (t_0 * (t_6 + (t_7 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); elseif (x1 <= 4.9e+151) tmp = x1 + ((x1 + (t_1 + ((t_0 * ((((x1 * 2.0) * t_5) * t_7) + t_6)) + t_4))) + (3.0 * (x2 * -2.0))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$5 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -9.5e+101], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.8e-6], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$1 + N[(t$95$4 + N[(t$95$0 * N[(t$95$6 + N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$7), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 \cdot t_3\\
t_5 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\\
t_7 := t_5 - 3\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_1 + \left(t_4 + t_0 \cdot \left(t_6 + t_7 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_1 + \left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot t_7 + t_6\right) + t_4\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.49999999999999947e101Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 6.2%
associate-*r*6.2%
*-commutative6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in x1 around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -9.49999999999999947e101 < x1 < 6.80000000000000012e-6Initial program 99.5%
Taylor expanded in x1 around 0 98.6%
mul-1-neg62.0%
unsub-neg62.0%
*-commutative62.0%
Simplified98.6%
Taylor expanded in x1 around inf 99.2%
Taylor expanded in x1 around 0 97.7%
+-commutative97.7%
mul-1-neg97.7%
sub-neg97.7%
Simplified97.7%
if 6.80000000000000012e-6 < x1 < 4.8999999999999999e151Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification76.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 4.9e+151)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* 3.0 t_1))))
t_0))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + t_0);
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 4.9d+151) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))) + t_0)
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + t_0);
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x2 * -2.0) - x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 4.9e+151: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + t_0) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 4.9e+151) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))) + t_0)); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((x2 * -2.0) - x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 4.9e+151) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + t_0); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + 3 \cdot t_1\right)\right)\right) + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.0%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 4.4%
associate-*r*4.4%
*-commutative4.4%
*-commutative4.4%
Simplified4.4%
Taylor expanded in x1 around 0 25.0%
mul-1-neg25.0%
unsub-neg25.0%
*-commutative25.0%
Simplified25.0%
if -5.60000000000000037e102 < x1 < 4.8999999999999999e151Initial program 99.5%
Taylor expanded in x1 around 0 98.8%
mul-1-neg53.1%
unsub-neg53.1%
*-commutative53.1%
Simplified98.8%
Taylor expanded in x1 around inf 99.3%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification77.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -9.5e+101)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 4.9e+151)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-9.5d+101)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 4.9d+151) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -9.5e+101: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 4.9e+151: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -9.5e+101) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 4.9e+151) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -9.5e+101) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 4.9e+151) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -9.5e+101], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.49999999999999947e101Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 6.2%
associate-*r*6.2%
*-commutative6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in x1 around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -9.49999999999999947e101 < x1 < 4.8999999999999999e151Initial program 99.5%
Taylor expanded in x1 around inf 98.8%
Taylor expanded in x1 around inf 95.0%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification74.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (- (* x2 -2.0) x1)))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -9.5e+101)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 4.9e+151)
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (- t_3 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-9.5d+101)) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 4.9d+151) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * ((x2 * -2.0) - x1) t_3 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -9.5e+101: tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 4.9e+151: tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -9.5e+101) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 4.9e+151) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * ((x2 * -2.0) - x1); t_3 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -9.5e+101) tmp = x1 + (t_2 + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 4.9e+151) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -9.5e+101], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + \left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.49999999999999947e101Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 6.2%
associate-*r*6.2%
*-commutative6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in x1 around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -9.49999999999999947e101 < x1 < 4.8999999999999999e151Initial program 99.5%
Taylor expanded in x1 around 0 98.8%
mul-1-neg52.9%
unsub-neg52.9%
*-commutative52.9%
Simplified98.8%
Taylor expanded in x1 around inf 99.2%
Taylor expanded in x1 around 0 95.0%
+-commutative95.0%
mul-1-neg95.0%
sub-neg95.0%
Simplified95.0%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification74.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (- (* x2 -2.0) x1)))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -9.5e+101)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 4.9e+151)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* (* (* x1 2.0) t_4) t_0))))))))
(* x1 (+ 2.0 (* 4.0 (* x2 t_0))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * ((x2 * -2.0) - x1);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * t_0)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-9.5d+101)) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 4.9d+151) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + (t_1 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_4) * t_0)))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * ((x2 * -2.0) - x1);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 4.9e+151) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * t_0)))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * ((x2 * -2.0) - x1) t_4 = ((t_2 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -9.5e+101: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 4.9e+151: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * t_0))))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -9.5e+101) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 4.9e+151) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_4) * t_0)))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * ((x2 * -2.0) - x1); t_4 = ((t_2 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -9.5e+101) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 4.9e+151) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * t_0))))))); else tmp = x1 * (2.0 + (4.0 * (x2 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -9.5e+101], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot t_0\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot t_0\right)\right)\\
\end{array}
\end{array}
if x1 < -9.49999999999999947e101Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 6.2%
associate-*r*6.2%
*-commutative6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in x1 around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -9.49999999999999947e101 < x1 < 4.8999999999999999e151Initial program 99.5%
Taylor expanded in x1 around 0 98.8%
mul-1-neg52.9%
unsub-neg52.9%
*-commutative52.9%
Simplified98.8%
Taylor expanded in x1 around inf 99.2%
Taylor expanded in x1 around 0 92.7%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification73.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))
(t_3
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
(* 12.0 (/ x2 x1)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 -68.0)
t_3
(if (<= x1 11000.0)
(+
x1
(+
t_2
(+ x1 (* 4.0 (+ (* (* 2.0 x2) (* x1 x2)) (* -3.0 (* x1 x2)))))))
(if (<= x1 4.9e+151)
t_3
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= -68.0) {
tmp = t_3;
} else if (x1 <= 11000.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 4.9e+151) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (12.0d0 * (x2 / x1))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= (-68.0d0)) then
tmp = t_3
else if (x1 <= 11000.0d0) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (((2.0d0 * x2) * (x1 * x2)) + ((-3.0d0) * (x1 * x2))))))
else if (x1 <= 4.9d+151) then
tmp = t_3
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (12.0 * (x2 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= -68.0) {
tmp = t_3;
} else if (x1 <= 11000.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 4.9e+151) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0) t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (12.0 * (x2 / x1)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= -68.0: tmp = t_3 elif x1 <= 11000.0: tmp = x1 + (t_2 + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))) elif x1 <= 4.9e+151: tmp = t_3 else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) t_3 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(12.0 * Float64(x2 / x1))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= -68.0) tmp = t_3; elseif (x1 <= 11000.0) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(Float64(Float64(2.0 * x2) * Float64(x1 * x2)) + Float64(-3.0 * Float64(x1 * x2))))))); elseif (x1 <= 4.9e+151) tmp = t_3; else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0); t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (12.0 * (x2 / x1)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= -68.0) tmp = t_3; elseif (x1 <= 11000.0) tmp = x1 + (t_2 + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))); elseif (x1 <= 4.9e+151) tmp = t_3; else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(12.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -68.0], t$95$3, If[LessEqual[x1, 11000.0], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], t$95$3, N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -68:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 11000:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.0%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 4.4%
associate-*r*4.4%
*-commutative4.4%
*-commutative4.4%
Simplified4.4%
Taylor expanded in x1 around 0 25.0%
mul-1-neg25.0%
unsub-neg25.0%
*-commutative25.0%
Simplified25.0%
if -5.60000000000000037e102 < x1 < -68 or 11000 < x1 < 4.8999999999999999e151Initial program 99.7%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x2 around inf 97.4%
associate-*r/97.4%
associate-/l*97.5%
+-commutative97.5%
unpow297.5%
fma-udef97.5%
Simplified97.5%
Taylor expanded in x1 around inf 80.9%
if -68 < x1 < 11000Initial program 99.5%
Taylor expanded in x1 around 0 88.7%
associate-*r*99.3%
sub-neg99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Applied egg-rr99.3%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification73.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -9.5e+101)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 -0.0034)
t_3
(if (<= x1 6.8e-6)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (+ (* (* 2.0 x2) (* x1 x2)) (* -3.0 (* x1 x2)))))))
(if (<= x1 4.9e+151)
t_3
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= -0.0034) {
tmp = t_3;
} else if (x1 <= 6.8e-6) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 4.9e+151) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-9.5d+101)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= (-0.0034d0)) then
tmp = t_3
else if (x1 <= 6.8d-6) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (((2.0d0 * x2) * (x1 * x2)) + ((-3.0d0) * (x1 * x2))))))
else if (x1 <= 4.9d+151) then
tmp = t_3
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -9.5e+101) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= -0.0034) {
tmp = t_3;
} else if (x1 <= 6.8e-6) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 4.9e+151) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -9.5e+101: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= -0.0034: tmp = t_3 elif x1 <= 6.8e-6: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))) elif x1 <= 4.9e+151: tmp = t_3 else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -9.5e+101) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= -0.0034) tmp = t_3; elseif (x1 <= 6.8e-6) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(Float64(Float64(2.0 * x2) * Float64(x1 * x2)) + Float64(-3.0 * Float64(x1 * x2))))))); elseif (x1 <= 4.9e+151) tmp = t_3; else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -9.5e+101) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= -0.0034) tmp = t_3; elseif (x1 <= 6.8e-6) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))); elseif (x1 <= 4.9e+151) tmp = t_3; else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9.5e+101], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.0034], t$95$3, If[LessEqual[x1, 6.8e-6], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e+151], t$95$3, N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.0034:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{+151}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.49999999999999947e101Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 6.2%
associate-*r*6.2%
*-commutative6.2%
*-commutative6.2%
Simplified6.2%
Taylor expanded in x1 around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -9.49999999999999947e101 < x1 < -0.00339999999999999981 or 6.80000000000000012e-6 < x1 < 4.8999999999999999e151Initial program 99.7%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around inf 85.2%
Taylor expanded in x1 around inf 85.2%
if -0.00339999999999999981 < x1 < 6.80000000000000012e-6Initial program 99.5%
Taylor expanded in x1 around 0 88.6%
associate-*r*99.3%
sub-neg99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Applied egg-rr99.3%
if 4.8999999999999999e151 < x1 Initial program 3.0%
Taylor expanded in x1 around 0 3.0%
Taylor expanded in x1 around inf 44.1%
Taylor expanded in x1 around inf 44.1%
Final simplification74.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.55e+92)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 1.2e+106)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (+ (* (* 2.0 x2) (* x1 x2)) (* -3.0 (* x1 x2)))))))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.55e+92) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 1.2e+106) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.55d+92)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 1.2d+106) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (((2.0d0 * x2) * (x1 * x2)) + ((-3.0d0) * (x1 * x2))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.55e+92) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 1.2e+106) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.55e+92: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 1.2e+106: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.55e+92) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 1.2e+106) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(Float64(Float64(2.0 * x2) * Float64(x1 * x2)) + Float64(-3.0 * Float64(x1 * x2))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.55e+92) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 1.2e+106) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((2.0 * x2) * (x1 * x2)) + (-3.0 * (x1 * x2)))))); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.55e+92], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.2e+106], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(N[(N[(2.0 * x2), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.55 \cdot 10^{+92}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.2 \cdot 10^{+106}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(\left(2 \cdot x2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5500000000000001e92Initial program 5.7%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x2 around 0 6.1%
associate-*r*6.1%
*-commutative6.1%
*-commutative6.1%
Simplified6.1%
Taylor expanded in x1 around 0 26.0%
mul-1-neg26.0%
unsub-neg26.0%
*-commutative26.0%
Simplified26.0%
if -2.5500000000000001e92 < x1 < 1.2e106Initial program 99.5%
Taylor expanded in x1 around 0 75.7%
associate-*r*83.8%
sub-neg83.8%
distribute-lft-in83.2%
metadata-eval83.2%
Applied egg-rr83.2%
if 1.2e106 < x1 Initial program 23.8%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 37.8%
Taylor expanded in x1 around inf 37.8%
Final simplification63.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -5.2e+97) (and (not (<= x1 -8.6e-251)) (<= x1 8e-237))) (+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* x2 (* x1 -3.0)))))) (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.2e+97) || (!(x1 <= -8.6e-251) && (x1 <= 8e-237))) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-5.2d+97)) .or. (.not. (x1 <= (-8.6d-251))) .and. (x1 <= 8d-237)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.2e+97) || (!(x1 <= -8.6e-251) && (x1 <= 8e-237))) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -5.2e+97) or (not (x1 <= -8.6e-251) and (x1 <= 8e-237)): tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -5.2e+97) || (!(x1 <= -8.6e-251) && (x1 <= 8e-237))) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -5.2e+97) || (~((x1 <= -8.6e-251)) && (x1 <= 8e-237))) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -5.2e+97], And[N[Not[LessEqual[x1, -8.6e-251]], $MachinePrecision], LessEqual[x1, 8e-237]]], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+97} \lor \neg \left(x1 \leq -8.6 \cdot 10^{-251}\right) \land x1 \leq 8 \cdot 10^{-237}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -5.2e97 or -8.6000000000000004e-251 < x1 < 7.9999999999999999e-237Initial program 31.4%
Taylor expanded in x1 around 0 23.5%
Taylor expanded in x2 around 0 32.8%
associate-*r*32.8%
*-commutative32.8%
*-commutative32.8%
Simplified32.8%
Taylor expanded in x1 around 0 47.2%
mul-1-neg47.2%
unsub-neg47.2%
*-commutative47.2%
Simplified47.2%
if -5.2e97 < x1 < -8.6000000000000004e-251 or 7.9999999999999999e-237 < x1 Initial program 82.1%
Taylor expanded in x1 around 0 77.2%
*-commutative77.2%
fma-def77.2%
+-commutative77.2%
mul-1-neg77.2%
unsub-neg77.2%
+-commutative77.2%
unpow377.2%
unpow277.2%
distribute-lft-out77.2%
cancel-sign-sub-inv77.2%
metadata-eval77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in x1 around 0 65.6%
Final simplification60.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.8e+96) (+ 9.0 (+ (* x1 2.0) (* (* x1 x2) -12.0))) (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+96) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.8d+96)) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((x1 * x2) * (-12.0d0)))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+96) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.8e+96: tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+96) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x2) * -12.0))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.8e+96) tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+96], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+96}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -3.8000000000000002e96Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x1 around inf 2.0%
Taylor expanded in x2 around 0 23.9%
if -3.8000000000000002e96 < x1 Initial program 83.9%
Taylor expanded in x1 around 0 79.5%
*-commutative79.5%
fma-def79.5%
+-commutative79.5%
mul-1-neg79.5%
unsub-neg79.5%
+-commutative79.5%
unpow379.5%
unpow279.5%
distribute-lft-out79.5%
cancel-sign-sub-inv79.5%
metadata-eval79.5%
+-commutative79.5%
Simplified79.5%
Taylor expanded in x1 around 0 66.8%
Final simplification58.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.9e+199) (not (<= x2 1.75e+246))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))) (+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.9e+199) || !(x2 <= 1.75e+246)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-2.9d+199)) .or. (.not. (x2 <= 1.75d+246))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.9e+199) || !(x2 <= 1.75e+246)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.9e+199) or not (x2 <= 1.75e+246): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.9e+199) || !(x2 <= 1.75e+246)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.9e+199) || ~((x2 <= 1.75e+246))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.9e+199], N[Not[LessEqual[x2, 1.75e+246]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.9 \cdot 10^{+199} \lor \neg \left(x2 \leq 1.75 \cdot 10^{+246}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x2 < -2.8999999999999999e199 or 1.74999999999999988e246 < x2 Initial program 76.9%
Taylor expanded in x1 around 0 60.6%
Taylor expanded in x1 around inf 70.2%
Taylor expanded in x1 around inf 70.2%
if -2.8999999999999999e199 < x2 < 1.74999999999999988e246Initial program 65.3%
Taylor expanded in x1 around 0 46.0%
Taylor expanded in x2 around 0 42.6%
associate-*r*42.6%
*-commutative42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in x1 around 0 35.7%
*-commutative35.7%
Simplified35.7%
Final simplification42.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.1e+96) (+ 9.0 (+ (* x1 2.0) (* (* x1 x2) -12.0))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.1e+96) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.1d+96)) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((x1 * x2) * (-12.0d0)))
else
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.1e+96) {
tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.1e+96: tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)) else: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.1e+96) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x2) * -12.0))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.1e+96) tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)); else tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.1e+96], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{+96}:\\
\;\;\;\;9 + \left(x1 \cdot 2 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.0999999999999998e96Initial program 3.8%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x1 around inf 2.0%
Taylor expanded in x2 around 0 23.9%
if -3.0999999999999998e96 < x1 Initial program 83.9%
Taylor expanded in x1 around 0 60.9%
Taylor expanded in x1 around inf 30.7%
Taylor expanded in x1 around inf 30.8%
Final simplification29.4%
(FPCore (x1 x2) :precision binary64 (+ 9.0 (+ (* x1 2.0) (* (* x1 x2) -12.0))))
double code(double x1, double x2) {
return 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0 + ((x1 * 2.0d0) + ((x1 * x2) * (-12.0d0)))
end function
public static double code(double x1, double x2) {
return 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0));
}
def code(x1, x2): return 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0))
function code(x1, x2) return Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x2) * -12.0))) end
function tmp = code(x1, x2) tmp = 9.0 + ((x1 * 2.0) + ((x1 * x2) * -12.0)); end
code[x1_, x2_] := N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
9 + \left(x1 \cdot 2 + \left(x1 \cdot x2\right) \cdot -12\right)
\end{array}
Initial program 67.7%
Taylor expanded in x1 around 0 48.9%
Taylor expanded in x1 around inf 24.9%
Taylor expanded in x2 around 0 12.2%
Final simplification12.2%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 67.7%
Taylor expanded in x1 around 0 48.9%
Taylor expanded in x1 around inf 24.9%
Taylor expanded in x1 around 0 3.3%
Final simplification3.3%
herbie shell --seed 2023301
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))