
(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 22 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 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(* x1 (+ 1.0 (* 6.0 (pow x1 3.0)))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 * (1.0 + (6.0 * pow(x1, 3.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 * Float64(1.0 + Float64(6.0 * (x1 ^ 3.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $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$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - 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$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(1.0 + N[(6.0 * N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \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\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(1 + 6 \cdot {x1}^{3}\right)\\
\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.4%
Simplified99.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%
Simplified15.2%
Taylor expanded in x1 around inf 98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x1 around inf 98.8%
Taylor expanded in x1 around 0 98.8%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (* x1 (+ 1.0 (* 6.0 (pow x1 3.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 * (1.0 + (6.0 * pow(x1, 3.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 * (1.0 + (6.0 * Math.pow(x1, 3.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 * (1.0 + (6.0 * math.pow(x1, 3.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 * Float64(1.0 + Float64(6.0 * (x1 ^ 3.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 * (1.0 + (6.0 * (x1 ^ 3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 * N[(1.0 + N[(6.0 * N[Power[x1, 3.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 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(1 + 6 \cdot {x1}^{3}\right)\\
\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.4%
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%
Simplified15.2%
Taylor expanded in x1 around inf 98.8%
associate-*r/98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x1 around inf 98.8%
Taylor expanded in x1 around 0 98.8%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -2.05e+91) (not (<= x1 3.9e+66)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.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 tmp;
if ((x1 <= -2.05e+91) || !(x1 <= 3.9e+66)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-2.05d+91)) .or. (.not. (x1 <= 3.9d+66))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -2.05e+91) || !(x1 <= 3.9e+66)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.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 tmp = 0 if (x1 <= -2.05e+91) or not (x1 <= 3.9e+66): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.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) tmp = 0.0 if ((x1 <= -2.05e+91) || !(x1 <= 3.9e+66)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); 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_2) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.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; tmp = 0.0; if ((x1 <= -2.05e+91) || ~((x1 <= 3.9e+66))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.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]}, If[Or[LessEqual[x1, -2.05e+91], N[Not[LessEqual[x1, 3.9e+66]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $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$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+91} \lor \neg \left(x1 \leq 3.9 \cdot 10^{+66}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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\_2 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.0500000000000001e91 or 3.9000000000000004e66 < x1 Initial program 26.3%
Simplified36.7%
Taylor expanded in x1 around 0 36.7%
Taylor expanded in x1 around inf 100.0%
if -2.0500000000000001e91 < x1 < 3.9000000000000004e66Initial program 98.6%
*-commutative98.6%
add-cbrt-cube98.6%
Applied egg-rr98.6%
Taylor expanded in x2 around 0 98.0%
Taylor expanded in x1 around inf 95.3%
Final simplification97.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -4.4e+61) (not (<= x1 5.7e+66)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))
(* t_0 (- (* 2.0 x2) x1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -4.4e+61) || !(x1 <= 5.7e+66)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-4.4d+61)) .or. (.not. (x1 <= 5.7d+66))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + (t_0 * ((2.0d0 * x2) - x1))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -4.4e+61) || !(x1 <= 5.7e+66)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -4.4e+61) or not (x1 <= 5.7e+66): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -4.4e+61) || !(x1 <= 5.7e+66)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); 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_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -4.4e+61) || ~((x1 <= 5.7e+66))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -4.4e+61], N[Not[LessEqual[x1, 5.7e+66]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $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$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $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 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -4.4 \cdot 10^{+61} \lor \neg \left(x1 \leq 5.7 \cdot 10^{+66}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + t\_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.4000000000000001e61 or 5.7000000000000003e66 < x1 Initial program 30.9%
Simplified39.7%
Taylor expanded in x1 around 0 39.7%
Taylor expanded in x1 around inf 99.1%
if -4.4000000000000001e61 < x1 < 5.7000000000000003e66Initial program 98.6%
*-commutative98.6%
add-cbrt-cube98.6%
Applied egg-rr98.6%
Taylor expanded in x2 around 0 98.0%
Taylor expanded in x1 around inf 95.1%
Taylor expanded in x1 around 0 94.6%
mul-1-neg94.6%
+-commutative94.6%
sub-neg94.6%
Simplified94.6%
Final simplification96.6%
(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)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
(t_4
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(*
t_1
(+ (* (* (* x1 2.0) t_3) (- t_3 3.0)) (* (* x1 x1) 6.0))))))
9.0)))
(t_5 (* x2 t_0))
(t_6 (* -4.0 t_5))
(t_7 (- 3.0 (* 2.0 x2))))
(if (<= x1 -5.8e+102)
(+
(* x2 -6.0)
(*
x1
(+
(+
t_6
(*
x1
(+
3.0
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_6
(*
2.0
(-
(+ 1.0 (+ (* -3.0 t_0) (* 2.0 (* x2 t_7))))
(* -2.0 t_5))))
6.0))))))))
-1.0)))
(if (<= x1 -0.00037)
t_4
(if (<= x1 0.0078)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 4e+103)
t_4
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) t_7))
(+ (* 3.0 (- 3.0 (* x2 -2.0))) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
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);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + 9.0);
double t_5 = x2 * t_0;
double t_6 = -4.0 * t_5;
double t_7 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_6 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_7)))) - (-2.0 * t_5)))) - 6.0)))))))) + -1.0));
} else if (x1 <= -0.00037) {
tmp = t_4;
} else if (x1 <= 0.0078) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 4e+103) {
tmp = t_4;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_7)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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 = 3.0d0 + (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_1 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))) + 9.0d0)
t_5 = x2 * t_0
t_6 = (-4.0d0) * t_5
t_7 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-5.8d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((t_6 + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_6 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_0) + (2.0d0 * (x2 * t_7)))) - ((-2.0d0) * t_5)))) - 6.0d0)))))))) + (-1.0d0)))
else if (x1 <= (-0.00037d0)) then
tmp = t_4
else if (x1 <= 0.0078d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 4d+103) then
tmp = t_4
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + t_7)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + 9.0);
double t_5 = x2 * t_0;
double t_6 = -4.0 * t_5;
double t_7 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_6 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_7)))) - (-2.0 * t_5)))) - 6.0)))))))) + -1.0));
} else if (x1 <= -0.00037) {
tmp = t_4;
} else if (x1 <= 0.0078) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 4e+103) {
tmp = t_4;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_7)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1 t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + 9.0) t_5 = x2 * t_0 t_6 = -4.0 * t_5 t_7 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -5.8e+102: tmp = (x2 * -6.0) + (x1 * ((t_6 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_7)))) - (-2.0 * t_5)))) - 6.0)))))))) + -1.0)) elif x1 <= -0.00037: tmp = t_4 elif x1 <= 0.0078: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 4e+103: tmp = t_4 else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_7)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))) + 9.0)) t_5 = Float64(x2 * t_0) t_6 = Float64(-4.0 * t_5) t_7 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_6 + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_6 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_0) + Float64(2.0 * Float64(x2 * t_7)))) - Float64(-2.0 * t_5)))) - 6.0)))))))) + -1.0))); elseif (x1 <= -0.00037) tmp = t_4; elseif (x1 <= 0.0078) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 4e+103) tmp = t_4; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_7)) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 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); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1; t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + 9.0); t_5 = x2 * t_0; t_6 = -4.0 * t_5; t_7 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -5.8e+102) tmp = (x2 * -6.0) + (x1 * ((t_6 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_7)))) - (-2.0 * t_5)))) - 6.0)))))))) + -1.0)); elseif (x1 <= -0.00037) tmp = t_4; elseif (x1 <= 0.0078) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 4e+103) tmp = t_4; else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_7)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(-4.0 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$6 + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$6 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$0), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00037], t$95$4, If[LessEqual[x1, 0.0078], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4e+103], t$95$4, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + x2 \cdot -2\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_1}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) + 9\right)\\
t_5 := x2 \cdot t\_0\\
t_6 := -4 \cdot t\_5\\
t_7 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(t\_6 + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_6 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_0 + 2 \cdot \left(x2 \cdot t\_7\right)\right)\right) - -2 \cdot t\_5\right)\right) - 6\right)\right)\right)\right)\right)\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -0.00037:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 0.0078:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+103}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + t\_7\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Simplified30.8%
Taylor expanded in x1 around 0 30.8%
Taylor expanded in x1 around 0 84.6%
if -5.8000000000000005e102 < x1 < -3.6999999999999999e-4 or 0.0077999999999999996 < x1 < 4e103Initial program 97.4%
*-commutative97.4%
add-cbrt-cube97.2%
Applied egg-rr97.2%
Taylor expanded in x2 around 0 93.8%
Taylor expanded in x1 around inf 88.5%
Taylor expanded in x1 around inf 88.5%
if -3.6999999999999999e-4 < x1 < 0.0077999999999999996Initial program 99.3%
Simplified87.7%
Taylor expanded in x1 around 0 86.6%
fma-define86.7%
*-commutative86.7%
fmm-def86.7%
metadata-eval86.7%
cancel-sign-sub-inv86.7%
*-commutative86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in x2 around 0 98.5%
if 4e103 < x1 Initial program 27.8%
Taylor expanded in x1 around 0 25.9%
Taylor expanded in x1 around 0 79.6%
Taylor expanded in x1 around 0 96.3%
Final simplification93.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* x2 t_0))
(t_5 (* -4.0 t_4))
(t_6 (- 3.0 (* 2.0 x2))))
(if (<= x1 -5e+102)
(+
(* x2 -6.0)
(*
x1
(+
(+
t_5
(*
x1
(+
3.0
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_5
(*
2.0
(-
(+ 1.0 (+ (* -3.0 t_0) (* 2.0 (* x2 t_6))))
(* -2.0 t_4))))
6.0))))))))
-1.0)))
(if (<= x1 9e+97)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (+ (* (* (* x1 2.0) t_3) (- t_3 3.0)) (* (* x1 x1) 6.0)))
(* t_1 (- (* 2.0 x2) x1)))))))
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) t_6))
(+ (* 3.0 (- 3.0 (* x2 -2.0))) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
2.0))))))))
double code(double x1, double x2) {
double t_0 = 3.0 + (x2 * -2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 9e+97) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * ((2.0 * x2) - x1))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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 = 3.0d0 + (x2 * (-2.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x2 * t_0
t_5 = (-4.0d0) * t_4
t_6 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((t_5 + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_5 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_0) + (2.0d0 * (x2 * t_6)))) - ((-2.0d0) * t_4)))) - 6.0d0)))))))) + (-1.0d0)))
else if (x1 <= 9d+97) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + (t_1 * ((2.0d0 * x2) - x1))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + t_6)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 9e+97) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * ((2.0 * x2) - x1))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 + (x2 * -2.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x2 * t_0 t_5 = -4.0 * t_4 t_6 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -5e+102: tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)) elif x1 <= 9e+97: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * ((2.0 * x2) - x1)))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 + Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x2 * t_0) t_5 = Float64(-4.0 * t_4) t_6 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_5 + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_5 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_0) + Float64(2.0 * Float64(x2 * t_6)))) - Float64(-2.0 * t_4)))) - 6.0)))))))) + -1.0))); elseif (x1 <= 9e+97) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_1 * Float64(Float64(2.0 * x2) - x1))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_6)) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 + (x2 * -2.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x2 * t_0; t_5 = -4.0 * t_4; t_6 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -5e+102) tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)); elseif (x1 <= 9e+97) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * ((2.0 * x2) - x1)))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$0), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e+97], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + x2 \cdot -2\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x2 \cdot t\_0\\
t_5 := -4 \cdot t\_4\\
t_6 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(t\_5 + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_5 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_0 + 2 \cdot \left(x2 \cdot t\_6\right)\right)\right) - -2 \cdot t\_4\right)\right) - 6\right)\right)\right)\right)\right)\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{+97}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + t\_1 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + t\_6\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified30.8%
Taylor expanded in x1 around 0 30.8%
Taylor expanded in x1 around 0 84.6%
if -5e102 < x1 < 8.99999999999999952e97Initial program 98.7%
*-commutative98.7%
add-cbrt-cube98.6%
Applied egg-rr98.6%
Taylor expanded in x2 around 0 97.5%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around 0 93.9%
mul-1-neg93.9%
+-commutative93.9%
sub-neg93.9%
Simplified93.9%
if 8.99999999999999952e97 < x1 Initial program 29.1%
Taylor expanded in x1 around 0 25.5%
Taylor expanded in x1 around 0 78.2%
Taylor expanded in x1 around 0 94.5%
Final simplification92.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* x2 t_0))
(t_5 (* -4.0 t_4))
(t_6 (- 3.0 (* 2.0 x2))))
(if (<= x1 -5e+102)
(+
(* x2 -6.0)
(*
x1
(+
(+
t_5
(*
x1
(+
3.0
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_5
(*
2.0
(-
(+ 1.0 (+ (* -3.0 t_0) (* 2.0 (* x2 t_6))))
(* -2.0 t_4))))
6.0))))))))
-1.0)))
(if (<= x1 9e+97)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (+ (* (* (* x1 2.0) t_3) (- t_3 3.0)) (* (* x1 x1) 6.0)))
(* t_1 (* 2.0 x2)))))))
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) t_6))
(+ (* 3.0 (- 3.0 (* x2 -2.0))) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
2.0))))))))
double code(double x1, double x2) {
double t_0 = 3.0 + (x2 * -2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 9e+97) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * (2.0 * x2))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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 = 3.0d0 + (x2 * (-2.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x2 * t_0
t_5 = (-4.0d0) * t_4
t_6 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((t_5 + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_5 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_0) + (2.0d0 * (x2 * t_6)))) - ((-2.0d0) * t_4)))) - 6.0d0)))))))) + (-1.0d0)))
else if (x1 <= 9d+97) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + (t_1 * (2.0d0 * x2))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + t_6)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 9e+97) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * (2.0 * x2))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 + (x2 * -2.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x2 * t_0 t_5 = -4.0 * t_4 t_6 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -5e+102: tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)) elif x1 <= 9e+97: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * (2.0 * x2)))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 + Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x2 * t_0) t_5 = Float64(-4.0 * t_4) t_6 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_5 + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_5 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_0) + Float64(2.0 * Float64(x2 * t_6)))) - Float64(-2.0 * t_4)))) - 6.0)))))))) + -1.0))); elseif (x1 <= 9e+97) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_1 * Float64(2.0 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_6)) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 + (x2 * -2.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x2 * t_0; t_5 = -4.0 * t_4; t_6 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -5e+102) tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)); elseif (x1 <= 9e+97) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + (t_1 * (2.0 * x2)))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$0), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e+97], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + x2 \cdot -2\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x2 \cdot t\_0\\
t_5 := -4 \cdot t\_4\\
t_6 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(t\_5 + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_5 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_0 + 2 \cdot \left(x2 \cdot t\_6\right)\right)\right) - -2 \cdot t\_4\right)\right) - 6\right)\right)\right)\right)\right)\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{+97}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + t\_6\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified30.8%
Taylor expanded in x1 around 0 30.8%
Taylor expanded in x1 around 0 84.6%
if -5e102 < x1 < 8.99999999999999952e97Initial program 98.7%
*-commutative98.7%
add-cbrt-cube98.6%
Applied egg-rr98.6%
Taylor expanded in x2 around 0 97.5%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around 0 93.8%
if 8.99999999999999952e97 < x1 Initial program 29.1%
Taylor expanded in x1 around 0 25.5%
Taylor expanded in x1 around 0 78.2%
Taylor expanded in x1 around 0 94.5%
Final simplification92.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* x2 t_0))
(t_5 (* -4.0 t_4))
(t_6 (- 3.0 (* 2.0 x2))))
(if (<= x1 -5.8e+102)
(+
(* x2 -6.0)
(*
x1
(+
(+
t_5
(*
x1
(+
3.0
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_5
(*
2.0
(-
(+ 1.0 (+ (* -3.0 t_0) (* 2.0 (* x2 t_6))))
(* -2.0 t_4))))
6.0))))))))
-1.0)))
(if (<= x1 4e+103)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_3)
(*
t_2
(+
(* (* x1 x1) 6.0)
(* (- t_3 3.0) (* (* x1 2.0) (* 2.0 x2))))))))))
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) t_6))
(+ (* 3.0 (- 3.0 (* x2 -2.0))) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
2.0))))))))
double code(double x1, double x2) {
double t_0 = 3.0 + (x2 * -2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 4e+103) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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 = 3.0d0 + (x2 * (-2.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x2 * t_0
t_5 = (-4.0d0) * t_4
t_6 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-5.8d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((t_5 + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_5 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_0) + (2.0d0 * (x2 * t_6)))) - ((-2.0d0) * t_4)))) - 6.0d0)))))))) + (-1.0d0)))
else if (x1 <= 4d+103) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0d0) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2)))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + t_6)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x2 * t_0;
double t_5 = -4.0 * t_4;
double t_6 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -5.8e+102) {
tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 4e+103) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 + (x2 * -2.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x2 * t_0 t_5 = -4.0 * t_4 t_6 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -5.8e+102: tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)) elif x1 <= 4e+103: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 + Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x2 * t_0) t_5 = Float64(-4.0 * t_4) t_6 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_5 + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_5 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_0) + Float64(2.0 * Float64(x2 * t_6)))) - Float64(-2.0 * t_4)))) - 6.0)))))))) + -1.0))); elseif (x1 <= 4e+103) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_6)) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 + (x2 * -2.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x2 * t_0; t_5 = -4.0 * t_4; t_6 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -5.8e+102) tmp = (x2 * -6.0) + (x1 * ((t_5 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_6)))) - (-2.0 * t_4)))) - 6.0)))))))) + -1.0)); elseif (x1 <= 4e+103) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_6)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$0), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+103], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + x2 \cdot -2\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x2 \cdot t\_0\\
t_5 := -4 \cdot t\_4\\
t_6 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(t\_5 + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_5 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_0 + 2 \cdot \left(x2 \cdot t\_6\right)\right)\right) - -2 \cdot t\_4\right)\right) - 6\right)\right)\right)\right)\right)\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + t\_6\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Simplified30.8%
Taylor expanded in x1 around 0 30.8%
Taylor expanded in x1 around 0 84.6%
if -5.8000000000000005e102 < x1 < 4e103Initial program 98.7%
*-commutative98.7%
add-cbrt-cube98.6%
Applied egg-rr98.6%
Taylor expanded in x2 around 0 97.5%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around 0 92.8%
if 4e103 < x1 Initial program 27.8%
Taylor expanded in x1 around 0 25.9%
Taylor expanded in x1 around 0 79.6%
Taylor expanded in x1 around 0 96.3%
Final simplification92.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 3.0 (* x2 -2.0)))
(t_1 (* x2 t_0))
(t_2 (* -4.0 t_1))
(t_3 (- 3.0 (* 2.0 x2))))
(if (<= x1 -2.05e+93)
(+
(* x2 -6.0)
(*
x1
(+
(+
t_2
(*
x1
(+
3.0
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_2
(*
2.0
(-
(+ 1.0 (+ (* -3.0 t_0) (* 2.0 (* x2 t_3))))
(* -2.0 t_1))))
6.0))))))))
-1.0)))
(if (<= x1 1e+98)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) t_3))
(+ (* 3.0 (- 3.0 (* x2 -2.0))) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
2.0))))))))
double code(double x1, double x2) {
double t_0 = 3.0 + (x2 * -2.0);
double t_1 = x2 * t_0;
double t_2 = -4.0 * t_1;
double t_3 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -2.05e+93) {
tmp = (x2 * -6.0) + (x1 * ((t_2 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_2 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_3)))) - (-2.0 * t_1)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 1e+98) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_3)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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 = 3.0d0 + (x2 * (-2.0d0))
t_1 = x2 * t_0
t_2 = (-4.0d0) * t_1
t_3 = 3.0d0 - (2.0d0 * x2)
if (x1 <= (-2.05d+93)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((t_2 + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_2 + (2.0d0 * ((1.0d0 + (((-3.0d0) * t_0) + (2.0d0 * (x2 * t_3)))) - ((-2.0d0) * t_1)))) - 6.0d0)))))))) + (-1.0d0)))
else if (x1 <= 1d+98) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + t_3)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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 = x2 * t_0;
double t_2 = -4.0 * t_1;
double t_3 = 3.0 - (2.0 * x2);
double tmp;
if (x1 <= -2.05e+93) {
tmp = (x2 * -6.0) + (x1 * ((t_2 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_2 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_3)))) - (-2.0 * t_1)))) - 6.0)))))))) + -1.0));
} else if (x1 <= 1e+98) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_3)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 + (x2 * -2.0) t_1 = x2 * t_0 t_2 = -4.0 * t_1 t_3 = 3.0 - (2.0 * x2) tmp = 0 if x1 <= -2.05e+93: tmp = (x2 * -6.0) + (x1 * ((t_2 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_2 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_3)))) - (-2.0 * t_1)))) - 6.0)))))))) + -1.0)) elif x1 <= 1e+98: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_3)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 + Float64(x2 * -2.0)) t_1 = Float64(x2 * t_0) t_2 = Float64(-4.0 * t_1) t_3 = Float64(3.0 - Float64(2.0 * x2)) tmp = 0.0 if (x1 <= -2.05e+93) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_2 + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_2 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(-3.0 * t_0) + Float64(2.0 * Float64(x2 * t_3)))) - Float64(-2.0 * t_1)))) - 6.0)))))))) + -1.0))); elseif (x1 <= 1e+98) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_3)) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 + (x2 * -2.0); t_1 = x2 * t_0; t_2 = -4.0 * t_1; t_3 = 3.0 - (2.0 * x2); tmp = 0.0; if (x1 <= -2.05e+93) tmp = (x2 * -6.0) + (x1 * ((t_2 + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_2 + (2.0 * ((1.0 + ((-3.0 * t_0) + (2.0 * (x2 * t_3)))) - (-2.0 * t_1)))) - 6.0)))))))) + -1.0)); elseif (x1 <= 1e+98) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + t_3)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.05e+93], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$2 + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$2 + N[(2.0 * N[(N[(1.0 + N[(N[(-3.0 * t$95$0), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+98], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 + x2 \cdot -2\\
t_1 := x2 \cdot t\_0\\
t_2 := -4 \cdot t\_1\\
t_3 := 3 - 2 \cdot x2\\
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+93}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(t\_2 + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_2 + 2 \cdot \left(\left(1 + \left(-3 \cdot t\_0 + 2 \cdot \left(x2 \cdot t\_3\right)\right)\right) - -2 \cdot t\_1\right)\right) - 6\right)\right)\right)\right)\right)\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 10^{+98}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + t\_3\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.0500000000000001e93Initial program 2.5%
Simplified32.5%
Taylor expanded in x1 around 0 32.5%
Taylor expanded in x1 around 0 85.0%
if -2.0500000000000001e93 < x1 < 9.99999999999999998e97Initial program 98.7%
Simplified88.9%
Taylor expanded in x1 around 0 68.1%
fma-define68.2%
*-commutative68.2%
fmm-def68.2%
metadata-eval68.2%
cancel-sign-sub-inv68.2%
*-commutative68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in x2 around 0 76.2%
if 9.99999999999999998e97 < x1 Initial program 27.8%
Taylor expanded in x1 around 0 25.9%
Taylor expanded in x1 around 0 79.6%
Taylor expanded in x1 around 0 96.3%
Final simplification81.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* x2 -2.0))) (t_1 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -2e+96)
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_1)))
(* 3.0 (+ (* x2 -2.0) (* x1 (+ -1.0 (* x1 t_0)))))))
(if (<= x1 2.55e+98)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 t_1)
(*
x1
(-
(+
x1
(+
(* 2.0 (+ (* x2 -2.0) (- 3.0 (* 2.0 x2))))
(+ (* 3.0 t_0) (+ (* x2 6.0) (* x2 8.0)))))
6.0)))
2.0))))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (x2 * -2.0);
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -2e+96) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * t_0))))));
} else if (x1 <= 2.55e+98) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * t_1) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + ((3.0 * t_0) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.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) :: tmp
t_0 = 3.0d0 - (x2 * (-2.0d0))
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-2d+96)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_1))) + (3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) + (x1 * t_0))))))
else if (x1 <= 2.55d+98) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * t_1) + (x1 * ((x1 + ((2.0d0 * ((x2 * (-2.0d0)) + (3.0d0 - (2.0d0 * x2)))) + ((3.0d0 * t_0) + ((x2 * 6.0d0) + (x2 * 8.0d0))))) - 6.0d0))) - 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 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -2e+96) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * t_0))))));
} else if (x1 <= 2.55e+98) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * t_1) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + ((3.0 * t_0) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (x2 * -2.0) t_1 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -2e+96: tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * t_0)))))) elif x1 <= 2.55e+98: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * t_1) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + ((3.0 * t_0) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(x2 * -2.0)) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -2e+96) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_1))) + Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * t_0))))))); elseif (x1 <= 2.55e+98) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * t_1) + Float64(x1 * Float64(Float64(x1 + Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + Float64(3.0 - Float64(2.0 * x2)))) + Float64(Float64(3.0 * t_0) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (x2 * -2.0); t_1 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -2e+96) tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * t_0)))))); elseif (x1 <= 2.55e+98) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * t_1) + (x1 * ((x1 + ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + ((3.0 * t_0) + ((x2 * 6.0) + (x2 * 8.0))))) - 6.0))) - 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[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+96], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.55e+98], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * t$95$1), $MachinePrecision] + N[(x1 * N[(N[(x1 + N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - x2 \cdot -2\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+96}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right) + 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+98}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot t\_1 + x1 \cdot \left(\left(x1 + \left(2 \cdot \left(x2 \cdot -2 + \left(3 - 2 \cdot x2\right)\right) + \left(3 \cdot t\_0 + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.0000000000000001e96Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.8%
if -2.0000000000000001e96 < x1 < 2.54999999999999994e98Initial program 98.7%
Simplified88.9%
Taylor expanded in x1 around 0 67.7%
fma-define67.7%
*-commutative67.7%
fmm-def67.7%
metadata-eval67.7%
cancel-sign-sub-inv67.7%
*-commutative67.7%
metadata-eval67.7%
Simplified67.7%
Taylor expanded in x2 around 0 75.8%
if 2.54999999999999994e98 < x1 Initial program 27.8%
Taylor expanded in x1 around 0 25.9%
Taylor expanded in x1 around 0 79.6%
Taylor expanded in x1 around 0 96.3%
Final simplification75.1%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x2 -1.5) (not (<= x2 1e+135)))
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
(* x2 -6.0)
(*
x1
(+
-1.0
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(+
3.0
(+ (* 2.0 (+ 3.0 (* x2 -4.0))) (+ (* x2 6.0) (* x2 8.0)))))))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5) || !(x2 <= 1e+135)) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.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 ((x2 <= (-1.5d0)) .or. (.not. (x2 <= 1d+135))) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (3.0d0 + ((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((x2 * 6.0d0) + (x2 * 8.0d0))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5) || !(x2 <= 1e+135)) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + (x2 * 8.0))))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.5) or not (x2 <= 1e+135): tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + (x2 * 8.0)))))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.5) || !(x2 <= 1e+135)) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(3.0 + Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.5) || ~((x2 <= 1e+135))) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (3.0 + ((2.0 * (3.0 + (x2 * -4.0))) + ((x2 * 6.0) + (x2 * 8.0)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.5], N[Not[LessEqual[x2, 1e+135]], $MachinePrecision]], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(3.0 + N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.5 \lor \neg \left(x2 \leq 10^{+135}\right):\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(3 + \left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(x2 \cdot 6 + x2 \cdot 8\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x2 < -1.5 or 9.99999999999999962e134 < x2 Initial program 66.5%
Simplified51.3%
Taylor expanded in x1 around 0 59.9%
fma-define59.9%
*-commutative59.9%
fmm-def59.9%
metadata-eval59.9%
cancel-sign-sub-inv59.9%
*-commutative59.9%
metadata-eval59.9%
Simplified59.9%
Taylor expanded in x2 around 0 74.1%
if -1.5 < x2 < 9.99999999999999962e134Initial program 69.9%
Simplified76.3%
Taylor expanded in x1 around 0 75.1%
Taylor expanded in x1 around 0 72.9%
Final simplification73.3%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x2 -1.5) (not (<= x2 2.7e+136)))
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* 3.0 (+ (* x2 -2.0) (* x1 (+ -1.0 (* x1 (- 3.0 (* x2 -2.0)))))))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5) || !(x2 <= 2.7e+136)) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -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.5d0)) .or. (.not. (x2 <= 2.7d+136))) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) + (x1 * (3.0d0 - (x2 * (-2.0d0)))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5) || !(x2 <= 2.7e+136)) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0))))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.5) or not (x2 <= 2.7e+136): tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0)))))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.5) || !(x2 <= 2.7e+136)) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(3.0 - Float64(x2 * -2.0))))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.5) || ~((x2 <= 2.7e+136))) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 + (x1 * (3.0 - (x2 * -2.0)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.5], N[Not[LessEqual[x2, 2.7e+136]], $MachinePrecision]], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.5 \lor \neg \left(x2 \leq 2.7 \cdot 10^{+136}\right):\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 + x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x2 < -1.5 or 2.7000000000000002e136 < x2 Initial program 66.5%
Simplified51.3%
Taylor expanded in x1 around 0 59.9%
fma-define59.9%
*-commutative59.9%
fmm-def59.9%
metadata-eval59.9%
cancel-sign-sub-inv59.9%
*-commutative59.9%
metadata-eval59.9%
Simplified59.9%
Taylor expanded in x2 around 0 74.1%
if -1.5 < x2 < 2.7000000000000002e136Initial program 69.9%
Taylor expanded in x1 around 0 51.7%
Taylor expanded in x1 around 0 65.8%
Taylor expanded in x1 around 0 72.6%
Final simplification73.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -6.8e+88)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 -12.0))))
(if (or (<= x1 -3e-66) (not (<= x1 9.8e-120)))
(* x1 (+ -1.0 (* -4.0 (* x2 (- 3.0 (* 2.0 x2))))))
(+ x1 (+ (* x2 -6.0) (* x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -6.8e+88) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else if ((x1 <= -3e-66) || !(x1 <= 9.8e-120)) {
tmp = x1 * (-1.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -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 <= (-6.8d+88)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * (-12.0d0))))
else if ((x1 <= (-3d-66)) .or. (.not. (x1 <= 9.8d-120))) then
tmp = x1 * ((-1.0d0) + ((-4.0d0) * (x2 * (3.0d0 - (2.0d0 * x2)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -6.8e+88) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else if ((x1 <= -3e-66) || !(x1 <= 9.8e-120)) {
tmp = x1 * (-1.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -6.8e+88: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))) elif (x1 <= -3e-66) or not (x1 <= 9.8e-120): tmp = x1 * (-1.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -6.8e+88) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))); elseif ((x1 <= -3e-66) || !(x1 <= 9.8e-120)) tmp = Float64(x1 * Float64(-1.0 + Float64(-4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -6.8e+88) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))); elseif ((x1 <= -3e-66) || ~((x1 <= 9.8e-120))) tmp = x1 * (-1.0 + (-4.0 * (x2 * (3.0 - (2.0 * x2))))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -6.8e+88], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -3e-66], N[Not[LessEqual[x1, 9.8e-120]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(-4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.8 \cdot 10^{+88}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{-66} \lor \neg \left(x1 \leq 9.8 \cdot 10^{-120}\right):\\
\;\;\;\;x1 \cdot \left(-1 + -4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -6.80000000000000008e88Initial program 4.9%
Simplified4.9%
Taylor expanded in x1 around 0 3.3%
Taylor expanded in x2 around 0 16.1%
*-commutative16.1%
Simplified16.1%
if -6.80000000000000008e88 < x1 < -3.0000000000000002e-66 or 9.8000000000000007e-120 < x1 Initial program 71.9%
Simplified67.4%
Taylor expanded in x1 around 0 53.4%
fma-define53.4%
*-commutative53.4%
fmm-def53.4%
metadata-eval53.4%
cancel-sign-sub-inv53.4%
*-commutative53.4%
metadata-eval53.4%
Simplified53.4%
Taylor expanded in x1 around inf 49.8%
if -3.0000000000000002e-66 < x1 < 9.8000000000000007e-120Initial program 99.4%
Simplified99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x2 around 0 87.3%
*-commutative87.3%
Simplified87.3%
Final simplification54.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -6.2e+90) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 -12.0)))) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -6.2e+90) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-6.2d+90)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * (-12.0d0))))
else
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -6.2e+90) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -6.2e+90: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))) else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -6.2e+90) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))); else tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -6.2e+90) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -6.2e+90], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+90}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\end{array}
\end{array}
if x1 < -6.19999999999999977e90Initial program 4.9%
Simplified4.9%
Taylor expanded in x1 around 0 3.3%
Taylor expanded in x2 around 0 16.1%
*-commutative16.1%
Simplified16.1%
if -6.19999999999999977e90 < x1 Initial program 80.9%
Simplified73.5%
Taylor expanded in x1 around 0 64.1%
fma-define64.1%
*-commutative64.1%
fmm-def64.1%
metadata-eval64.1%
cancel-sign-sub-inv64.1%
*-commutative64.1%
metadata-eval64.1%
Simplified64.1%
Taylor expanded in x2 around 0 70.7%
Final simplification61.9%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.3e+90) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 -12.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.3e+90) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.3d+90)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * (-12.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.3e+90) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.3e+90: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.3e+90) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.3e+90) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.3e+90], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.3 \cdot 10^{+90}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < -3.30000000000000008e90Initial program 4.9%
Simplified4.9%
Taylor expanded in x1 around 0 3.3%
Taylor expanded in x2 around 0 16.1%
*-commutative16.1%
Simplified16.1%
if -3.30000000000000008e90 < x1 Initial program 80.9%
Simplified80.9%
Taylor expanded in x1 around 0 64.1%
Taylor expanded in x2 around 0 64.1%
Final simplification56.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -7.5e-204) (not (<= x2 6.5e-123))) (* x2 (- (/ x1 x2) 6.0)) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.5e-204) || !(x2 <= 6.5e-123)) {
tmp = x2 * ((x1 / x2) - 6.0);
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-7.5d-204)) .or. (.not. (x2 <= 6.5d-123))) then
tmp = x2 * ((x1 / x2) - 6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.5e-204) || !(x2 <= 6.5e-123)) {
tmp = x2 * ((x1 / x2) - 6.0);
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -7.5e-204) or not (x2 <= 6.5e-123): tmp = x2 * ((x1 / x2) - 6.0) else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -7.5e-204) || !(x2 <= 6.5e-123)) tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -7.5e-204) || ~((x2 <= 6.5e-123))) tmp = x2 * ((x1 / x2) - 6.0); else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -7.5e-204], N[Not[LessEqual[x2, 6.5e-123]], $MachinePrecision]], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.5 \cdot 10^{-204} \lor \neg \left(x2 \leq 6.5 \cdot 10^{-123}\right):\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -7.5000000000000003e-204 or 6.49999999999999938e-123 < x2 Initial program 67.6%
Simplified61.7%
Taylor expanded in x1 around 0 27.0%
*-commutative27.0%
Simplified27.0%
Taylor expanded in x2 around inf 30.8%
if -7.5000000000000003e-204 < x2 < 6.49999999999999938e-123Initial program 71.8%
Simplified82.9%
Taylor expanded in x1 around 0 45.7%
fma-define45.8%
*-commutative45.8%
fmm-def45.8%
metadata-eval45.8%
cancel-sign-sub-inv45.8%
*-commutative45.8%
metadata-eval45.8%
Simplified45.8%
Taylor expanded in x2 around 0 41.1%
neg-mul-141.1%
Simplified41.1%
Final simplification33.5%
(FPCore (x1 x2) :precision binary64 (if (<= x1 9.5e+97) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 -12.0)))) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 9.5e+97) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = x2 * ((x1 / 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+97) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * (-12.0d0))))
else
tmp = x2 * ((x1 / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 9.5e+97) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 9.5e+97: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))) else: tmp = x2 * ((x1 / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 9.5e+97) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))); else tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 9.5e+97) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))); else tmp = x2 * ((x1 / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 9.5e+97], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 9.5 \cdot 10^{+97}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < 9.49999999999999975e97Initial program 79.6%
Simplified79.6%
Taylor expanded in x1 around 0 55.3%
Taylor expanded in x2 around 0 47.4%
*-commutative47.4%
Simplified47.4%
if 9.49999999999999975e97 < x1 Initial program 27.8%
Simplified27.8%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in x2 around inf 33.4%
Final simplification44.4%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -3.5e-144) (* x2 -6.0) (if (<= x2 2.4e-123) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -3.5e-144) {
tmp = x2 * -6.0;
} else if (x2 <= 2.4e-123) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-3.5d-144)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 2.4d-123) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -3.5e-144) {
tmp = x2 * -6.0;
} else if (x2 <= 2.4e-123) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -3.5e-144: tmp = x2 * -6.0 elif x2 <= 2.4e-123: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -3.5e-144) tmp = Float64(x2 * -6.0); elseif (x2 <= 2.4e-123) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -3.5e-144) tmp = x2 * -6.0; elseif (x2 <= 2.4e-123) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -3.5e-144], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 2.4e-123], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.5 \cdot 10^{-144}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 2.4 \cdot 10^{-123}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -3.4999999999999998e-144Initial program 68.9%
Simplified64.2%
Taylor expanded in x1 around 0 29.9%
*-commutative29.9%
Simplified29.9%
Taylor expanded in x1 around 0 30.3%
*-commutative30.3%
Simplified30.3%
if -3.4999999999999998e-144 < x2 < 2.4e-123Initial program 70.0%
Simplified80.6%
Taylor expanded in x1 around 0 44.8%
fma-define44.8%
*-commutative44.8%
fmm-def44.8%
metadata-eval44.8%
cancel-sign-sub-inv44.8%
*-commutative44.8%
metadata-eval44.8%
Simplified44.8%
Taylor expanded in x2 around 0 38.6%
neg-mul-138.6%
Simplified38.6%
if 2.4e-123 < x2 Initial program 67.5%
Simplified58.7%
Taylor expanded in x1 around 0 25.7%
*-commutative25.7%
Simplified25.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 0.19) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 0.19) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x2 * ((x1 / 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 <= 0.19d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x2 * ((x1 / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 0.19) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 0.19: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x2 * ((x1 / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 0.19) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 0.19) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x2 * ((x1 / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 0.19], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 0.19:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < 0.19Initial program 77.5%
Simplified77.5%
Taylor expanded in x1 around 0 59.0%
Taylor expanded in x2 around 0 49.6%
*-commutative49.6%
Simplified49.6%
if 0.19 < x1 Initial program 48.5%
Simplified47.3%
Taylor expanded in x1 around 0 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x2 around inf 25.9%
Final simplification42.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.95e-144) (not (<= x2 6.5e-123))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.95e-144) || !(x2 <= 6.5e-123)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.95d-144)) .or. (.not. (x2 <= 6.5d-123))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.95e-144) || !(x2 <= 6.5e-123)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.95e-144) or not (x2 <= 6.5e-123): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.95e-144) || !(x2 <= 6.5e-123)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.95e-144) || ~((x2 <= 6.5e-123))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.95e-144], N[Not[LessEqual[x2, 6.5e-123]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.95 \cdot 10^{-144} \lor \neg \left(x2 \leq 6.5 \cdot 10^{-123}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -1.95000000000000007e-144 or 6.49999999999999938e-123 < x2 Initial program 68.1%
Simplified61.2%
Taylor expanded in x1 around 0 27.6%
*-commutative27.6%
Simplified27.6%
Taylor expanded in x1 around 0 27.2%
*-commutative27.2%
Simplified27.2%
if -1.95000000000000007e-144 < x2 < 6.49999999999999938e-123Initial program 70.0%
Simplified80.6%
Taylor expanded in x1 around 0 44.8%
fma-define44.8%
*-commutative44.8%
fmm-def44.8%
metadata-eval44.8%
cancel-sign-sub-inv44.8%
*-commutative44.8%
metadata-eval44.8%
Simplified44.8%
Taylor expanded in x2 around 0 38.6%
neg-mul-138.6%
Simplified38.6%
Final simplification30.7%
(FPCore (x1 x2) :precision binary64 (if (<= x1 0.19) (- x1) x1))
double code(double x1, double x2) {
double tmp;
if (x1 <= 0.19) {
tmp = -x1;
} else {
tmp = x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 0.19d0) then
tmp = -x1
else
tmp = x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 0.19) {
tmp = -x1;
} else {
tmp = x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 0.19: tmp = -x1 else: tmp = x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 0.19) tmp = Float64(-x1); else tmp = x1; end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 0.19) tmp = -x1; else tmp = x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 0.19], (-x1), x1]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 0.19:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1\\
\end{array}
\end{array}
if x1 < 0.19Initial program 77.5%
Simplified75.9%
Taylor expanded in x1 around 0 59.0%
fma-define59.1%
*-commutative59.1%
fmm-def59.1%
metadata-eval59.1%
cancel-sign-sub-inv59.1%
*-commutative59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in x2 around 0 21.8%
neg-mul-121.8%
Simplified21.8%
if 0.19 < x1 Initial program 48.5%
Simplified47.3%
Taylor expanded in x1 around 0 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x1 around inf 5.9%
(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 68.7%
Simplified67.2%
Taylor expanded in x1 around 0 21.6%
*-commutative21.6%
Simplified21.6%
Taylor expanded in x1 around inf 3.4%
herbie shell --seed 2024117
(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))))))