
(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 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_2 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_4 4.0 -6.0)) (* (* x1 (* 2.0 t_4)) (+ t_4 -3.0)))
(fma t_1 t_4 (pow x1 3.0))))))
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_2 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_4)) * (t_4 + -3.0))), fma(t_1, t_4, pow(x1, 3.0)))));
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_2 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_4)) * Float64(t_4 + -3.0))), fma(t_1, t_4, (x1 ^ 3.0)))))); else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $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$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $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$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - 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$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
t_4 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_2 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \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_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_4\right)\right) \cdot \left(t_4 + -3\right)\right), \mathsf{fma}\left(t_1, t_4, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.0%
*-commutative2.0%
Simplified2.0%
add-cbrt-cube28.2%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
t_0
(fma
(fma (* (* x1 2.0) t_4) (+ -3.0 t_4) (* (* x1 x1) (fma 4.0 t_4 -6.0)))
(fma x1 x1 1.0)
(* t_1 t_4)))
(+ x1 (* 3.0 (/ (- t_1 (+ x1 (* 2.0 x2))) (fma x1 x1 1.0))))))
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_0 + fma(fma(((x1 * 2.0) * t_4), (-3.0 + t_4), ((x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), (t_1 * t_4))) + (x1 + (3.0 * ((t_1 - (x1 + (2.0 * x2))) / fma(x1, x1, 1.0)))));
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_0 + fma(fma(Float64(Float64(x1 * 2.0) * t_4), Float64(-3.0 + t_4), Float64(Float64(x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), Float64(t_1 * t_4))) + Float64(x1 + Float64(3.0 * Float64(Float64(t_1 - Float64(x1 + Float64(2.0 * x2))) / fma(x1, x1, 1.0)))))); else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $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] + t$95$0), $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[(N[(t$95$0 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(-3.0 + t$95$4), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$4 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\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) + t_0\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t_0 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t_4, -3 + t_4, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t_4, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t_1 \cdot t_4\right)\right) + \left(x1 + 3 \cdot \frac{t_1 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.0%
*-commutative2.0%
Simplified2.0%
add-cbrt-cube28.2%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY)
t_3
(pow (pow (fma x2 -6.0 x1) 3.0) 0.3333333333333333))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = pow(pow(fma(x2, -6.0, x1), 3.0), 0.3333333333333333);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = (fma(x2, -6.0, x1) ^ 3.0) ^ 0.3333333333333333; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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$1 * t$95$2), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[Power[N[Power[N[(x2 * -6.0 + x1), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{fma}\left(x2, -6, x1\right)\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.0%
*-commutative2.0%
Simplified2.0%
add-cbrt-cube28.2%
pow1/3100.0%
pow3100.0%
+-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY)
t_3
(+
x1
(+
(+
x1
(+
(* -2.0 (- (* x2 4.0) 3.0))
(* 2.0 (/ (+ (* 2.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0) x1))))
(+
(+ (* x1 -3.0) (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))
(* x2 -6.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + ((-2.0 * ((x2 * 4.0) - 3.0)) + (2.0 * (((2.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) / x1)))) + (((x1 * -3.0) + (3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0))))) + (x2 * -6.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + ((-2.0 * ((x2 * 4.0) - 3.0)) + (2.0 * (((2.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) / x1)))) + (((x1 * -3.0) + (3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))))) + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + ((-2.0 * ((x2 * 4.0) - 3.0)) + (2.0 * (((2.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) / x1)))) + (((x1 * -3.0) + (3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))))) + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(-2.0 * Float64(Float64(x2 * 4.0) - 3.0)) + Float64(2.0 * Float64(Float64(Float64(2.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0) / x1)))) + Float64(Float64(Float64(x1 * -3.0) + Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0))))) + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + ((-2.0 * ((x2 * 4.0) - 3.0)) + (2.0 * (((2.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) / x1)))) + (((x1 * -3.0) + (3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0))))) + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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$1 * t$95$2), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(N[(-2.0 * N[(N[(x2 * 4.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(N[(2.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * -3.0), $MachinePrecision] + N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(-2 \cdot \left(x2 \cdot 4 - 3\right) + 2 \cdot \frac{2 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1}{x1}\right)\right) + \left(\left(x1 \cdot -3 + 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\right) + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around -inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 70.9%
Final simplification91.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY)
t_3
(+
x1
(+
(+
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))
(* x2 -6.0))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) + (x2 * -6.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) + (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0))) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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$1 * t$95$2), $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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 61.0%
Final simplification88.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(if (<= x1 -9e+140)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -5e+106)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
t_3))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -9e+140) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -5e+106) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3);
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
if (x1 <= (-9d+140)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-5d+106)) then
tmp = x1 + (t_3 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3)
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -9e+140) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -5e+106) {
tmp = x1 + (t_3 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3);
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) tmp = 0 if x1 <= -9e+140: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -5e+106: tmp = x1 + (t_3 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) tmp = 0.0 if (x1 <= -9e+140) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -5e+106) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * 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)))) + t_3)); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); tmp = 0.0; if (x1 <= -9e+140) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -5e+106) tmp = x1 + (t_3 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + t_3); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9e+140], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5e+106], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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}\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -9 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+106}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\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) + t_3\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -9.0000000000000003e140Initial program 2.4%
Taylor expanded in x1 around 0 2.4%
Taylor expanded in x1 around 0 6.0%
fma-def6.0%
fma-neg6.0%
fma-neg6.0%
metadata-eval6.0%
metadata-eval6.0%
Simplified6.0%
Taylor expanded in x2 around 0 28.4%
if -9.0000000000000003e140 < x1 < -4.9999999999999998e106Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -4.9999999999999998e106 < x1 < 1.35000000000000003e154Initial program 99.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification83.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- 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))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (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)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (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)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (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))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * 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)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (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))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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 -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\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{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.4%
fma-def5.4%
fma-neg5.4%
fma-neg5.4%
metadata-eval5.4%
metadata-eval5.4%
Simplified5.4%
Taylor expanded in x2 around 0 27.0%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification81.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x2 (- (* 2.0 x2) 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_6 (* t_3 (+ t_5 (* 4.0 (* x1 t_2)))))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)))
(t_8 (* t_1 t_4)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -1.6e+44)
(+ x1 (+ t_7 (+ x1 (+ t_0 (+ t_8 (* t_3 (+ t_5 (* x1 2.0))))))))
(if (<= x1 -4.6e-206)
(+ x1 (+ t_7 (+ x1 (+ t_0 (+ (* 3.0 t_1) t_6)))))
(if (<= x1 1.16e-164)
(- (* x2 -6.0) x1)
(if (<= x1 1.35e+154)
(+ x1 (+ t_7 (+ x1 (+ t_0 (+ t_8 t_6)))))
(+ x1 (* x1 (+ 1.0 (* 4.0 t_2)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = t_3 * (t_5 + (4.0 * (x1 * t_2)));
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_8 = t_1 * t_4;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -1.6e+44) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + (t_3 * (t_5 + (x1 * 2.0)))))));
} else if (x1 <= -4.6e-206) {
tmp = x1 + (t_7 + (x1 + (t_0 + ((3.0 * t_1) + t_6))));
} else if (x1 <= 1.16e-164) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + t_6))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_2)));
}
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) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x2 * ((2.0d0 * x2) - 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_5 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_6 = t_3 * (t_5 + (4.0d0 * (x1 * t_2)))
t_7 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
t_8 = t_1 * t_4
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-1.6d+44)) then
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + (t_3 * (t_5 + (x1 * 2.0d0)))))))
else if (x1 <= (-4.6d-206)) then
tmp = x1 + (t_7 + (x1 + (t_0 + ((3.0d0 * t_1) + t_6))))
else if (x1 <= 1.16d-164) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + t_6))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = t_3 * (t_5 + (4.0 * (x1 * t_2)));
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_8 = t_1 * t_4;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -1.6e+44) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + (t_3 * (t_5 + (x1 * 2.0)))))));
} else if (x1 <= -4.6e-206) {
tmp = x1 + (t_7 + (x1 + (t_0 + ((3.0 * t_1) + t_6))));
} else if (x1 <= 1.16e-164) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + t_6))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = x2 * ((2.0 * x2) - 3.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_6 = t_3 * (t_5 + (4.0 * (x1 * t_2))) t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) t_8 = t_1 * t_4 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -1.6e+44: tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + (t_3 * (t_5 + (x1 * 2.0))))))) elif x1 <= -4.6e-206: tmp = x1 + (t_7 + (x1 + (t_0 + ((3.0 * t_1) + t_6)))) elif x1 <= 1.16e-164: tmp = (x2 * -6.0) - x1 elif x1 <= 1.35e+154: tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + t_6)))) else: tmp = x1 + (x1 * (1.0 + (4.0 * t_2))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_6 = Float64(t_3 * Float64(t_5 + Float64(4.0 * Float64(x1 * t_2)))) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) t_8 = Float64(t_1 * t_4) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -1.6e+44) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_8 + Float64(t_3 * Float64(t_5 + Float64(x1 * 2.0)))))))); elseif (x1 <= -4.6e-206) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_1) + t_6))))); elseif (x1 <= 1.16e-164) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_8 + t_6))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = x2 * ((2.0 * x2) - 3.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_6 = t_3 * (t_5 + (4.0 * (x1 * t_2))); t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); t_8 = t_1 * t_4; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -1.6e+44) tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + (t_3 * (t_5 + (x1 * 2.0))))))); elseif (x1 <= -4.6e-206) tmp = x1 + (t_7 + (x1 + (t_0 + ((3.0 * t_1) + t_6)))); elseif (x1 <= 1.16e-164) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.35e+154) tmp = x1 + (t_7 + (x1 + (t_0 + (t_8 + t_6)))); else tmp = x1 + (x1 * (1.0 + (4.0 * t_2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 * N[(t$95$5 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.6e+44], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$8 + N[(t$95$3 * N[(t$95$5 + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.6e-206], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$1), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-164], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$8 + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_6 := t_3 \cdot \left(t_5 + 4 \cdot \left(x1 \cdot t_2\right)\right)\\
t_7 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3}\\
t_8 := t_1 \cdot t_4\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{+44}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(t_8 + t_3 \cdot \left(t_5 + x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -4.6 \cdot 10^{-206}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(3 \cdot t_1 + t_6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-164}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(t_8 + t_6\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_2\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.4%
fma-def5.4%
fma-neg5.4%
fma-neg5.4%
metadata-eval5.4%
metadata-eval5.4%
Simplified5.4%
Taylor expanded in x2 around 0 27.0%
if -5.60000000000000037e102 < x1 < -1.60000000000000002e44Initial program 99.7%
Taylor expanded in x1 around 0 73.3%
+-commutative73.3%
mul-1-neg73.3%
unsub-neg73.3%
Simplified73.3%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
if -1.60000000000000002e44 < x1 < -4.6e-206Initial program 99.0%
Taylor expanded in x1 around 0 91.8%
+-commutative91.8%
mul-1-neg91.8%
unsub-neg91.8%
Simplified91.8%
Taylor expanded in x1 around 0 86.7%
Taylor expanded in x1 around inf 86.7%
if -4.6e-206 < x1 < 1.16e-164Initial program 99.5%
Taylor expanded in x1 around 0 79.7%
Taylor expanded in x1 around 0 79.9%
fma-def80.1%
fma-neg80.1%
fma-neg80.1%
metadata-eval80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in x2 around 0 94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in x1 around 0 94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
if 1.16e-164 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 89.7%
+-commutative89.7%
mul-1-neg89.7%
unsub-neg89.7%
Simplified89.7%
Taylor expanded in x1 around 0 88.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification75.0%
(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 (<= x1 -5.6e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.35e+154) 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(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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 -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;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(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.4%
fma-def5.4%
fma-neg5.4%
fma-neg5.4%
metadata-eval5.4%
metadata-eval5.4%
Simplified5.4%
Taylor expanded in x2 around 0 27.0%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 99.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification81.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 (<= x1 -2.4e+98)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 7e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -2.4e+98) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 7e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-2.4d+98)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 7d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -2.4e+98) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 7e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -2.4e+98: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 7e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -2.4e+98) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 7e+153) 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(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -2.4e+98) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 7e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -2.4e+98], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7e+153], 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[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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.4 \cdot 10^{+98}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 7 \cdot 10^{+153}:\\
\;\;\;\;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(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3999999999999999e98Initial program 4.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.2%
fma-def5.2%
fma-neg5.2%
fma-neg5.2%
metadata-eval5.2%
metadata-eval5.2%
Simplified5.2%
Taylor expanded in x2 around 0 26.4%
if -2.3999999999999999e98 < x1 < 6.9999999999999998e153Initial program 99.4%
Taylor expanded in x1 around 0 92.8%
+-commutative92.8%
mul-1-neg92.8%
unsub-neg92.8%
Simplified92.8%
Taylor expanded in x1 around inf 92.8%
if 6.9999999999999998e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification76.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_6 (* x1 (* x1 x1)))
(t_7
(+
x1
(+
t_3
(+
x1
(+ t_6 (+ (* 3.0 t_0) (* t_2 (+ t_5 (* 4.0 (* x1 t_1)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -4.4e+46)
(+ x1 (+ t_3 (+ x1 (+ t_6 (+ (* t_0 t_4) (* t_2 (+ t_5 (* x1 2.0))))))))
(if (<= x1 -5e-206)
t_7
(if (<= x1 4.8e-163)
(- (* x2 -6.0) x1)
(if (<= x1 1.35e+154) t_7 (+ x1 (* x1 (+ 1.0 (* 4.0 t_1)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = x1 * (x1 * x1);
double t_7 = x1 + (t_3 + (x1 + (t_6 + ((3.0 * t_0) + (t_2 * (t_5 + (4.0 * (x1 * t_1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.4e+46) {
tmp = x1 + (t_3 + (x1 + (t_6 + ((t_0 * t_4) + (t_2 * (t_5 + (x1 * 2.0)))))));
} else if (x1 <= -5e-206) {
tmp = t_7;
} else if (x1 <= 4.8e-163) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_7;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_5 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_6 = x1 * (x1 * x1)
t_7 = x1 + (t_3 + (x1 + (t_6 + ((3.0d0 * t_0) + (t_2 * (t_5 + (4.0d0 * (x1 * t_1))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-4.4d+46)) then
tmp = x1 + (t_3 + (x1 + (t_6 + ((t_0 * t_4) + (t_2 * (t_5 + (x1 * 2.0d0)))))))
else if (x1 <= (-5d-206)) then
tmp = t_7
else if (x1 <= 4.8d-163) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = t_7
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = x1 * (x1 * x1);
double t_7 = x1 + (t_3 + (x1 + (t_6 + ((3.0 * t_0) + (t_2 * (t_5 + (4.0 * (x1 * t_1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.4e+46) {
tmp = x1 + (t_3 + (x1 + (t_6 + ((t_0 * t_4) + (t_2 * (t_5 + (x1 * 2.0)))))));
} else if (x1 <= -5e-206) {
tmp = t_7;
} else if (x1 <= 4.8e-163) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_7;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_6 = x1 * (x1 * x1) t_7 = x1 + (t_3 + (x1 + (t_6 + ((3.0 * t_0) + (t_2 * (t_5 + (4.0 * (x1 * t_1)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -4.4e+46: tmp = x1 + (t_3 + (x1 + (t_6 + ((t_0 * t_4) + (t_2 * (t_5 + (x1 * 2.0))))))) elif x1 <= -5e-206: tmp = t_7 elif x1 <= 4.8e-163: tmp = (x2 * -6.0) - x1 elif x1 <= 1.35e+154: tmp = t_7 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_6 = Float64(x1 * Float64(x1 * x1)) t_7 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_6 + Float64(Float64(3.0 * t_0) + Float64(t_2 * Float64(t_5 + Float64(4.0 * Float64(x1 * t_1))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -4.4e+46) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_6 + Float64(Float64(t_0 * t_4) + Float64(t_2 * Float64(t_5 + Float64(x1 * 2.0)))))))); elseif (x1 <= -5e-206) tmp = t_7; elseif (x1 <= 4.8e-163) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.35e+154) tmp = t_7; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_6 = x1 * (x1 * x1); t_7 = x1 + (t_3 + (x1 + (t_6 + ((3.0 * t_0) + (t_2 * (t_5 + (4.0 * (x1 * t_1)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -4.4e+46) tmp = x1 + (t_3 + (x1 + (t_6 + ((t_0 * t_4) + (t_2 * (t_5 + (x1 * 2.0))))))); elseif (x1 <= -5e-206) tmp = t_7; elseif (x1 <= 4.8e-163) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.35e+154) tmp = t_7; else tmp = x1 + (x1 * (1.0 + (4.0 * t_1))); 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[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$6 + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$2 * N[(t$95$5 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.4e+46], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$6 + N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$2 * N[(t$95$5 + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5e-206], t$95$7, If[LessEqual[x1, 4.8e-163], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$7, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(3 \cdot t_0 + t_2 \cdot \left(t_5 + 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{+46}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_6 + \left(t_0 \cdot t_4 + t_2 \cdot \left(t_5 + x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{-206}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-163}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_7\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_1\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.4%
fma-def5.4%
fma-neg5.4%
fma-neg5.4%
metadata-eval5.4%
metadata-eval5.4%
Simplified5.4%
Taylor expanded in x2 around 0 27.0%
if -5.60000000000000037e102 < x1 < -4.4000000000000001e46Initial program 99.7%
Taylor expanded in x1 around 0 73.3%
+-commutative73.3%
mul-1-neg73.3%
unsub-neg73.3%
Simplified73.3%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
if -4.4000000000000001e46 < x1 < -5e-206 or 4.8000000000000001e-163 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 90.6%
+-commutative90.6%
mul-1-neg90.6%
unsub-neg90.6%
Simplified90.6%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x1 around inf 87.5%
if -5e-206 < x1 < 4.8000000000000001e-163Initial program 99.5%
Taylor expanded in x1 around 0 79.7%
Taylor expanded in x1 around 0 79.9%
fma-def80.1%
fma-neg80.1%
fma-neg80.1%
metadata-eval80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in x2 around 0 94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in x1 around 0 94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification75.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_2
(+
(* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_2) 4.0) 6.0))
(* 4.0 (* x1 t_0)))))))))))
(if (<= x1 -2.4e+98)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -4.4e-204)
t_3
(if (<= x1 1.32e-164)
(- (* x2 -6.0) x1)
(if (<= x1 1.35e+154) t_3 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (4.0 * (x1 * t_0))))))));
double tmp;
if (x1 <= -2.4e+98) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.4e-204) {
tmp = t_3;
} else if (x1 <= 1.32e-164) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_2) * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * t_0))))))))
if (x1 <= (-2.4d+98)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-4.4d-204)) then
tmp = t_3
else if (x1 <= 1.32d-164) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (4.0 * (x1 * t_0))))))));
double tmp;
if (x1 <= -2.4e+98) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.4e-204) {
tmp = t_3;
} else if (x1 <= 1.32e-164) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (4.0 * (x1 * t_0)))))))) tmp = 0 if x1 <= -2.4e+98: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -4.4e-204: tmp = t_3 elif x1 <= 1.32e-164: tmp = (x2 * -6.0) - x1 elif x1 <= 1.35e+154: tmp = t_3 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = 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(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * t_0))))))))) tmp = 0.0 if (x1 <= -2.4e+98) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -4.4e-204) tmp = t_3; elseif (x1 <= 1.32e-164) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (4.0 * (x1 * t_0)))))))); tmp = 0.0; if (x1 <= -2.4e+98) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -4.4e-204) tmp = t_3; elseif (x1 <= 1.32e-164) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.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[(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[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e+98], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.4e-204], t$95$3, If[LessEqual[x1, 1.32e-164], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$3, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 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(3 \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2} \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+98}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-204}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{-164}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -2.3999999999999999e98Initial program 4.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.2%
fma-def5.2%
fma-neg5.2%
fma-neg5.2%
metadata-eval5.2%
metadata-eval5.2%
Simplified5.2%
Taylor expanded in x2 around 0 26.4%
if -2.3999999999999999e98 < x1 < -4.3999999999999997e-204 or 1.3199999999999999e-164 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 89.8%
+-commutative89.8%
mul-1-neg89.8%
unsub-neg89.8%
Simplified89.8%
Taylor expanded in x1 around 0 85.3%
Taylor expanded in x1 around inf 85.3%
if -4.3999999999999997e-204 < x1 < 1.3199999999999999e-164Initial program 99.5%
Taylor expanded in x1 around 0 79.7%
Taylor expanded in x1 around 0 79.9%
fma-def80.1%
fma-neg80.1%
fma-neg80.1%
metadata-eval80.1%
metadata-eval80.1%
Simplified80.1%
Taylor expanded in x2 around 0 94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in x1 around 0 94.3%
mul-1-neg94.3%
unsub-neg94.3%
*-commutative94.3%
Simplified94.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 53.3%
Final simplification73.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -7e+80)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (or (<= x1 -2.5e-205) (not (<= x1 5.5e-191)))
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -7e+80) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -2.5e-205) || !(x1 <= 5.5e-191)) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (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 <= (-7d+80)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if ((x1 <= (-2.5d-205)) .or. (.not. (x1 <= 5.5d-191))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -7e+80) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -2.5e-205) || !(x1 <= 5.5e-191)) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -7e+80: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif (x1 <= -2.5e-205) or not (x1 <= 5.5e-191): tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -7e+80) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif ((x1 <= -2.5e-205) || !(x1 <= 5.5e-191)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -7e+80) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif ((x1 <= -2.5e-205) || ~((x1 <= 5.5e-191))) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -7e+80], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -2.5e-205], N[Not[LessEqual[x1, 5.5e-191]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7 \cdot 10^{+80}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -2.5 \cdot 10^{-205} \lor \neg \left(x1 \leq 5.5 \cdot 10^{-191}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -6.99999999999999987e80Initial program 11.3%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 5.0%
fma-def5.0%
fma-neg5.0%
fma-neg5.0%
metadata-eval5.0%
metadata-eval5.0%
Simplified5.0%
Taylor expanded in x2 around 0 24.7%
if -6.99999999999999987e80 < x1 < -2.5e-205 or 5.5000000000000001e-191 < x1 Initial program 83.4%
Taylor expanded in x1 around 0 55.4%
Taylor expanded in x1 around 0 63.4%
fma-def63.5%
fma-neg63.5%
fma-neg63.5%
metadata-eval63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in x1 around 0 63.4%
if -2.5e-205 < x1 < 5.5000000000000001e-191Initial program 99.5%
Taylor expanded in x1 around 0 79.9%
Taylor expanded in x1 around 0 80.1%
fma-def80.3%
fma-neg80.3%
fma-neg80.3%
metadata-eval80.3%
metadata-eval80.3%
Simplified80.3%
Taylor expanded in x2 around 0 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in x1 around 0 95.6%
mul-1-neg95.6%
unsub-neg95.6%
*-commutative95.6%
Simplified95.6%
Final simplification62.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(if (<= x1 -4.8e+78)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -4.8e-74)
(* x1 (+ t_0 -1.0))
(if (<= x1 1.5e-24)
(- (* x2 -6.0) x1)
(+ x1 (+ (* x1 (+ 1.0 t_0)) 9.0)))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -4.8e+78) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.8e-74) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 1.5e-24) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + ((x1 * (1.0 + t_0)) + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
if (x1 <= (-4.8d+78)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-4.8d-74)) then
tmp = x1 * (t_0 + (-1.0d0))
else if (x1 <= 1.5d-24) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 + ((x1 * (1.0d0 + t_0)) + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -4.8e+78) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4.8e-74) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 1.5e-24) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + ((x1 * (1.0 + t_0)) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) tmp = 0 if x1 <= -4.8e+78: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -4.8e-74: tmp = x1 * (t_0 + -1.0) elif x1 <= 1.5e-24: tmp = (x2 * -6.0) - x1 else: tmp = x1 + ((x1 * (1.0 + t_0)) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) tmp = 0.0 if (x1 <= -4.8e+78) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -4.8e-74) tmp = Float64(x1 * Float64(t_0 + -1.0)); elseif (x1 <= 1.5e-24) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(1.0 + t_0)) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); tmp = 0.0; if (x1 <= -4.8e+78) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -4.8e-74) tmp = x1 * (t_0 + -1.0); elseif (x1 <= 1.5e-24) tmp = (x2 * -6.0) - x1; else tmp = x1 + ((x1 * (1.0 + t_0)) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+78], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.8e-74], N[(x1 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-24], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+78}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-74}:\\
\;\;\;\;x1 \cdot \left(t_0 + -1\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-24}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(1 + t_0\right) + 9\right)\\
\end{array}
\end{array}
if x1 < -4.7999999999999997e78Initial program 11.3%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 5.0%
fma-def5.0%
fma-neg5.0%
fma-neg5.0%
metadata-eval5.0%
metadata-eval5.0%
Simplified5.0%
Taylor expanded in x2 around 0 24.7%
if -4.7999999999999997e78 < x1 < -4.7999999999999998e-74Initial program 98.9%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 64.4%
fma-def64.4%
fma-neg64.4%
fma-neg64.4%
metadata-eval64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in x1 around inf 62.1%
if -4.7999999999999998e-74 < x1 < 1.49999999999999998e-24Initial program 99.3%
Taylor expanded in x1 around 0 83.1%
Taylor expanded in x1 around 0 83.4%
fma-def83.6%
fma-neg83.6%
fma-neg83.6%
metadata-eval83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in x2 around 0 82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in x1 around 0 82.6%
mul-1-neg82.6%
unsub-neg82.6%
*-commutative82.6%
Simplified82.6%
if 1.49999999999999998e-24 < x1 Initial program 61.8%
Taylor expanded in x1 around 0 26.1%
Taylor expanded in x1 around inf 46.4%
Final simplification58.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(if (<= x1 -3.8e+82)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -5.7e-74)
(* x1 (+ t_0 -1.0))
(if (<= x1 4.8e-20) (- (* x2 -6.0) x1) (+ x1 (* x1 (+ 1.0 t_0))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -3.8e+82) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -5.7e-74) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 4.8e-20) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
if (x1 <= (-3.8d+82)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-5.7d-74)) then
tmp = x1 * (t_0 + (-1.0d0))
else if (x1 <= 4.8d-20) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 + (x1 * (1.0d0 + t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -3.8e+82) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -5.7e-74) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 4.8e-20) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) tmp = 0 if x1 <= -3.8e+82: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -5.7e-74: tmp = x1 * (t_0 + -1.0) elif x1 <= 4.8e-20: tmp = (x2 * -6.0) - x1 else: tmp = x1 + (x1 * (1.0 + t_0)) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) tmp = 0.0 if (x1 <= -3.8e+82) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -5.7e-74) tmp = Float64(x1 * Float64(t_0 + -1.0)); elseif (x1 <= 4.8e-20) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); tmp = 0.0; if (x1 <= -3.8e+82) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -5.7e-74) tmp = x1 * (t_0 + -1.0); elseif (x1 <= 4.8e-20) tmp = (x2 * -6.0) - x1; else tmp = x1 + (x1 * (1.0 + t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+82], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.7e-74], N[(x1 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e-20], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -5.7 \cdot 10^{-74}:\\
\;\;\;\;x1 \cdot \left(t_0 + -1\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-20}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t_0\right)\\
\end{array}
\end{array}
if x1 < -3.80000000000000033e82Initial program 11.3%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 5.0%
fma-def5.0%
fma-neg5.0%
fma-neg5.0%
metadata-eval5.0%
metadata-eval5.0%
Simplified5.0%
Taylor expanded in x2 around 0 24.7%
if -3.80000000000000033e82 < x1 < -5.70000000000000025e-74Initial program 98.9%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 64.4%
fma-def64.4%
fma-neg64.4%
fma-neg64.4%
metadata-eval64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in x1 around inf 62.1%
if -5.70000000000000025e-74 < x1 < 4.79999999999999986e-20Initial program 99.3%
Taylor expanded in x1 around 0 83.1%
Taylor expanded in x1 around 0 83.4%
fma-def83.6%
fma-neg83.6%
fma-neg83.6%
metadata-eval83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in x2 around 0 82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in x1 around 0 82.6%
mul-1-neg82.6%
unsub-neg82.6%
*-commutative82.6%
Simplified82.6%
if 4.79999999999999986e-20 < x1 Initial program 61.8%
Taylor expanded in x1 around 0 26.1%
Taylor expanded in x1 around inf 46.4%
Final simplification58.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.35e+82)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (or (<= x1 -1.2e-75) (not (<= x1 1.2e-110)))
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.35e+82) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -1.2e-75) || !(x1 <= 1.2e-110)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (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 <= (-1.35d+82)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if ((x1 <= (-1.2d-75)) .or. (.not. (x1 <= 1.2d-110))) then
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.35e+82) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -1.2e-75) || !(x1 <= 1.2e-110)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.35e+82: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif (x1 <= -1.2e-75) or not (x1 <= 1.2e-110): tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.35e+82) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif ((x1 <= -1.2e-75) || !(x1 <= 1.2e-110)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.35e+82) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif ((x1 <= -1.2e-75) || ~((x1 <= 1.2e-110))) tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.35e+82], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.2e-75], N[Not[LessEqual[x1, 1.2e-110]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-75} \lor \neg \left(x1 \leq 1.2 \cdot 10^{-110}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.35e82Initial program 11.3%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 5.0%
fma-def5.0%
fma-neg5.0%
fma-neg5.0%
metadata-eval5.0%
metadata-eval5.0%
Simplified5.0%
Taylor expanded in x2 around 0 24.7%
if -1.35e82 < x1 < -1.2000000000000001e-75 or 1.20000000000000003e-110 < x1 Initial program 78.5%
Taylor expanded in x1 around 0 44.0%
Taylor expanded in x1 around 0 54.4%
fma-def54.4%
fma-neg54.4%
fma-neg54.4%
metadata-eval54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in x1 around inf 52.0%
if -1.2000000000000001e-75 < x1 < 1.20000000000000003e-110Initial program 99.3%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x1 around 0 84.9%
fma-def85.1%
fma-neg85.1%
fma-neg85.1%
metadata-eval85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in x2 around 0 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in x1 around 0 87.3%
mul-1-neg87.3%
unsub-neg87.3%
*-commutative87.3%
Simplified87.3%
Final simplification58.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.9e-72) (not (<= x1 1.75e-110))) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.9e-72) || !(x1 <= 1.75e-110)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (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 <= (-1.9d-72)) .or. (.not. (x1 <= 1.75d-110))) then
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.9e-72) || !(x1 <= 1.75e-110)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.9e-72) or not (x1 <= 1.75e-110): tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.9e-72) || !(x1 <= 1.75e-110)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.9e-72) || ~((x1 <= 1.75e-110))) tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.9e-72], N[Not[LessEqual[x1, 1.75e-110]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.9 \cdot 10^{-72} \lor \neg \left(x1 \leq 1.75 \cdot 10^{-110}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.90000000000000001e-72 or 1.74999999999999987e-110 < x1 Initial program 57.2%
Taylor expanded in x1 around 0 30.6%
Taylor expanded in x1 around 0 38.7%
fma-def38.7%
fma-neg38.7%
fma-neg38.7%
metadata-eval38.7%
metadata-eval38.7%
Simplified38.7%
Taylor expanded in x1 around inf 37.1%
if -1.90000000000000001e-72 < x1 < 1.74999999999999987e-110Initial program 99.3%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x1 around 0 84.9%
fma-def85.1%
fma-neg85.1%
fma-neg85.1%
metadata-eval85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in x2 around 0 87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in x1 around 0 87.3%
mul-1-neg87.3%
unsub-neg87.3%
*-commutative87.3%
Simplified87.3%
Final simplification54.6%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.1e-214) (* x2 -6.0) (if (<= x2 1.85e-246) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.1e-214) {
tmp = x2 * -6.0;
} else if (x2 <= 1.85e-246) {
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 <= (-1.1d-214)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1.85d-246) 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 <= -1.1e-214) {
tmp = x2 * -6.0;
} else if (x2 <= 1.85e-246) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.1e-214: tmp = x2 * -6.0 elif x2 <= 1.85e-246: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.1e-214) tmp = Float64(x2 * -6.0); elseif (x2 <= 1.85e-246) 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 <= -1.1e-214) tmp = x2 * -6.0; elseif (x2 <= 1.85e-246) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.1e-214], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1.85e-246], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.1 \cdot 10^{-214}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 1.85 \cdot 10^{-246}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.10000000000000001e-214Initial program 74.9%
Taylor expanded in x1 around 0 48.9%
Taylor expanded in x1 around 0 28.2%
*-commutative28.2%
Simplified28.2%
Taylor expanded in x1 around 0 28.6%
*-commutative28.6%
Simplified28.6%
if -1.10000000000000001e-214 < x2 < 1.85e-246Initial program 71.6%
Taylor expanded in x1 around 0 56.3%
Taylor expanded in x1 around 0 57.7%
fma-def57.7%
fma-neg57.7%
fma-neg57.7%
metadata-eval57.7%
metadata-eval57.7%
Simplified57.7%
Taylor expanded in x2 around 0 57.6%
distribute-rgt1-in57.6%
metadata-eval57.6%
mul-1-neg57.6%
Simplified57.6%
if 1.85e-246 < x2 Initial program 69.5%
Taylor expanded in x1 around 0 47.2%
Taylor expanded in x1 around 0 30.3%
*-commutative30.3%
Simplified30.3%
Final simplification34.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.8e-213) (not (<= x2 1.85e-246))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.8e-213) || !(x2 <= 1.85e-246)) {
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.8d-213)) .or. (.not. (x2 <= 1.85d-246))) 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.8e-213) || !(x2 <= 1.85e-246)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.8e-213) or not (x2 <= 1.85e-246): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.8e-213) || !(x2 <= 1.85e-246)) 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.8e-213) || ~((x2 <= 1.85e-246))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.8e-213], N[Not[LessEqual[x2, 1.85e-246]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.8 \cdot 10^{-213} \lor \neg \left(x2 \leq 1.85 \cdot 10^{-246}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -1.8e-213 or 1.85e-246 < x2 Initial program 71.9%
Taylor expanded in x1 around 0 48.0%
Taylor expanded in x1 around 0 29.4%
*-commutative29.4%
Simplified29.4%
Taylor expanded in x1 around 0 29.2%
*-commutative29.2%
Simplified29.2%
if -1.8e-213 < x2 < 1.85e-246Initial program 71.6%
Taylor expanded in x1 around 0 56.3%
Taylor expanded in x1 around 0 57.7%
fma-def57.7%
fma-neg57.7%
fma-neg57.7%
metadata-eval57.7%
metadata-eval57.7%
Simplified57.7%
Taylor expanded in x2 around 0 57.6%
distribute-rgt1-in57.6%
metadata-eval57.6%
mul-1-neg57.6%
Simplified57.6%
Final simplification34.1%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 71.8%
Taylor expanded in x1 around 0 49.4%
Taylor expanded in x1 around 0 54.8%
fma-def54.8%
fma-neg54.8%
fma-neg54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in x2 around 0 39.4%
*-commutative39.4%
Simplified39.4%
Taylor expanded in x1 around 0 39.4%
mul-1-neg39.4%
unsub-neg39.4%
*-commutative39.4%
Simplified39.4%
Final simplification39.4%
(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 Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 71.8%
Taylor expanded in x1 around 0 49.4%
Taylor expanded in x1 around 0 54.8%
fma-def54.8%
fma-neg54.8%
fma-neg54.8%
metadata-eval54.8%
metadata-eval54.8%
Simplified54.8%
Taylor expanded in x2 around 0 16.7%
distribute-rgt1-in16.7%
metadata-eval16.7%
mul-1-neg16.7%
Simplified16.7%
Final simplification16.7%
(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 71.8%
Taylor expanded in x1 around 0 49.4%
Taylor expanded in x1 around 0 24.8%
*-commutative24.8%
Simplified24.8%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2024017
(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))))))