
(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 26 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 (* 3.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_3 (/ (- t_2 x1) (fma x1 x1 1.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_1 (* 2.0 x2)) x1) t_4))
(t_6 (/ (- x1 t_2) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_4
(+
(* (* (* x1 2.0) t_5) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_1 t_5))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_4))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* (* x1 (* 2.0 t_6)) (- t_6 -3.0)))
(fma t_0 t_3 (pow x1 3.0))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_3 = (t_2 - x1) / fma(x1, x1, 1.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double t_6 = (x1 - t_2) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * t_5)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), ((x1 * (2.0 * t_6)) * (t_6 - -3.0))), fma(t_0, t_3, pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / fma(x1, x1, 1.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_4) t_6 = Float64(Float64(x1 - t_2) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_1 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_4)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_6)) * Float64(t_6 - -3.0))), fma(t_0, t_3, (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$2), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$6), $MachinePrecision]), $MachinePrecision] * N[(t$95$6 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_3 := \frac{t\_2 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_4}\\
t_6 := \frac{x1 - t\_2}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_4}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_3, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_6\right)\right) \cdot \left(t\_6 - -3\right)\right), \mathsf{fma}\left(t\_0, t\_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.8%
(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 (* 6.0 (pow x1 4.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 = 6.0 * pow(x1, 4.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 = 6.0 * Math.pow(x1, 4.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 = 6.0 * math.pow(x1, 4.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(6.0 * (x1 ^ 4.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 = 6.0 * (x1 ^ 4.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[(6.0 * N[Power[x1, 4.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}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(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_3 (- -1.0 (* x1 x1)))
(t_4 (/ t_2 t_3)))
(if (or (<= x1 -5.5e+63) (not (<= x1 1.2e+35)))
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (+ 9.0 (* 4.0 (- (* 2.0 x2) 3.0))) x1) 3.0) x1)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(-
(* x1 (* x1 x1))
(-
(* t_0 t_4)
(*
t_3
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_4)))
(* (- (/ t_2 t_1) 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2))))))))))))))
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;
double t_3 = -1.0 - (x1 * x1);
double t_4 = t_2 / t_3;
double tmp;
if ((x1 <= -5.5e+63) || !(x1 <= 1.2e+35)) {
tmp = pow(x1, 4.0) * (6.0 + ((((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1) - 3.0) / x1));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * t_4) - (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((t_2 / t_1) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
}
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 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (t_0 + (2.0d0 * x2)) - x1
t_3 = (-1.0d0) - (x1 * x1)
t_4 = t_2 / t_3
if ((x1 <= (-5.5d+63)) .or. (.not. (x1 <= 1.2d+35))) then
tmp = (x1 ** 4.0d0) * (6.0d0 + ((((9.0d0 + (4.0d0 * ((2.0d0 * x2) - 3.0d0))) / x1) - 3.0d0) / x1))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * t_4) - (t_3 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_4))) + (((t_2 / t_1) - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
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;
double t_3 = -1.0 - (x1 * x1);
double t_4 = t_2 / t_3;
double tmp;
if ((x1 <= -5.5e+63) || !(x1 <= 1.2e+35)) {
tmp = Math.pow(x1, 4.0) * (6.0 + ((((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1) - 3.0) / x1));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * t_4) - (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((t_2 / t_1) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
}
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_3 = -1.0 - (x1 * x1) t_4 = t_2 / t_3 tmp = 0 if (x1 <= -5.5e+63) or not (x1 <= 1.2e+35): tmp = math.pow(x1, 4.0) * (6.0 + ((((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1) - 3.0) / x1)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * t_4) - (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((t_2 / t_1) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) 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(t_0 + Float64(2.0 * x2)) - x1) t_3 = Float64(-1.0 - Float64(x1 * x1)) t_4 = Float64(t_2 / t_3) tmp = 0.0 if ((x1 <= -5.5e+63) || !(x1 <= 1.2e+35)) tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(9.0 + Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0))) / x1) - 3.0) / x1))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_0 * t_4) - Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) + Float64(Float64(Float64(t_2 / t_1) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); 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_3 = -1.0 - (x1 * x1); t_4 = t_2 / t_3; tmp = 0.0; if ((x1 <= -5.5e+63) || ~((x1 <= 1.2e+35))) tmp = (x1 ^ 4.0) * (6.0 + ((((9.0 + (4.0 * ((2.0 * x2) - 3.0))) / x1) - 3.0) / x1)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * t_4) - (t_3 * (((x1 * x1) * (6.0 + (4.0 * t_4))) + (((t_2 / t_1) - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / t$95$3), $MachinePrecision]}, If[Or[LessEqual[x1, -5.5e+63], N[Not[LessEqual[x1, 1.2e+35]], $MachinePrecision]], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(9.0 + N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$0 * t$95$4), $MachinePrecision] - N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$2 / t$95$1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_3 := -1 - x1 \cdot x1\\
t_4 := \frac{t\_2}{t\_3}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+63} \lor \neg \left(x1 \leq 1.2 \cdot 10^{+35}\right):\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{9 + 4 \cdot \left(2 \cdot x2 - 3\right)}{x1} - 3}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_0 \cdot t\_4 - t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right) + \left(\frac{t\_2}{t\_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.50000000000000004e63 or 1.20000000000000007e35 < x1 Initial program 31.6%
Simplified31.6%
Taylor expanded in x1 around -inf 99.9%
if -5.50000000000000004e63 < x1 < 1.20000000000000007e35Initial program 99.5%
Taylor expanded in x1 around 0 96.5%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- x1 (* 2.0 x2)))
(t_1 (* x1 (* x1 x1)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ t_4 t_5))
(t_7 (- t_6 3.0)))
(if (<= x1 -3.5e+66)
(* 6.0 (pow x1 4.0))
(if (<= x1 -3.3e-6)
(+
x1
(+
(+
x1
(+
(+
(*
t_5
(+ (* (* (* x1 2.0) t_6) t_7) (* (* x1 x1) (- (* t_6 4.0) 6.0))))
(* t_3 t_6))
t_1))
9.0))
(if (<= x1 3.9e+102)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_5))
(+
x1
(-
t_1
(-
(* t_3 t_0)
(*
t_2
(+
(* (* x1 x1) (+ 6.0 (* 4.0 (/ t_4 t_2))))
(* t_7 (* (* x1 2.0) t_0)))))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 (+ (* x1 3.0) 9.0)) 2.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 - (2.0 * x2);
double t_1 = x1 * (x1 * x1);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = (x1 * x1) + 1.0;
double t_6 = t_4 / t_5;
double t_7 = t_6 - 3.0;
double tmp;
if (x1 <= -3.5e+66) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= -3.3e-6) {
tmp = x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_3 * t_6)) + t_1)) + 9.0);
} else if (x1 <= 3.9e+102) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_1 - ((t_3 * t_0) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_2)))) + (t_7 * ((x1 * 2.0) * t_0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.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 - (2.0d0 * x2)
t_1 = x1 * (x1 * x1)
t_2 = (-1.0d0) - (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = (x1 * x1) + 1.0d0
t_6 = t_4 / t_5
t_7 = t_6 - 3.0d0
if (x1 <= (-3.5d+66)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= (-3.3d-6)) then
tmp = x1 + ((x1 + (((t_5 * ((((x1 * 2.0d0) * t_6) * t_7) + ((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)))) + (t_3 * t_6)) + t_1)) + 9.0d0)
else if (x1 <= 3.9d+102) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_5)) + (x1 + (t_1 - ((t_3 * t_0) - (t_2 * (((x1 * x1) * (6.0d0 + (4.0d0 * (t_4 / t_2)))) + (t_7 * ((x1 * 2.0d0) * t_0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + 9.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 - (2.0 * x2);
double t_1 = x1 * (x1 * x1);
double t_2 = -1.0 - (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = (x1 * x1) + 1.0;
double t_6 = t_4 / t_5;
double t_7 = t_6 - 3.0;
double tmp;
if (x1 <= -3.5e+66) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= -3.3e-6) {
tmp = x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_3 * t_6)) + t_1)) + 9.0);
} else if (x1 <= 3.9e+102) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_1 - ((t_3 * t_0) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_2)))) + (t_7 * ((x1 * 2.0) * t_0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 - (2.0 * x2) t_1 = x1 * (x1 * x1) t_2 = -1.0 - (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = (x1 * x1) + 1.0 t_6 = t_4 / t_5 t_7 = t_6 - 3.0 tmp = 0 if x1 <= -3.5e+66: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= -3.3e-6: tmp = x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_3 * t_6)) + t_1)) + 9.0) elif x1 <= 3.9e+102: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_1 - ((t_3 * t_0) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_2)))) + (t_7 * ((x1 * 2.0) * t_0)))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 - Float64(2.0 * x2)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(t_4 / t_5) t_7 = Float64(t_6 - 3.0) tmp = 0.0 if (x1 <= -3.5e+66) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= -3.3e-6) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_5 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * t_7) + Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)))) + Float64(t_3 * t_6)) + t_1)) + 9.0)); elseif (x1 <= 3.9e+102) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_5)) + Float64(x1 + Float64(t_1 - Float64(Float64(t_3 * t_0) - Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(t_4 / t_2)))) + Float64(t_7 * Float64(Float64(x1 * 2.0) * t_0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 - (2.0 * x2); t_1 = x1 * (x1 * x1); t_2 = -1.0 - (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = (x1 * x1) + 1.0; t_6 = t_4 / t_5; t_7 = t_6 - 3.0; tmp = 0.0; if (x1 <= -3.5e+66) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= -3.3e-6) tmp = x1 + ((x1 + (((t_5 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_3 * t_6)) + t_1)) + 9.0); elseif (x1 <= 3.9e+102) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (t_1 - ((t_3 * t_0) - (t_2 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_2)))) + (t_7 * ((x1 * 2.0) * t_0)))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -3.5e+66], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.3e-6], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$5 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * t$95$7), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 - N[(N[(t$95$3 * t$95$0), $MachinePrecision] - N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(t$95$4 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 - 2 \cdot x2\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{t\_4}{t\_5}\\
t_7 := t\_6 - 3\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+66}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq -3.3 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot t\_7 + \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right) + t\_3 \cdot t\_6\right) + t\_1\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_5} + \left(x1 + \left(t\_1 - \left(t\_3 \cdot t\_0 - t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_4}{t\_2}\right) + t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot t\_0\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -3.4999999999999997e66Initial program 10.0%
Simplified9.9%
Taylor expanded in x1 around inf 100.0%
if -3.4999999999999997e66 < x1 < -3.30000000000000017e-6Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
if -3.30000000000000017e-6 < x1 < 3.8999999999999998e102Initial program 99.4%
Taylor expanded in x1 around 0 98.9%
Taylor expanded in x1 around 0 98.9%
if 3.8999999999999998e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -4.1e+15) (not (<= x1 4.7e+33)))
(* 6.0 (pow x1 4.0))
(-
x1
(-
(+
(* x1 (- 2.0 (* x1 (+ (* x1 3.0) 9.0))))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.1e+15) || !(x1 <= 4.7e+33)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 - (((x1 * (2.0 - (x1 * ((x1 * 3.0) + 9.0)))) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (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 <= (-4.1d+15)) .or. (.not. (x1 <= 4.7d+33))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 - (((x1 * (2.0d0 - (x1 * ((x1 * 3.0d0) + 9.0d0)))) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.1e+15) || !(x1 <= 4.7e+33)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 - (((x1 * (2.0 - (x1 * ((x1 * 3.0) + 9.0)))) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.1e+15) or not (x1 <= 4.7e+33): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 - (((x1 * (2.0 - (x1 * ((x1 * 3.0) + 9.0)))) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.1e+15) || !(x1 <= 4.7e+33)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)))) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.1e+15) || ~((x1 <= 4.7e+33))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 - (((x1 * (2.0 - (x1 * ((x1 * 3.0) + 9.0)))) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.1e+15], N[Not[LessEqual[x1, 4.7e+33]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 - N[(N[(N[(x1 * N[(2.0 - N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+15} \lor \neg \left(x1 \leq 4.7 \cdot 10^{+33}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - x1 \cdot \left(x1 \cdot 3 + 9\right)\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -4.1e15 or 4.6999999999999998e33 < x1 Initial program 38.3%
Simplified38.3%
Taylor expanded in x1 around inf 94.4%
if -4.1e15 < x1 < 4.6999999999999998e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
Final simplification95.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- x1 (* 2.0 x2)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (- (+ t_2 (* 2.0 x2)) x1)))
(if (<= x1 -5.6e+63)
(* 6.0 (pow x1 4.0))
(if (<= x1 3.9e+102)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))
(+
x1
(-
(* x1 (* x1 x1))
(-
(* t_2 t_0)
(*
t_1
(+
(* (* x1 x1) (+ 6.0 (* 4.0 (/ t_4 t_1))))
(* (- (/ t_4 t_3) 3.0) (* (* x1 2.0) t_0)))))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 (+ (* x1 3.0) 9.0)) 2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 - (2.0 * x2);
double t_1 = -1.0 - (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (t_2 + (2.0 * x2)) - x1;
double tmp;
if (x1 <= -5.6e+63) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 3.9e+102) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_0) - (t_1 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_1)))) + (((t_4 / t_3) - 3.0) * ((x1 * 2.0) * t_0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.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 = x1 - (2.0d0 * x2)
t_1 = (-1.0d0) - (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = (t_2 + (2.0d0 * x2)) - x1
if (x1 <= (-5.6d+63)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= 3.9d+102) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_0) - (t_1 * (((x1 * x1) * (6.0d0 + (4.0d0 * (t_4 / t_1)))) + (((t_4 / t_3) - 3.0d0) * ((x1 * 2.0d0) * t_0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + 9.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 - (2.0 * x2);
double t_1 = -1.0 - (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (t_2 + (2.0 * x2)) - x1;
double tmp;
if (x1 <= -5.6e+63) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= 3.9e+102) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_0) - (t_1 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_1)))) + (((t_4 / t_3) - 3.0) * ((x1 * 2.0) * t_0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 - (2.0 * x2) t_1 = -1.0 - (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = (t_2 + (2.0 * x2)) - x1 tmp = 0 if x1 <= -5.6e+63: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= 3.9e+102: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_0) - (t_1 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_1)))) + (((t_4 / t_3) - 3.0) * ((x1 * 2.0) * t_0)))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 - Float64(2.0 * x2)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) tmp = 0.0 if (x1 <= -5.6e+63) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 3.9e+102) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_2 * t_0) - Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(t_4 / t_1)))) + Float64(Float64(Float64(t_4 / t_3) - 3.0) * Float64(Float64(x1 * 2.0) * t_0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 - (2.0 * x2); t_1 = -1.0 - (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = (t_2 + (2.0 * x2)) - x1; tmp = 0.0; if (x1 <= -5.6e+63) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= 3.9e+102) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_0) - (t_1 * (((x1 * x1) * (6.0 + (4.0 * (t_4 / t_1)))) + (((t_4 / t_3) - 3.0) * ((x1 * 2.0) * t_0)))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+63], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * t$95$0), $MachinePrecision] - N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(t$95$4 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$4 / t$95$3), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 - 2 \cdot x2\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \left(t\_2 + 2 \cdot x2\right) - x1\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+63}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_2 \cdot t\_0 - t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_4}{t\_1}\right) + \left(\frac{t\_4}{t\_3} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_0\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.59999999999999974e63Initial program 11.7%
Simplified11.7%
Taylor expanded in x1 around inf 98.3%
if -5.59999999999999974e63 < x1 < 3.8999999999999998e102Initial program 99.4%
Taylor expanded in x1 around 0 96.8%
Taylor expanded in x1 around 0 95.6%
if 3.8999999999999998e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification96.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_1))
(t_5
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* (- t_4 3.0) (* (* x1 2.0) (* 2.0 x2)))))
(t_6 (* x1 (+ (* x1 3.0) 9.0))))
(if (<= x1 -5.3e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -1.0)
(+ x1 (+ (+ x1 (+ t_2 (+ (* t_3 t_4) (* t_1 t_5)))) t_0))
(if (<= x1 3.3e-9)
(-
x1
(-
(+
(* x1 (- 2.0 t_6))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 3.9e+102)
(-
x1
(-
(- (- (- (* t_5 (- -1.0 (* x1 x1))) (* t_3 (* 2.0 x2))) t_2) x1)
t_0))
(+ x1 (+ (* x2 -6.0) (* x1 (- t_6 2.0))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_5 = ((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * (2.0 * x2)));
double t_6 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -5.3e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.0) {
tmp = x1 + ((x1 + (t_2 + ((t_3 * t_4) + (t_1 * t_5)))) + t_0);
} else if (x1 <= 3.3e-9) {
tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 3.9e+102) {
tmp = x1 - (((((t_5 * (-1.0 - (x1 * x1))) - (t_3 * (2.0 * x2))) - t_2) - x1) - t_0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.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) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_1
t_5 = ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2)))
t_6 = x1 * ((x1 * 3.0d0) + 9.0d0)
if (x1 <= (-5.3d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-1.0d0)) then
tmp = x1 + ((x1 + (t_2 + ((t_3 * t_4) + (t_1 * t_5)))) + t_0)
else if (x1 <= 3.3d-9) then
tmp = x1 - (((x1 * (2.0d0 - t_6)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 3.9d+102) then
tmp = x1 - (((((t_5 * ((-1.0d0) - (x1 * x1))) - (t_3 * (2.0d0 * x2))) - t_2) - x1) - t_0)
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_6 - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_5 = ((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * (2.0 * x2)));
double t_6 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -5.3e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.0) {
tmp = x1 + ((x1 + (t_2 + ((t_3 * t_4) + (t_1 * t_5)))) + t_0);
} else if (x1 <= 3.3e-9) {
tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 3.9e+102) {
tmp = x1 - (((((t_5 * (-1.0 - (x1 * x1))) - (t_3 * (2.0 * x2))) - t_2) - x1) - t_0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1 t_5 = ((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * (2.0 * x2))) t_6 = x1 * ((x1 * 3.0) + 9.0) tmp = 0 if x1 <= -5.3e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -1.0: tmp = x1 + ((x1 + (t_2 + ((t_3 * t_4) + (t_1 * t_5)))) + t_0) elif x1 <= 3.3e-9: tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 3.9e+102: tmp = x1 - (((((t_5 * (-1.0 - (x1 * x1))) - (t_3 * (2.0 * x2))) - t_2) - x1) - t_0) else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_1) t_5 = Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))) t_6 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) tmp = 0.0 if (x1 <= -5.3e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -1.0) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_4) + Float64(t_1 * t_5)))) + t_0)); elseif (x1 <= 3.3e-9) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_6)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 3.9e+102) tmp = Float64(x1 - Float64(Float64(Float64(Float64(Float64(t_5 * Float64(-1.0 - Float64(x1 * x1))) - Float64(t_3 * Float64(2.0 * x2))) - t_2) - x1) - t_0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_6 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1; t_5 = ((x1 * x1) * ((t_4 * 4.0) - 6.0)) + ((t_4 - 3.0) * ((x1 * 2.0) * (2.0 * x2))); t_6 = x1 * ((x1 * 3.0) + 9.0); tmp = 0.0; if (x1 <= -5.3e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -1.0) tmp = x1 + ((x1 + (t_2 + ((t_3 * t_4) + (t_1 * t_5)))) + t_0); elseif (x1 <= 3.3e-9) tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 3.9e+102) tmp = x1 - (((((t_5 * (-1.0 - (x1 * x1))) - (t_3 * (2.0 * x2))) - t_2) - x1) - t_0); else tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.3e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.0], N[(x1 + N[(N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.3e-9], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], N[(x1 - N[(N[(N[(N[(N[(t$95$5 * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - x1), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$6 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right) + \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\\
t_6 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
\mathbf{if}\;x1 \leq -5.3 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -1:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_2 + \left(t\_3 \cdot t\_4 + t\_1 \cdot t\_5\right)\right)\right) + t\_0\right)\\
\mathbf{elif}\;x1 \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_6\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(\left(\left(\left(t\_5 \cdot \left(-1 - x1 \cdot x1\right) - t\_3 \cdot \left(2 \cdot x2\right)\right) - t\_2\right) - x1\right) - t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_6 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.2999999999999997e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5.2999999999999997e102 < x1 < -1Initial program 99.4%
Taylor expanded in x1 around 0 79.9%
Taylor expanded in x1 around 0 79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in x1 around 0 82.0%
*-commutative82.0%
Simplified82.0%
if -1 < x1 < 3.30000000000000018e-9Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 89.3%
associate-*r*99.6%
fmm-def99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around 0 99.6%
if 3.30000000000000018e-9 < x1 < 3.8999999999999998e102Initial program 99.2%
Taylor expanded in x1 around 0 96.5%
Taylor expanded in x1 around 0 96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x1 around 0 96.5%
Taylor expanded in x1 around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 3.8999999999999998e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (/ (- (+ t_0 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(t_2
(-
x1
(-
(-
(-
(-
(*
(+
(* (* x1 x1) (- (* t_1 4.0) 6.0))
(* (- t_1 3.0) (* (* x1 2.0) (* 2.0 x2))))
(- -1.0 (* x1 x1)))
(* t_0 (* 2.0 x2)))
(* x1 (* x1 x1)))
x1)
(* 3.0 (* x2 -2.0)))))
(t_3 (* x1 (+ (* x1 3.0) 9.0))))
(if (<= x1 -2.12e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -1.3)
t_2
(if (<= x1 3.3e-9)
(-
x1
(-
(+
(* x1 (- 2.0 t_3))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 3.9e+102)
t_2
(+ x1 (+ (* x2 -6.0) (* x1 (- t_3 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double t_2 = x1 - ((((((((x1 * x1) * ((t_1 * 4.0) - 6.0)) + ((t_1 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1) - (3.0 * (x2 * -2.0)));
double t_3 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.3) {
tmp = t_2;
} else if (x1 <= 3.3e-9) {
tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 3.9e+102) {
tmp = t_2;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.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 = ((t_0 + (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0)
t_2 = x1 - ((((((((x1 * x1) * ((t_1 * 4.0d0) - 6.0d0)) + ((t_1 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2)))) * ((-1.0d0) - (x1 * x1))) - (t_0 * (2.0d0 * x2))) - (x1 * (x1 * x1))) - x1) - (3.0d0 * (x2 * (-2.0d0))))
t_3 = x1 * ((x1 * 3.0d0) + 9.0d0)
if (x1 <= (-2.12d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-1.3d0)) then
tmp = t_2
else if (x1 <= 3.3d-9) then
tmp = x1 - (((x1 * (2.0d0 - t_3)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 3.9d+102) then
tmp = t_2
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_3 - 2.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 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0);
double t_2 = x1 - ((((((((x1 * x1) * ((t_1 * 4.0) - 6.0)) + ((t_1 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1) - (3.0 * (x2 * -2.0)));
double t_3 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.3) {
tmp = t_2;
} else if (x1 <= 3.3e-9) {
tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 3.9e+102) {
tmp = t_2;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0) t_2 = x1 - ((((((((x1 * x1) * ((t_1 * 4.0) - 6.0)) + ((t_1 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1) - (3.0 * (x2 * -2.0))) t_3 = x1 * ((x1 * 3.0) + 9.0) tmp = 0 if x1 <= -2.12e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -1.3: tmp = t_2 elif x1 <= 3.3e-9: tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 3.9e+102: tmp = t_2 else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0)) t_2 = Float64(x1 - Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_1 * 4.0) - 6.0)) + Float64(Float64(t_1 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))) * Float64(-1.0 - Float64(x1 * x1))) - Float64(t_0 * Float64(2.0 * x2))) - Float64(x1 * Float64(x1 * x1))) - x1) - Float64(3.0 * Float64(x2 * -2.0)))) t_3 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) tmp = 0.0 if (x1 <= -2.12e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -1.3) tmp = t_2; elseif (x1 <= 3.3e-9) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_3)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 3.9e+102) tmp = t_2; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_3 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = ((t_0 + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0); t_2 = x1 - ((((((((x1 * x1) * ((t_1 * 4.0) - 6.0)) + ((t_1 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))) * (-1.0 - (x1 * x1))) - (t_0 * (2.0 * x2))) - (x1 * (x1 * x1))) - x1) - (3.0 * (x2 * -2.0))); t_3 = x1 * ((x1 * 3.0) + 9.0); tmp = 0.0; if (x1 <= -2.12e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -1.3) tmp = t_2; elseif (x1 <= 3.3e-9) tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 3.9e+102) tmp = t_2; else tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.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[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 - N[(N[(N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$1 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] - N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.12e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.3], t$95$2, If[LessEqual[x1, 3.3e-9], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], t$95$2, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$3 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
t_2 := x1 - \left(\left(\left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(t\_1 \cdot 4 - 6\right) + \left(t\_1 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right) - t\_0 \cdot \left(2 \cdot x2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right) - 3 \cdot \left(x2 \cdot -2\right)\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
\mathbf{if}\;x1 \leq -2.12 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -1.3:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_3\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_3 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.12000000000000003e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.12000000000000003e102 < x1 < -1.30000000000000004 or 3.30000000000000018e-9 < x1 < 3.8999999999999998e102Initial program 99.3%
Taylor expanded in x1 around 0 89.2%
Taylor expanded in x1 around 0 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x1 around 0 87.7%
*-commutative91.6%
Simplified87.7%
if -1.30000000000000004 < x1 < 3.30000000000000018e-9Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 89.3%
associate-*r*99.6%
fmm-def99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around 0 99.6%
if 3.8999999999999998e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification97.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (+ (* x1 3.0) 9.0)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (/ t_4 (- -1.0 (* x1 x1))))
(t_6 (/ t_4 t_1))
(t_7 (* x1 (* x1 x1))))
(if (<= x1 -5e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -4.1e+15)
(+
x1
(-
t_0
(-
(-
(+
(* t_3 t_5)
(* t_1 (- (* (* x1 x1) (+ 6.0 (* 4.0 t_5))) (* x1 2.0))))
t_7)
x1)))
(if (<= x1 2.9e+33)
(-
x1
(-
(+
(* x1 (- 2.0 t_2))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 2e+101)
(+
x1
(+
t_0
(+
x1
(+
t_7
(-
(* t_3 (* 2.0 x2))
(*
t_1
(-
(* (- t_6 3.0) (* x1 (* x1 2.0)))
(* (* x1 x1) (- (* t_6 4.0) 6.0)))))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- t_2 2.0))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * ((x1 * 3.0) + 9.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = t_4 / t_1;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_0 - ((((t_3 * t_5) + (t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) - (x1 * 2.0)))) - t_7) - x1));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_2)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 2e+101) {
tmp = x1 + (t_0 + (x1 + (t_7 + ((t_3 * (2.0 * x2)) - (t_1 * (((t_6 - 3.0) * (x1 * (x1 * 2.0))) - ((x1 * x1) * ((t_6 * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_2 - 2.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 = 3.0d0 * (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * ((x1 * 3.0d0) + 9.0d0)
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = t_4 / ((-1.0d0) - (x1 * x1))
t_6 = t_4 / t_1
t_7 = x1 * (x1 * x1)
if (x1 <= (-5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-4.1d+15)) then
tmp = x1 + (t_0 - ((((t_3 * t_5) + (t_1 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_5))) - (x1 * 2.0d0)))) - t_7) - x1))
else if (x1 <= 2.9d+33) then
tmp = x1 - (((x1 * (2.0d0 - t_2)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 2d+101) then
tmp = x1 + (t_0 + (x1 + (t_7 + ((t_3 * (2.0d0 * x2)) - (t_1 * (((t_6 - 3.0d0) * (x1 * (x1 * 2.0d0))) - ((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_2 - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * ((x1 * 3.0) + 9.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = t_4 / t_1;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_0 - ((((t_3 * t_5) + (t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) - (x1 * 2.0)))) - t_7) - x1));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_2)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 2e+101) {
tmp = x1 + (t_0 + (x1 + (t_7 + ((t_3 * (2.0 * x2)) - (t_1 * (((t_6 - 3.0) * (x1 * (x1 * 2.0))) - ((x1 * x1) * ((t_6 * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_2 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * ((x1 * 3.0) + 9.0) t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = t_4 / (-1.0 - (x1 * x1)) t_6 = t_4 / t_1 t_7 = x1 * (x1 * x1) tmp = 0 if x1 <= -5e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -4.1e+15: tmp = x1 + (t_0 - ((((t_3 * t_5) + (t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) - (x1 * 2.0)))) - t_7) - x1)) elif x1 <= 2.9e+33: tmp = x1 - (((x1 * (2.0 - t_2)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 2e+101: tmp = x1 + (t_0 + (x1 + (t_7 + ((t_3 * (2.0 * x2)) - (t_1 * (((t_6 - 3.0) * (x1 * (x1 * 2.0))) - ((x1 * x1) * ((t_6 * 4.0) - 6.0)))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_2 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / Float64(-1.0 - Float64(x1 * x1))) t_6 = Float64(t_4 / t_1) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -4.1e+15) tmp = Float64(x1 + Float64(t_0 - Float64(Float64(Float64(Float64(t_3 * t_5) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) - Float64(x1 * 2.0)))) - t_7) - x1))); elseif (x1 <= 2.9e+33) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_2)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 2e+101) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_7 + Float64(Float64(t_3 * Float64(2.0 * x2)) - Float64(t_1 * Float64(Float64(Float64(t_6 - 3.0) * Float64(x1 * Float64(x1 * 2.0))) - Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_2 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 * ((x1 * 3.0) + 9.0); t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = t_4 / (-1.0 - (x1 * x1)); t_6 = t_4 / t_1; t_7 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -5e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -4.1e+15) tmp = x1 + (t_0 - ((((t_3 * t_5) + (t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) - (x1 * 2.0)))) - t_7) - x1)); elseif (x1 <= 2.9e+33) tmp = x1 - (((x1 * (2.0 - t_2)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 2e+101) tmp = x1 + (t_0 + (x1 + (t_7 + ((t_3 * (2.0 * x2)) - (t_1 * (((t_6 - 3.0) * (x1 * (x1 * 2.0))) - ((x1 * x1) * ((t_6 * 4.0) - 6.0)))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (t_2 - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.1e+15], N[(x1 + N[(t$95$0 - N[(N[(N[(N[(t$95$3 * t$95$5), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+33], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+101], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$7 + N[(N[(t$95$3 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(N[(t$95$6 - 3.0), $MachinePrecision] * N[(x1 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$2 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{-1 - x1 \cdot x1}\\
t_6 := \frac{t\_4}{t\_1}\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -4.1 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_0 - \left(\left(\left(t\_3 \cdot t\_5 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) - x1 \cdot 2\right)\right) - t\_7\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_2\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + \left(t\_7 + \left(t\_3 \cdot \left(2 \cdot x2\right) - t\_1 \cdot \left(\left(t\_6 - 3\right) \cdot \left(x1 \cdot \left(x1 \cdot 2\right)\right) - \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_2 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < -4.1e15Initial program 99.4%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x1 around 0 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x1 around inf 77.1%
*-commutative77.1%
Simplified77.1%
if -4.1e15 < x1 < 2.90000000000000025e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
if 2.90000000000000025e33 < x1 < 2e101Initial program 99.0%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around inf 99.4%
neg-mul-199.4%
Simplified99.4%
if 2e101 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification96.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 3.0) 9.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) (- -1.0 (* x1 x1))))
(t_3
(+
x1
(-
(* 3.0 (* x2 -2.0))
(-
(-
(+
(* t_1 t_2)
(*
(+ (* x1 x1) 1.0)
(- (* (* x1 x1) (+ 6.0 (* 4.0 t_2))) (* x1 2.0))))
(* x1 (* x1 x1)))
x1)))))
(if (<= x1 -5e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -8e+15)
t_3
(if (<= x1 2.9e+33)
(-
x1
(-
(+
(* x1 (- 2.0 t_0))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 5.5e+102)
t_3
(+ x1 (+ (* x2 -6.0) (* x1 (- t_0 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 + ((3.0 * (x2 * -2.0)) - ((((t_1 * t_2) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_2))) - (x1 * 2.0)))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -8e+15) {
tmp = t_3;
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 5.5e+102) {
tmp = t_3;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.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) + 9.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / ((-1.0d0) - (x1 * x1))
t_3 = x1 + ((3.0d0 * (x2 * (-2.0d0))) - ((((t_1 * t_2) + (((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 + (4.0d0 * t_2))) - (x1 * 2.0d0)))) - (x1 * (x1 * x1))) - x1))
if (x1 <= (-5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-8d+15)) then
tmp = t_3
else if (x1 <= 2.9d+33) then
tmp = x1 - (((x1 * (2.0d0 - t_0)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 5.5d+102) then
tmp = t_3
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_0 - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1));
double t_3 = x1 + ((3.0 * (x2 * -2.0)) - ((((t_1 * t_2) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_2))) - (x1 * 2.0)))) - (x1 * (x1 * x1))) - x1));
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -8e+15) {
tmp = t_3;
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 5.5e+102) {
tmp = t_3;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 3.0) + 9.0) t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)) t_3 = x1 + ((3.0 * (x2 * -2.0)) - ((((t_1 * t_2) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_2))) - (x1 * 2.0)))) - (x1 * (x1 * x1))) - x1)) tmp = 0 if x1 <= -5e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -8e+15: tmp = t_3 elif x1 <= 2.9e+33: tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 5.5e+102: tmp = t_3 else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / Float64(-1.0 - Float64(x1 * x1))) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) - Float64(Float64(Float64(Float64(t_1 * t_2) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))) - Float64(x1 * 2.0)))) - Float64(x1 * Float64(x1 * x1))) - x1))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -8e+15) tmp = t_3; elseif (x1 <= 2.9e+33) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_0)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 5.5e+102) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_0 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 3.0) + 9.0); t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / (-1.0 - (x1 * x1)); t_3 = x1 + ((3.0 * (x2 * -2.0)) - ((((t_1 * t_2) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 + (4.0 * t_2))) - (x1 * 2.0)))) - (x1 * (x1 * x1))) - x1)); tmp = 0.0; if (x1 <= -5e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -8e+15) tmp = t_3; elseif (x1 <= 2.9e+33) tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 5.5e+102) tmp = t_3; else tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $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] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8e+15], t$95$3, If[LessEqual[x1, 2.9e+33], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.5e+102], t$95$3, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$0 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{-1 - x1 \cdot x1}\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(\left(\left(t\_1 \cdot t\_2 + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right) - x1 \cdot 2\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -8 \cdot 10^{+15}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_0\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_0 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < -8e15 or 2.90000000000000025e33 < x1 < 5.49999999999999981e102Initial program 99.2%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x1 around 0 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x1 around inf 88.0%
*-commutative88.0%
Simplified88.0%
if -8e15 < x1 < 2.90000000000000025e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
if 5.49999999999999981e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification96.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (+ t_0 (* 2.0 x2)) x1))
(t_2 (* t_0 (* 2.0 x2)))
(t_3 (* x1 (* x1 x1)))
(t_4 (* 3.0 (* x2 -2.0)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (* x1 (+ (* x1 3.0) 9.0))))
(if (<= x1 -2.12e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -4.1e+15)
(+
x1
(+
t_4
(-
x1
(-
(-
(*
t_5
(+
(* (/ -1.0 x1) (* (* x1 2.0) (- x1 (* 2.0 x2))))
(* (* x1 x1) (+ 6.0 (* 4.0 (/ t_1 (- -1.0 (* x1 x1))))))))
t_2)
t_3))))
(if (<= x1 2.9e+33)
(-
x1
(-
(+
(* x1 (- 2.0 t_6))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 5e+102)
(+
x1
(+
t_4
(+
x1
(+
t_3
(+
t_2
(*
t_5
(+ (* x1 2.0) (* (* x1 x1) (- (* (/ t_1 t_5) 4.0) 6.0)))))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- t_6 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = t_0 * (2.0 * x2);
double t_3 = x1 * (x1 * x1);
double t_4 = 3.0 * (x2 * -2.0);
double t_5 = (x1 * x1) + 1.0;
double t_6 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_4 + (x1 - (((t_5 * (((-1.0 / x1) * ((x1 * 2.0) * (x1 - (2.0 * x2)))) + ((x1 * x1) * (6.0 + (4.0 * (t_1 / (-1.0 - (x1 * x1)))))))) - t_2) - t_3)));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 5e+102) {
tmp = x1 + (t_4 + (x1 + (t_3 + (t_2 + (t_5 * ((x1 * 2.0) + ((x1 * x1) * (((t_1 / t_5) * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (t_0 + (2.0d0 * x2)) - x1
t_2 = t_0 * (2.0d0 * x2)
t_3 = x1 * (x1 * x1)
t_4 = 3.0d0 * (x2 * (-2.0d0))
t_5 = (x1 * x1) + 1.0d0
t_6 = x1 * ((x1 * 3.0d0) + 9.0d0)
if (x1 <= (-2.12d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-4.1d+15)) then
tmp = x1 + (t_4 + (x1 - (((t_5 * ((((-1.0d0) / x1) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2)))) + ((x1 * x1) * (6.0d0 + (4.0d0 * (t_1 / ((-1.0d0) - (x1 * x1)))))))) - t_2) - t_3)))
else if (x1 <= 2.9d+33) then
tmp = x1 - (((x1 * (2.0d0 - t_6)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 5d+102) then
tmp = x1 + (t_4 + (x1 + (t_3 + (t_2 + (t_5 * ((x1 * 2.0d0) + ((x1 * x1) * (((t_1 / t_5) * 4.0d0) - 6.0d0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_6 - 2.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 = (t_0 + (2.0 * x2)) - x1;
double t_2 = t_0 * (2.0 * x2);
double t_3 = x1 * (x1 * x1);
double t_4 = 3.0 * (x2 * -2.0);
double t_5 = (x1 * x1) + 1.0;
double t_6 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_4 + (x1 - (((t_5 * (((-1.0 / x1) * ((x1 * 2.0) * (x1 - (2.0 * x2)))) + ((x1 * x1) * (6.0 + (4.0 * (t_1 / (-1.0 - (x1 * x1)))))))) - t_2) - t_3)));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 5e+102) {
tmp = x1 + (t_4 + (x1 + (t_3 + (t_2 + (t_5 * ((x1 * 2.0) + ((x1 * x1) * (((t_1 / t_5) * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (t_0 + (2.0 * x2)) - x1 t_2 = t_0 * (2.0 * x2) t_3 = x1 * (x1 * x1) t_4 = 3.0 * (x2 * -2.0) t_5 = (x1 * x1) + 1.0 t_6 = x1 * ((x1 * 3.0) + 9.0) tmp = 0 if x1 <= -2.12e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -4.1e+15: tmp = x1 + (t_4 + (x1 - (((t_5 * (((-1.0 / x1) * ((x1 * 2.0) * (x1 - (2.0 * x2)))) + ((x1 * x1) * (6.0 + (4.0 * (t_1 / (-1.0 - (x1 * x1)))))))) - t_2) - t_3))) elif x1 <= 2.9e+33: tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 5e+102: tmp = x1 + (t_4 + (x1 + (t_3 + (t_2 + (t_5 * ((x1 * 2.0) + ((x1 * x1) * (((t_1 / t_5) * 4.0) - 6.0)))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) t_2 = Float64(t_0 * Float64(2.0 * x2)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(3.0 * Float64(x2 * -2.0)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) tmp = 0.0 if (x1 <= -2.12e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -4.1e+15) tmp = Float64(x1 + Float64(t_4 + Float64(x1 - Float64(Float64(Float64(t_5 * Float64(Float64(Float64(-1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2)))) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(t_1 / Float64(-1.0 - Float64(x1 * x1)))))))) - t_2) - t_3)))); elseif (x1 <= 2.9e+33) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_6)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 5e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_3 + Float64(t_2 + Float64(t_5 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(Float64(t_1 / t_5) * 4.0) - 6.0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_6 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (t_0 + (2.0 * x2)) - x1; t_2 = t_0 * (2.0 * x2); t_3 = x1 * (x1 * x1); t_4 = 3.0 * (x2 * -2.0); t_5 = (x1 * x1) + 1.0; t_6 = x1 * ((x1 * 3.0) + 9.0); tmp = 0.0; if (x1 <= -2.12e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -4.1e+15) tmp = x1 + (t_4 + (x1 - (((t_5 * (((-1.0 / x1) * ((x1 * 2.0) * (x1 - (2.0 * x2)))) + ((x1 * x1) * (6.0 + (4.0 * (t_1 / (-1.0 - (x1 * x1)))))))) - t_2) - t_3))); elseif (x1 <= 2.9e+33) tmp = x1 - (((x1 * (2.0 - t_6)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 5e+102) tmp = x1 + (t_4 + (x1 + (t_3 + (t_2 + (t_5 * ((x1 * 2.0) + ((x1 * x1) * (((t_1 / t_5) * 4.0) - 6.0)))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (t_6 - 2.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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.12e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.1e+15], N[(x1 + N[(t$95$4 + N[(x1 - N[(N[(N[(t$95$5 * N[(N[(N[(-1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(t$95$1 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+33], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$3 + N[(t$95$2 + N[(t$95$5 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(t$95$1 / t$95$5), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$6 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_2 := t\_0 \cdot \left(2 \cdot x2\right)\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := 3 \cdot \left(x2 \cdot -2\right)\\
t_5 := x1 \cdot x1 + 1\\
t_6 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
\mathbf{if}\;x1 \leq -2.12 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -4.1 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 - \left(\left(t\_5 \cdot \left(\frac{-1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_1}{-1 - x1 \cdot x1}\right)\right) - t\_2\right) - t\_3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_6\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_3 + \left(t\_2 + t\_5 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(\frac{t\_1}{t\_5} \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_6 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.12000000000000003e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.12000000000000003e102 < x1 < -4.1e15Initial program 99.4%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x1 around 0 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x1 around 0 72.8%
Taylor expanded in x1 around inf 69.5%
if -4.1e15 < x1 < 2.90000000000000025e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
if 2.90000000000000025e33 < x1 < 5e102Initial program 99.0%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around inf 99.0%
*-commutative99.0%
Simplified99.0%
if 5e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 3.0) 9.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* t_1 (* 2.0 x2)))
(t_3 (- (+ t_1 (* 2.0 x2)) x1))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (* x1 (* x1 x1))))
(if (<= x1 -2.12e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -4.1e+15)
(+
x1
(-
t_5
(-
(-
(-
(*
t_4
(-
(* (* x1 x1) (+ 6.0 (* 4.0 (/ t_3 (- -1.0 (* x1 x1))))))
(* x1 (+ 2.0 (* 2.0 (/ (- 3.0 (* x2 4.0)) x1))))))
t_2)
t_6)
x1)))
(if (<= x1 2.9e+33)
(-
x1
(-
(+
(* x1 (- 2.0 t_0))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 2e+101)
(+
x1
(+
t_5
(+
x1
(+
t_6
(+
t_2
(*
t_4
(+ (* x1 2.0) (* (* x1 x1) (- (* (/ t_3 t_4) 4.0) 6.0)))))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- t_0 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 * (2.0 * x2);
double t_3 = (t_1 + (2.0 * x2)) - x1;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_5 - ((((t_4 * (((x1 * x1) * (6.0 + (4.0 * (t_3 / (-1.0 - (x1 * x1)))))) - (x1 * (2.0 + (2.0 * ((3.0 - (x2 * 4.0)) / x1)))))) - t_2) - t_6) - x1));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 2e+101) {
tmp = x1 + (t_5 + (x1 + (t_6 + (t_2 + (t_4 * ((x1 * 2.0) + ((x1 * x1) * (((t_3 / t_4) * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.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) :: tmp
t_0 = x1 * ((x1 * 3.0d0) + 9.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = t_1 * (2.0d0 * x2)
t_3 = (t_1 + (2.0d0 * x2)) - x1
t_4 = (x1 * x1) + 1.0d0
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = x1 * (x1 * x1)
if (x1 <= (-2.12d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-4.1d+15)) then
tmp = x1 + (t_5 - ((((t_4 * (((x1 * x1) * (6.0d0 + (4.0d0 * (t_3 / ((-1.0d0) - (x1 * x1)))))) - (x1 * (2.0d0 + (2.0d0 * ((3.0d0 - (x2 * 4.0d0)) / x1)))))) - t_2) - t_6) - x1))
else if (x1 <= 2.9d+33) then
tmp = x1 - (((x1 * (2.0d0 - t_0)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 2d+101) then
tmp = x1 + (t_5 + (x1 + (t_6 + (t_2 + (t_4 * ((x1 * 2.0d0) + ((x1 * x1) * (((t_3 / t_4) * 4.0d0) - 6.0d0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_0 - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 * (2.0 * x2);
double t_3 = (t_1 + (2.0 * x2)) - x1;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -4.1e+15) {
tmp = x1 + (t_5 - ((((t_4 * (((x1 * x1) * (6.0 + (4.0 * (t_3 / (-1.0 - (x1 * x1)))))) - (x1 * (2.0 + (2.0 * ((3.0 - (x2 * 4.0)) / x1)))))) - t_2) - t_6) - x1));
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 2e+101) {
tmp = x1 + (t_5 + (x1 + (t_6 + (t_2 + (t_4 * ((x1 * 2.0) + ((x1 * x1) * (((t_3 / t_4) * 4.0) - 6.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 3.0) + 9.0) t_1 = x1 * (x1 * 3.0) t_2 = t_1 * (2.0 * x2) t_3 = (t_1 + (2.0 * x2)) - x1 t_4 = (x1 * x1) + 1.0 t_5 = 3.0 * (x2 * -2.0) t_6 = x1 * (x1 * x1) tmp = 0 if x1 <= -2.12e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -4.1e+15: tmp = x1 + (t_5 - ((((t_4 * (((x1 * x1) * (6.0 + (4.0 * (t_3 / (-1.0 - (x1 * x1)))))) - (x1 * (2.0 + (2.0 * ((3.0 - (x2 * 4.0)) / x1)))))) - t_2) - t_6) - x1)) elif x1 <= 2.9e+33: tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 2e+101: tmp = x1 + (t_5 + (x1 + (t_6 + (t_2 + (t_4 * ((x1 * 2.0) + ((x1 * x1) * (((t_3 / t_4) * 4.0) - 6.0)))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 * Float64(2.0 * x2)) t_3 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -2.12e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -4.1e+15) tmp = Float64(x1 + Float64(t_5 - Float64(Float64(Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(t_3 / Float64(-1.0 - Float64(x1 * x1)))))) - Float64(x1 * Float64(2.0 + Float64(2.0 * Float64(Float64(3.0 - Float64(x2 * 4.0)) / x1)))))) - t_2) - t_6) - x1))); elseif (x1 <= 2.9e+33) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_0)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 2e+101) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_6 + Float64(t_2 + Float64(t_4 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(Float64(t_3 / t_4) * 4.0) - 6.0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_0 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 3.0) + 9.0); t_1 = x1 * (x1 * 3.0); t_2 = t_1 * (2.0 * x2); t_3 = (t_1 + (2.0 * x2)) - x1; t_4 = (x1 * x1) + 1.0; t_5 = 3.0 * (x2 * -2.0); t_6 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -2.12e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -4.1e+15) tmp = x1 + (t_5 - ((((t_4 * (((x1 * x1) * (6.0 + (4.0 * (t_3 / (-1.0 - (x1 * x1)))))) - (x1 * (2.0 + (2.0 * ((3.0 - (x2 * 4.0)) / x1)))))) - t_2) - t_6) - x1)); elseif (x1 <= 2.9e+33) tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 2e+101) tmp = x1 + (t_5 + (x1 + (t_6 + (t_2 + (t_4 * ((x1 * 2.0) + ((x1 * x1) * (((t_3 / t_4) * 4.0) - 6.0)))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.12e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.1e+15], N[(x1 + N[(t$95$5 - N[(N[(N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(t$95$3 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 + N[(2.0 * N[(N[(3.0 - N[(x2 * 4.0), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$6), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+33], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+101], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$6 + N[(t$95$2 + N[(t$95$4 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(t$95$3 / t$95$4), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$0 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 \cdot \left(2 \cdot x2\right)\\
t_3 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_4 := x1 \cdot x1 + 1\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -2.12 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -4.1 \cdot 10^{+15}:\\
\;\;\;\;x1 + \left(t\_5 - \left(\left(\left(t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_3}{-1 - x1 \cdot x1}\right) - x1 \cdot \left(2 + 2 \cdot \frac{3 - x2 \cdot 4}{x1}\right)\right) - t\_2\right) - t\_6\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_0\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_6 + \left(t\_2 + t\_4 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(\frac{t\_3}{t\_4} \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_0 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.12000000000000003e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.12000000000000003e102 < x1 < -4.1e15Initial program 99.4%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x1 around 0 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x1 around 0 72.8%
Taylor expanded in x1 around -inf 69.3%
if -4.1e15 < x1 < 2.90000000000000025e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
if 2.90000000000000025e33 < x1 < 2e101Initial program 99.0%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around inf 99.0%
*-commutative99.0%
Simplified99.0%
if 2e101 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (* 2.0 x2))
(*
t_1
(+
(* x1 2.0)
(*
(* x1 x1)
(- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))))))))))
(t_3 (* x1 (+ (* x1 3.0) 9.0))))
(if (<= x1 -2.12e+102)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 -1.6e+16)
t_2
(if (<= x1 2.9e+33)
(-
x1
(-
(+
(* x1 (- 2.0 t_3))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(if (<= x1 4e+102) t_2 (+ x1 (+ (* x2 -6.0) (* x1 (- t_3 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (2.0 * x2)) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0))))))));
double t_3 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.6e+16) {
tmp = t_2;
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 4e+102) {
tmp = t_2;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.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 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (2.0d0 * x2)) + (t_1 * ((x1 * 2.0d0) + ((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0))))))))
t_3 = x1 * ((x1 * 3.0d0) + 9.0d0)
if (x1 <= (-2.12d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= (-1.6d+16)) then
tmp = t_2
else if (x1 <= 2.9d+33) then
tmp = x1 - (((x1 * (2.0d0 - t_3)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else if (x1 <= 4d+102) then
tmp = t_2
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_3 - 2.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 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (2.0 * x2)) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0))))))));
double t_3 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.12e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= -1.6e+16) {
tmp = t_2;
} else if (x1 <= 2.9e+33) {
tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else if (x1 <= 4e+102) {
tmp = t_2;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (2.0 * x2)) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))))))) t_3 = x1 * ((x1 * 3.0) + 9.0) tmp = 0 if x1 <= -2.12e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= -1.6e+16: tmp = t_2 elif x1 <= 2.9e+33: tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) elif x1 <= 4e+102: tmp = t_2 else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.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(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(2.0 * x2)) + Float64(t_1 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0))))))))) t_3 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) tmp = 0.0 if (x1 <= -2.12e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= -1.6e+16) tmp = t_2; elseif (x1 <= 2.9e+33) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_3)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); elseif (x1 <= 4e+102) tmp = t_2; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_3 - 2.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 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (2.0 * x2)) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)))))))); t_3 = x1 * ((x1 * 3.0) + 9.0); tmp = 0.0; if (x1 <= -2.12e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= -1.6e+16) tmp = t_2; elseif (x1 <= 2.9e+33) tmp = x1 - (((x1 * (2.0 - t_3)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); elseif (x1 <= 4e+102) tmp = t_2; else tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.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[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.12e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.6e+16], t$95$2, If[LessEqual[x1, 2.9e+33], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+102], t$95$2, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$3 - 2.0), $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 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(2 \cdot x2\right) + t\_1 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
\mathbf{if}\;x1 \leq -2.12 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+33}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_3\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_3 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.12000000000000003e102Initial program 0.0%
Simplified22.2%
Taylor expanded in x1 around 0 71.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.12000000000000003e102 < x1 < -1.6e16 or 2.90000000000000025e33 < x1 < 3.99999999999999991e102Initial program 99.2%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x1 around 0 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around inf 84.1%
*-commutative88.0%
Simplified84.1%
if -1.6e16 < x1 < 2.90000000000000025e33Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.9%
associate-*r*96.1%
fmm-def96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.2%
if 3.99999999999999991e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 3.0) 9.0))))
(if (<= x1 -2.9e+43)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 2e+101)
(-
x1
(-
(+
(* x1 (- 2.0 t_0))
(* x2 (- (* x1 (- 12.0 (* x1 6.0))) (* 8.0 (* x1 x2)))))
(* x2 -6.0)))
(+ x1 (+ (* x2 -6.0) (* x1 (- t_0 2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+101) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.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) :: tmp
t_0 = x1 * ((x1 * 3.0d0) + 9.0d0)
if (x1 <= (-2.9d+43)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 2d+101) then
tmp = x1 - (((x1 * (2.0d0 - t_0)) + (x2 * ((x1 * (12.0d0 - (x1 * 6.0d0))) - (8.0d0 * (x1 * x2))))) - (x2 * (-6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_0 - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 3.0) + 9.0);
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 2e+101) {
tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 3.0) + 9.0) tmp = 0 if x1 <= -2.9e+43: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 2e+101: tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) tmp = 0.0 if (x1 <= -2.9e+43) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 2e+101) tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 - t_0)) + Float64(x2 * Float64(Float64(x1 * Float64(12.0 - Float64(x1 * 6.0))) - Float64(8.0 * Float64(x1 * x2))))) - Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_0 - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 3.0) + 9.0); tmp = 0.0; if (x1 <= -2.9e+43) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 2e+101) tmp = x1 - (((x1 * (2.0 - t_0)) + (x2 * ((x1 * (12.0 - (x1 * 6.0))) - (8.0 * (x1 * x2))))) - (x2 * -6.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.9e+43], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+101], N[(x1 - N[(N[(N[(x1 * N[(2.0 - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * N[(12.0 - N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$0 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3 + 9\right)\\
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 - t\_0\right) + x2 \cdot \left(x1 \cdot \left(12 - x1 \cdot 6\right) - 8 \cdot \left(x1 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_0 - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.9000000000000002e43Initial program 16.6%
Simplified35.1%
Taylor expanded in x1 around 0 60.5%
Taylor expanded in x2 around 0 84.6%
*-commutative84.6%
Simplified84.6%
if -2.9000000000000002e43 < x1 < 2e101Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 76.0%
associate-*r*83.7%
fmm-def83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in x1 around 0 75.7%
Taylor expanded in x2 around 0 84.0%
if 2e101 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification86.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -9.6e+39)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 3.7e+102)
(-
x1
(-
(*
x1
(+
2.0
(-
(* 4.0 (* x2 (- 3.0 (* 2.0 x2))))
(* 3.0 (* x1 (- 3.0 (* x2 -2.0)))))))
(* x2 -6.0)))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 (+ (* x1 3.0) 9.0)) 2.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -9.6e+39) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 3.7e+102) {
tmp = x1 - ((x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (3.0 * (x1 * (3.0 - (x2 * -2.0))))))) - (x2 * -6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-9.6d+39)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 3.7d+102) then
tmp = x1 - ((x1 * (2.0d0 + ((4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))) - (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0)))))))) - (x2 * (-6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + 9.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -9.6e+39) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 3.7e+102) {
tmp = x1 - ((x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (3.0 * (x1 * (3.0 - (x2 * -2.0))))))) - (x2 * -6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -9.6e+39: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 3.7e+102: tmp = x1 - ((x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (3.0 * (x1 * (3.0 - (x2 * -2.0))))))) - (x2 * -6.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -9.6e+39) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 3.7e+102) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))) - Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0))))))) - Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -9.6e+39) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 3.7e+102) tmp = x1 - ((x1 * (2.0 + ((4.0 * (x2 * (3.0 - (2.0 * x2)))) - (3.0 * (x1 * (3.0 - (x2 * -2.0))))))) - (x2 * -6.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -9.6e+39], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.7e+102], N[(x1 - N[(N[(x1 * N[(2.0 + N[(N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.6 \cdot 10^{+39}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + \left(4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right) - 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -9.6000000000000004e39Initial program 20.9%
Simplified36.7%
Taylor expanded in x1 around 0 57.5%
Taylor expanded in x2 around 0 80.5%
*-commutative80.5%
Simplified80.5%
if -9.6000000000000004e39 < x1 < 3.70000000000000023e102Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 76.8%
associate-*r*84.6%
fmm-def84.6%
metadata-eval84.6%
Simplified84.6%
Taylor expanded in x1 around 0 77.1%
if 3.70000000000000023e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.35e+40)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(+
x1
(-
(* x2 -6.0)
(*
x1
(+
2.0
(+
(* x1 (- (* 3.0 (- (* x2 -2.0) 3.0)) (* x1 3.0)))
(* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.35e+40) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (4.0 * (x2 * (3.0 - (2.0 * x2))))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.35d+40)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + ((x1 * ((3.0d0 * ((x2 * (-2.0d0)) - 3.0d0)) - (x1 * 3.0d0))) + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.35e+40) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (4.0 * (x2 * (3.0 - (2.0 * x2))))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.35e+40: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) else: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (4.0 * (x2 * (3.0 - (2.0 * x2)))))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.35e+40) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(Float64(x1 * Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - 3.0)) - Float64(x1 * 3.0))) + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.35e+40) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); else tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + ((x1 * ((3.0 * ((x2 * -2.0) - 3.0)) - (x1 * 3.0))) + (4.0 * (x2 * (3.0 - (2.0 * x2)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.35e+40], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(N[(x1 * N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] - N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.35 \cdot 10^{+40}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + \left(x1 \cdot \left(3 \cdot \left(x2 \cdot -2 - 3\right) - x1 \cdot 3\right) + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.35000000000000011e40Initial program 20.9%
Simplified36.7%
Taylor expanded in x1 around 0 57.5%
Taylor expanded in x2 around 0 80.5%
*-commutative80.5%
Simplified80.5%
if -3.35000000000000011e40 < x1 Initial program 84.5%
Simplified84.7%
Taylor expanded in x1 around 0 62.7%
associate-*r*68.8%
fmm-def68.8%
metadata-eval68.8%
Simplified68.8%
Taylor expanded in x1 around 0 80.3%
Final simplification80.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x2 -1.95e+57)
t_0
(if (<= x2 1.5e-76)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x2 6e+218)
(+ x1 (+ (* x2 -6.0) (* x1 (* x2 (- (* x1 6.0) 12.0)))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -1.95e+57) {
tmp = t_0;
} else if (x2 <= 1.5e-76) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x2 <= 6e+218) {
tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 6.0) - 12.0))));
} else {
tmp = 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) :: tmp
t_0 = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x2 <= (-1.95d+57)) then
tmp = t_0
else if (x2 <= 1.5d-76) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x2 <= 6d+218) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (x2 * ((x1 * 6.0d0) - 12.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -1.95e+57) {
tmp = t_0;
} else if (x2 <= 1.5e-76) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x2 <= 6e+218) {
tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 6.0) - 12.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x2 <= -1.95e+57: tmp = t_0 elif x2 <= 1.5e-76: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x2 <= 6e+218: tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 6.0) - 12.0)))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x2 <= -1.95e+57) tmp = t_0; elseif (x2 <= 1.5e-76) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x2 <= 6e+218) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(x2 * Float64(Float64(x1 * 6.0) - 12.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x2 <= -1.95e+57) tmp = t_0; elseif (x2 <= 1.5e-76) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x2 <= 6e+218) tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 6.0) - 12.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.95e+57], t$95$0, If[LessEqual[x2, 1.5e-76], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 6e+218], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(x2 * N[(N[(x1 * 6.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x2 \leq -1.95 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x2 \leq 1.5 \cdot 10^{-76}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x2 \leq 6 \cdot 10^{+218}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot \left(x1 \cdot 6 - 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x2 < -1.94999999999999984e57 or 6.0000000000000001e218 < x2 Initial program 72.0%
Simplified72.0%
Taylor expanded in x1 around 0 59.4%
associate-*r*70.3%
fmm-def70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in x1 around inf 60.2%
Taylor expanded in x1 around 0 60.2%
if -1.94999999999999984e57 < x2 < 1.50000000000000012e-76Initial program 71.9%
Simplified72.1%
Taylor expanded in x1 around 0 49.0%
associate-*r*49.0%
fmm-def49.0%
metadata-eval49.0%
Simplified49.0%
Taylor expanded in x1 around 0 66.7%
Taylor expanded in x2 around 0 66.7%
Taylor expanded in x1 around 0 48.1%
Simplified48.1%
if 1.50000000000000012e-76 < x2 < 6.0000000000000001e218Initial program 65.9%
Simplified66.0%
Taylor expanded in x1 around 0 40.7%
associate-*r*47.8%
fmm-def47.8%
metadata-eval47.8%
Simplified47.8%
Taylor expanded in x1 around 0 55.2%
Taylor expanded in x2 around 0 51.1%
Taylor expanded in x2 around inf 66.0%
Final simplification56.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.9e+43)
(- x1 (* x2 (+ 6.0 (* x1 12.0))))
(if (or (<= x1 -2.4e-82) (not (<= x1 1.35e-176)))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = x1 - (x2 * (6.0 + (x1 * 12.0)));
} else if ((x1 <= -2.4e-82) || !(x1 <= 1.35e-176)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = 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 <= (-2.9d+43)) then
tmp = x1 - (x2 * (6.0d0 + (x1 * 12.0d0)))
else if ((x1 <= (-2.4d-82)) .or. (.not. (x1 <= 1.35d-176))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = x1 - (x2 * (6.0 + (x1 * 12.0)));
} else if ((x1 <= -2.4e-82) || !(x1 <= 1.35e-176)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.9e+43: tmp = x1 - (x2 * (6.0 + (x1 * 12.0))) elif (x1 <= -2.4e-82) or not (x1 <= 1.35e-176): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.9e+43) tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(x1 * 12.0)))); elseif ((x1 <= -2.4e-82) || !(x1 <= 1.35e-176)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.9e+43) tmp = x1 - (x2 * (6.0 + (x1 * 12.0))); elseif ((x1 <= -2.4e-82) || ~((x1 <= 1.35e-176))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.9e+43], N[(x1 - N[(x2 * N[(6.0 + N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -2.4e-82], N[Not[LessEqual[x1, 1.35e-176]], $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[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + x1 \cdot 12\right)\\
\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{-82} \lor \neg \left(x1 \leq 1.35 \cdot 10^{-176}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.9000000000000002e43Initial program 16.6%
Simplified16.6%
Taylor expanded in x1 around 0 2.0%
associate-*r*2.0%
fmm-def2.0%
metadata-eval2.0%
Simplified2.0%
Taylor expanded in x1 around 0 33.2%
Taylor expanded in x2 around -inf 3.8%
Taylor expanded in x2 around 0 17.5%
if -2.9000000000000002e43 < x1 < -2.40000000000000008e-82 or 1.3499999999999999e-176 < x1 Initial program 76.8%
Simplified77.0%
Taylor expanded in x1 around 0 51.0%
associate-*r*51.7%
fmm-def51.7%
metadata-eval51.7%
Simplified51.7%
Taylor expanded in x1 around inf 38.9%
Taylor expanded in x1 around 0 38.9%
if -2.40000000000000008e-82 < x1 < 1.3499999999999999e-176Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 64.7%
Final simplification41.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.9e+43)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))))
(if (<= x1 3.9e+102)
(+ (* x2 -6.0) (* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0))))))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 (+ (* x1 3.0) 9.0)) 2.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 3.9e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.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.9d+43)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else if (x1 <= 3.9d+102) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + 9.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else if (x1 <= 3.9e+102) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.9e+43: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) elif x1 <= 3.9e+102: tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.9e+43) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); elseif (x1 <= 3.9e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + 9.0)) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.9e+43) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); elseif (x1 <= 3.9e+102) tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + 9.0)) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.9e+43], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 9\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.9000000000000002e43Initial program 16.6%
Simplified35.1%
Taylor expanded in x1 around 0 60.5%
Taylor expanded in x2 around 0 84.6%
*-commutative84.6%
Simplified84.6%
if -2.9000000000000002e43 < x1 < 3.8999999999999998e102Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 76.0%
associate-*r*83.7%
fmm-def83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 84.0%
Taylor expanded in x1 around 0 75.3%
if 3.8999999999999998e102 < x1 Initial program 26.8%
Simplified26.8%
Taylor expanded in x1 around 0 8.3%
associate-*r*8.3%
fmm-def8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x1 around 0 92.7%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.9e+56) (not (<= x2 1.15e+217))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.9e+56) || !(x2 <= 1.15e+217)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.9d+56)) .or. (.not. (x2 <= 1.15d+217))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.9e+56) || !(x2 <= 1.15e+217)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.9e+56) or not (x2 <= 1.15e+217): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.9e+56) || !(x2 <= 1.15e+217)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.9e+56) || ~((x2 <= 1.15e+217))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.9e+56], N[Not[LessEqual[x2, 1.15e+217]], $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[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.9 \cdot 10^{+56} \lor \neg \left(x2 \leq 1.15 \cdot 10^{+217}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1.89999999999999998e56 or 1.1499999999999999e217 < x2 Initial program 72.0%
Simplified72.0%
Taylor expanded in x1 around 0 59.4%
associate-*r*70.3%
fmm-def70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in x1 around inf 60.2%
Taylor expanded in x1 around 0 60.2%
if -1.89999999999999998e56 < x2 < 1.1499999999999999e217Initial program 69.7%
Simplified69.9%
Taylor expanded in x1 around 0 46.0%
associate-*r*48.6%
fmm-def48.6%
metadata-eval48.6%
Simplified48.6%
Taylor expanded in x1 around 0 62.5%
Taylor expanded in x2 around 0 61.1%
Taylor expanded in x1 around 0 46.1%
Simplified46.1%
Final simplification49.8%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.9e+43) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))) (+ (* x2 -6.0) (* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.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.9d+43)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.9e+43) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.9e+43: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.9e+43) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.9e+43) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.9e+43], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+43}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\end{array}
\end{array}
if x1 < -2.9000000000000002e43Initial program 16.6%
Simplified35.1%
Taylor expanded in x1 around 0 60.5%
Taylor expanded in x2 around 0 84.6%
*-commutative84.6%
Simplified84.6%
if -2.9000000000000002e43 < x1 Initial program 84.7%
Simplified84.9%
Taylor expanded in x1 around 0 62.3%
associate-*r*68.4%
fmm-def68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in x1 around 0 83.5%
Taylor expanded in x2 around 0 83.5%
Taylor expanded in x1 around 0 66.6%
Final simplification70.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 3e-20) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 3e-20) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.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 <= 3d-20) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.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 <= 3e-20) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))));
} else {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 3e-20: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.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 <= 3e-20) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.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 <= 3e-20) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.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, 3e-20], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $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 3 \cdot 10^{-20}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\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 < 3.00000000000000029e-20Initial program 75.0%
Simplified72.9%
Taylor expanded in x1 around 0 64.6%
Taylor expanded in x2 around 0 71.8%
*-commutative71.8%
Simplified71.8%
if 3.00000000000000029e-20 < x1 Initial program 58.5%
Simplified58.6%
Taylor expanded in x1 around 0 25.1%
associate-*r*25.1%
fmm-def25.1%
metadata-eval25.1%
Simplified25.1%
Taylor expanded in x1 around inf 38.0%
Taylor expanded in x1 around 0 38.0%
Final simplification62.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9.5e+153) (not (<= x1 1.35))) (- x1 (* x1 (- -1.0 (* x2 -12.0)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.5e+153) || !(x1 <= 1.35)) {
tmp = x1 - (x1 * (-1.0 - (x2 * -12.0)));
} else {
tmp = 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 <= (-9.5d+153)) .or. (.not. (x1 <= 1.35d0))) then
tmp = x1 - (x1 * ((-1.0d0) - (x2 * (-12.0d0))))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.5e+153) || !(x1 <= 1.35)) {
tmp = x1 - (x1 * (-1.0 - (x2 * -12.0)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9.5e+153) or not (x1 <= 1.35): tmp = x1 - (x1 * (-1.0 - (x2 * -12.0))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9.5e+153) || !(x1 <= 1.35)) tmp = Float64(x1 - Float64(x1 * Float64(-1.0 - Float64(x2 * -12.0)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -9.5e+153) || ~((x1 <= 1.35))) tmp = x1 - (x1 * (-1.0 - (x2 * -12.0))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9.5e+153], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(x1 - N[(x1 * N[(-1.0 - N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+153} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;x1 - x1 \cdot \left(-1 - x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -9.4999999999999995e153 or 1.3500000000000001 < x1 Initial program 35.8%
Simplified35.8%
Taylor expanded in x1 around 0 11.4%
associate-*r*11.4%
fmm-def11.4%
metadata-eval11.4%
Simplified11.4%
Taylor expanded in x1 around inf 22.8%
Taylor expanded in x2 around 0 15.9%
*-commutative15.9%
Simplified15.9%
if -9.4999999999999995e153 < x1 < 1.3500000000000001Initial program 92.5%
Simplified92.7%
Taylor expanded in x1 around 0 35.7%
Final simplification27.9%
(FPCore (x1 x2) :precision binary64 (- x1 (* x2 (+ 6.0 (* x1 12.0)))))
double code(double x1, double x2) {
return x1 - (x2 * (6.0 + (x1 * 12.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 - (x2 * (6.0d0 + (x1 * 12.0d0)))
end function
public static double code(double x1, double x2) {
return x1 - (x2 * (6.0 + (x1 * 12.0)));
}
def code(x1, x2): return x1 - (x2 * (6.0 + (x1 * 12.0)))
function code(x1, x2) return Float64(x1 - Float64(x2 * Float64(6.0 + Float64(x1 * 12.0)))) end
function tmp = code(x1, x2) tmp = x1 - (x2 * (6.0 + (x1 * 12.0))); end
code[x1_, x2_] := N[(x1 - N[(x2 * N[(6.0 + N[(x1 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 - x2 \cdot \left(6 + x1 \cdot 12\right)
\end{array}
Initial program 70.3%
Simplified70.5%
Taylor expanded in x1 around 0 49.6%
associate-*r*54.4%
fmm-def54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around -inf 40.0%
Taylor expanded in x2 around 0 27.5%
Final simplification27.5%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 70.3%
Simplified70.5%
Taylor expanded in x1 around 0 22.6%
Final simplification22.6%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 70.3%
Simplified70.5%
Taylor expanded in x1 around 0 49.6%
associate-*r*54.4%
fmm-def54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around -inf 40.0%
Taylor expanded in x2 around 0 3.1%
herbie shell --seed 2024149
(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))))))