
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (/ t_0 (/ (fma x1 x1 1.0) 3.0)))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_0 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (t_0 / (fma(x1, x1, 1.0) / 3.0))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(t_0 / Float64(fma(x1, x1, 1.0) / 3.0))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{3}}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2 - x1\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.3%
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 inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.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 (* t_1 t_3))
(t_5 (* (* (* x1 2.0) t_3) (- t_3 3.0)))
(t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0)))) t_4) t_0))
t_6))
INFINITY)
(+
x1
(+
t_6
(+
x1
(+
t_0
(+
t_4
(*
t_2
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(*
(- (fma (* x1 3.0) x1 (* 2.0 x2)) x1)
(/ 1.0 (fma x1 x1 1.0))))
6.0)))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_1 * t_3;
double t_5 = ((x1 * 2.0) * t_3) * (t_3 - 3.0);
double t_6 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0)))) - 6.0))))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_1 * t_3) t_5 = Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0)))) - 6.0))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_1 \cdot t_3\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right)\\
t_6 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_4\right) + t_0\right)\right) + t_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_4 + t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2 - x1\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.3%
fma-def99.3%
div-inv99.3%
fma-def99.3%
Applied egg-rr99.3%
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 inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (- (* x2 -2.0) x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* (* (* x1 2.0) t_4) (- t_4 3.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+ (* t_3 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))) (* t_1 t_4))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))))
INFINITY)
(+
x1
(+
t_2
(+
x1
(+
t_0
(+
(*
t_3
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(*
(- (fma (* x1 3.0) x1 (* 2.0 x2)) x1)
(/ 1.0 (fma x1 x1 1.0))))
6.0))))
(* 3.0 t_1))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 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 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = ((x1 * 2.0) * t_4) * (t_4 - 3.0);
double tmp;
if ((x1 + ((x1 + (((t_3 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * t_4)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)))) <= ((double) INFINITY)) {
tmp = x1 + (t_2 + (x1 + (t_0 + ((t_3 * (t_5 + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (2.0 * x2)) - x1) * (1.0 / fma(x1, x1, 1.0)))) - 6.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 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(3.0 * Float64(Float64(x2 * -2.0) - x1)) 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(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * t_4)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0)))) - 6.0)))) + Float64(3.0 * t_1)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_2)); 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[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4), $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$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_1 \cdot t_4\right) + t_0\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_0 + \left(t_3 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_2\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.3%
Taylor expanded in x1 around inf 98.6%
Taylor expanded in x1 around 0 99.3%
fma-def99.3%
div-inv99.3%
fma-def99.3%
Applied egg-rr99.3%
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 inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY)
t_3
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2 - x1\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.3%
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 inf 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (* 3.0 (- (* x2 -2.0) x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3))
(t_5 (* 3.0 t_0)))
(if (<= x1 -2e+103)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) t_2))
(if (<= x1 3.1e+71)
(+
x1
(+
t_2
(+
x1
(+
t_1
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
t_5)))))
(+ x1 (+ t_2 (+ x1 (+ t_1 (+ t_5 (* t_3 (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = 3.0 * t_0;
double tmp;
if (x1 <= -2e+103) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + t_2);
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_2 + (x1 + (t_1 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_5))));
} else {
tmp = x1 + (t_2 + (x1 + (t_1 + (t_5 + (t_3 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_3
t_5 = 3.0d0 * t_0
if (x1 <= (-2d+103)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + t_2)
else if (x1 <= 3.1d+71) then
tmp = x1 + (t_2 + (x1 + (t_1 + ((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + t_5))))
else
tmp = x1 + (t_2 + (x1 + (t_1 + (t_5 + (t_3 * ((x1 * x1) * 6.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = 3.0 * ((x2 * -2.0) - x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = 3.0 * t_0;
double tmp;
if (x1 <= -2e+103) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + t_2);
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_2 + (x1 + (t_1 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_5))));
} else {
tmp = x1 + (t_2 + (x1 + (t_1 + (t_5 + (t_3 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = 3.0 * ((x2 * -2.0) - x1) t_3 = (x1 * x1) + 1.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3 t_5 = 3.0 * t_0 tmp = 0 if x1 <= -2e+103: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + t_2) elif x1 <= 3.1e+71: tmp = x1 + (t_2 + (x1 + (t_1 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_5)))) else: tmp = x1 + (t_2 + (x1 + (t_1 + (t_5 + (t_3 * ((x1 * x1) * 6.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(3.0 * t_0) tmp = 0.0 if (x1 <= -2e+103) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_2)); elseif (x1 <= 3.1e+71) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_5))))); else tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_3 * Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = 3.0 * ((x2 * -2.0) - x1); t_3 = (x1 * x1) + 1.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3; t_5 = 3.0 * t_0; tmp = 0.0; if (x1 <= -2e+103) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + t_2); elseif (x1 <= 3.1e+71) tmp = x1 + (t_2 + (x1 + (t_1 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_5)))); else tmp = x1 + (t_2 + (x1 + (t_1 + (t_5 + (t_3 * ((x1 * x1) * 6.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * t$95$0), $MachinePrecision]}, If[LessEqual[x1, -2e+103], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+71], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$3 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := 3 \cdot t_0\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_2\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_1 + \left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_1 + \left(t_5 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2e103Initial program 2.1%
Taylor expanded in x1 around inf 2.1%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around inf 97.9%
*-commutative97.9%
Simplified97.9%
if -2e103 < x1 < 3.10000000000000018e71Initial program 98.6%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around 0 98.6%
if 3.10000000000000018e71 < x1 Initial program 47.3%
Taylor expanded in x1 around inf 47.3%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* 3.0 t_1)))
(if (<= x1 -2.4e+129)
(+ x1 (fma 9.0 (* x1 x1) (* x1 -2.0)))
(if (<= x1 3.1e+71)
(+
x1
(+
t_0
(+
x1
(+
t_2
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
t_5)))))
(+ x1 (+ t_0 (+ x1 (+ t_2 (+ t_5 (* t_3 (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = 3.0 * t_1;
double tmp;
if (x1 <= -2.4e+129) {
tmp = x1 + fma(9.0, (x1 * x1), (x1 * -2.0));
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_5))));
} else {
tmp = x1 + (t_0 + (x1 + (t_2 + (t_5 + (t_3 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * x1)) 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(3.0 * t_1) tmp = 0.0 if (x1 <= -2.4e+129) tmp = Float64(x1 + fma(9.0, Float64(x1 * x1), Float64(x1 * -2.0))); elseif (x1 <= 3.1e+71) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_5))))); else tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_3 * Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $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[(3.0 * t$95$1), $MachinePrecision]}, If[LessEqual[x1, -2.4e+129], N[(x1 + N[(9.0 * N[(x1 * x1), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+71], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$3 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := 3 \cdot t_1\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+129}:\\
\;\;\;\;x1 + \mathsf{fma}\left(9, x1 \cdot x1, x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_2 + \left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_2 + \left(t_5 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3999999999999999e129Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 36.9%
fma-def44.2%
*-commutative44.2%
associate-*l*44.2%
*-commutative44.2%
fma-neg44.2%
fma-neg44.2%
metadata-eval44.2%
metadata-eval44.2%
*-commutative44.2%
fma-def44.2%
*-commutative44.2%
*-commutative44.2%
associate-*l*44.2%
cancel-sign-sub-inv44.2%
metadata-eval44.2%
+-commutative44.2%
unpow244.2%
associate-*r*44.2%
Simplified44.2%
Taylor expanded in x2 around 0 91.4%
fma-def91.4%
unpow291.4%
*-commutative91.4%
Simplified91.4%
if -2.3999999999999999e129 < x1 < 3.10000000000000018e71Initial program 95.9%
Taylor expanded in x1 around inf 95.1%
Taylor expanded in x1 around 0 95.9%
if 3.10000000000000018e71 < x1 Initial program 47.3%
Taylor expanded in x1 around inf 47.3%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 t_1))
(t_3 (* x1 (* x1 x1)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_1 (* 2.0 x2)) x1) t_4)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 3.1e+71)
(+
x1
(+
t_0
(+
x1
(+
t_3
(+
(*
t_4
(+
(* (* (* x1 2.0) t_5) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
t_2)))))
(+ x1 (+ t_0 (+ x1 (+ t_3 (+ t_2 (* t_4 (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * t_1;
double t_3 = x1 * (x1 * x1);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_0 + (x1 + (t_3 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + t_2))));
} else {
tmp = x1 + (t_0 + (x1 + (t_3 + (t_2 + (t_4 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * t_1
t_3 = x1 * (x1 * x1)
t_4 = (x1 * x1) + 1.0d0
t_5 = ((t_1 + (2.0d0 * x2)) - x1) / t_4
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 3.1d+71) then
tmp = x1 + (t_0 + (x1 + (t_3 + ((t_4 * ((((x1 * 2.0d0) * t_5) * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + t_2))))
else
tmp = x1 + (t_0 + (x1 + (t_3 + (t_2 + (t_4 * ((x1 * x1) * 6.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * t_1;
double t_3 = x1 * (x1 * x1);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_0 + (x1 + (t_3 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + t_2))));
} else {
tmp = x1 + (t_0 + (x1 + (t_3 + (t_2 + (t_4 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x2 * -2.0) - x1) t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * t_1 t_3 = x1 * (x1 * x1) t_4 = (x1 * x1) + 1.0 t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 3.1e+71: tmp = x1 + (t_0 + (x1 + (t_3 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + t_2)))) else: tmp = x1 + (t_0 + (x1 + (t_3 + (t_2 + (t_4 * ((x1 * x1) * 6.0)))))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * t_1) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_4) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 3.1e+71) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_3 + Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + t_2))))); else tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_3 + Float64(t_2 + Float64(t_4 * Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((x2 * -2.0) - x1); t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * t_1; t_3 = x1 * (x1 * x1); t_4 = (x1 * x1) + 1.0; t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 3.1e+71) tmp = x1 + (t_0 + (x1 + (t_3 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + t_2)))); else tmp = x1 + (t_0 + (x1 + (t_3 + (t_2 + (t_4 * ((x1 * x1) * 6.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+71], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$3 + N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$3 + N[(t$95$2 + N[(t$95$4 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 3 \cdot t_1\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_4}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_3 + \left(t_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_3 + \left(t_2 + t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < 3.10000000000000018e71Initial program 98.6%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around 0 98.6%
if 3.10000000000000018e71 < x1 Initial program 47.3%
Taylor expanded in x1 around inf 47.3%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification86.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_4 (* 3.0 (- (* x2 -2.0) x1)))
(t_5 (* 3.0 t_2)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_4 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 -9.5)
(+
x1
(+
t_3
(+
x1
(+
t_1
(+
t_5
(*
t_0
(+
(* (* x1 x1) (- (* (/ (- (+ t_2 (* 2.0 x2)) x1) t_0) 4.0) 6.0))
(* (* (* x1 2.0) 3.0) (/ -1.0 x1)))))))))
(if (<= x1 3.75)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(+ x1 (+ t_4 (+ x1 (+ t_1 (+ t_5 (* t_0 (* (* x1 x1) 6.0))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = 3.0 * ((x2 * -2.0) - x1);
double t_5 = 3.0 * t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_4 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -9.5) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
} else if (x1 <= 3.75) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_4 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_5 = 3.0d0 * t_2
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= (-9.5d0)) then
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (((x1 * x1) * (((((t_2 + (2.0d0 * x2)) - x1) / t_0) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1))))))))
else if (x1 <= 3.75d0) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * x1) * 6.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = 3.0 * ((x2 * -2.0) - x1);
double t_5 = 3.0 * t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_4 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -9.5) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1))))))));
} else if (x1 <= 3.75) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_4 = 3.0 * ((x2 * -2.0) - x1) t_5 = 3.0 * t_2 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_4 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= -9.5: tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))) elif x1 <= 3.75: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * x1) * 6.0)))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_4 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_5 = Float64(3.0 * t_2) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= -9.5) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1))))))))); elseif (x1 <= 3.75) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_4 = 3.0 * ((x2 * -2.0) - x1); t_5 = 3.0 * t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_4 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= -9.5) tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (((x1 * x1) * (((((t_2 + (2.0 * x2)) - x1) / t_0) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))))))); elseif (x1 <= 3.75) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * x1) * 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 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.75], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0}\\
t_4 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_5 := 3 \cdot t_2\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -9.5:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_1 + \left(t_5 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.75:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_1 + \left(t_5 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < -9.5Initial program 99.3%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around inf 85.7%
Taylor expanded in x1 around inf 85.7%
if -9.5 < x1 < 3.75Initial program 98.6%
Taylor expanded in x1 around 0 99.3%
if 3.75 < x1 Initial program 61.9%
Taylor expanded in x1 around inf 59.7%
Taylor expanded in x1 around 0 61.9%
Taylor expanded in x1 around inf 86.4%
*-commutative86.4%
unpow286.4%
Simplified86.4%
Final simplification82.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (- (* x2 -2.0) x1)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5 (* 3.0 t_3))
(t_6 (* (* x1 x1) 6.0)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_1 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 3.1e+71)
(+
x1
(+
t_1
(+
x1
(+ t_2 (+ t_5 (* t_0 (+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) t_6)))))))
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ t_5 (* t_0 t_6))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * ((x2 * -2.0) - x1);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = 3.0 * t_3;
double t_6 = (x1 * x1) * 6.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * t_6)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = 3.0d0 * t_3
t_6 = (x1 * x1) * 6.0d0
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_1 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 3.1d+71) then
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + t_6))))))
else
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * t_6)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * ((x2 * -2.0) - x1);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = 3.0 * t_3;
double t_6 = (x1 * x1) * 6.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 3.1e+71) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * t_6)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 * ((x2 * -2.0) - x1) t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = 3.0 * t_3 t_6 = (x1 * x1) * 6.0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 3.1e+71: tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)))))) else: tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * t_6))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(3.0 * t_3) t_6 = Float64(Float64(x1 * x1) * 6.0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 3.1e+71) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + t_6))))))); else tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_0 * t_6)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 * ((x2 * -2.0) - x1); t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = 3.0 * t_3; t_6 = (x1 * x1) * 6.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 3.1e+71) tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)))))); else tmp = x1 + (t_1 + (x1 + (t_2 + (t_5 + (t_0 * t_6))))); 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[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+71], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := 3 \cdot t_3\\
t_6 := \left(x1 \cdot x1\right) \cdot 6\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + t_6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_5 + t_0 \cdot t_6\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < 3.10000000000000018e71Initial program 98.6%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around 0 98.6%
Taylor expanded in x1 around inf 96.9%
if 3.10000000000000018e71 < x1 Initial program 47.3%
Taylor expanded in x1 around inf 47.3%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification84.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (or (<= x1 -60000.0) (not (<= x1 3.75)))
(+
x1
(+
t_2
(+
x1
(+ (* x1 (* x1 x1)) (+ (* 3.0 t_0) (* t_1 (* x1 (* x1 6.0))))))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 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 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if ((x1 <= -60000.0) || !(x1 <= 3.75)) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (x1 * (x1 * 6.0)))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((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 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if ((x1 <= (-60000.0d0)) .or. (.not. (x1 <= 3.75d0))) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (x1 * (x1 * 6.0d0)))))))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x2 * (x1 * ((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 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if ((x1 <= -60000.0) || !(x1 <= 3.75)) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (x1 * (x1 * 6.0)))))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((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 = 3.0 * ((x2 * -2.0) - x1) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_2 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif (x1 <= -60000.0) or not (x1 <= 3.75): tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (x1 * (x1 * 6.0))))))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((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(3.0 * Float64(Float64(x2 * -2.0) - x1)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif ((x1 <= -60000.0) || !(x1 <= 3.75)) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(x1 * Float64(x1 * 6.0)))))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * 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 = 3.0 * ((x2 * -2.0) - x1); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_2 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif ((x1 <= -60000.0) || ~((x1 <= 3.75))) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (x1 * (x1 * 6.0))))))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * (x1 * ((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[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -60000.0], N[Not[LessEqual[x1, 3.75]], $MachinePrecision]], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -60000 \lor \neg \left(x1 \leq 3.75\right):\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < -6e4 or 3.75 < x1 Initial program 69.7%
Taylor expanded in x1 around inf 68.0%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x1 around inf 84.3%
*-commutative84.3%
unpow284.3%
associate-*l*84.3%
Simplified84.3%
if -6e4 < x1 < 3.75Initial program 98.6%
Taylor expanded in x1 around 0 99.3%
Final simplification82.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (- (* x2 -2.0) x1)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 3.0 t_3)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_1 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 -5000.0)
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ t_4 (* t_0 (* x1 (* x1 6.0))))))))
(if (<= x1 3.75)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ t_4 (* t_0 (* (* x1 x1) 6.0))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * ((x2 * -2.0) - x1);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * t_3;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -5000.0) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (x1 * (x1 * 6.0)))))));
} else if (x1 <= 3.75) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = 3.0d0 * t_3
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_1 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= (-5000.0d0)) then
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (x1 * (x1 * 6.0d0)))))))
else if (x1 <= 3.75d0) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * x1) * 6.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * ((x2 * -2.0) - x1);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * t_3;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -5000.0) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (x1 * (x1 * 6.0)))))));
} else if (x1 <= 3.75) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * x1) * 6.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 * ((x2 * -2.0) - x1) t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = 3.0 * t_3 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= -5000.0: tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (x1 * (x1 * 6.0))))))) elif x1 <= 3.75: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * x1) * 6.0)))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(3.0 * t_3) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= -5000.0) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_4 + Float64(t_0 * Float64(x1 * Float64(x1 * 6.0)))))))); elseif (x1 <= 3.75) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_4 + Float64(t_0 * Float64(Float64(x1 * x1) * 6.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 * ((x2 * -2.0) - x1); t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = 3.0 * t_3; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_1 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= -5000.0) tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (x1 * (x1 * 6.0))))))); elseif (x1 <= 3.75) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * ((x1 * x1) * 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[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * t$95$3), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5000.0], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$4 + N[(t$95$0 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.75], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$4 + N[(t$95$0 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 \cdot t_3\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5000:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_4 + t_0 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.75:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_4 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 28.5%
if -5.60000000000000037e102 < x1 < -5e3Initial program 99.3%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around 0 99.3%
Taylor expanded in x1 around inf 76.5%
*-commutative76.5%
unpow276.5%
associate-*l*76.6%
Simplified76.6%
if -5e3 < x1 < 3.75Initial program 98.6%
Taylor expanded in x1 around 0 99.3%
if 3.75 < x1 Initial program 61.9%
Taylor expanded in x1 around inf 59.7%
Taylor expanded in x1 around 0 61.9%
Taylor expanded in x1 around inf 86.4%
*-commutative86.4%
unpow286.4%
Simplified86.4%
Final simplification82.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -350000000.0)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.32e+154)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -350000000.0) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.32e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-350000000.0d0)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.32d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -350000000.0) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.32e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -350000000.0: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.32e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -350000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.32e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -350000000.0) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.32e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -350000000.0], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.32e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -350000000:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.5e8Initial program 24.4%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x1 around 0 4.8%
Taylor expanded in x2 around 0 23.2%
if -3.5e8 < x1 < 1.31999999999999998e154Initial program 98.7%
Taylor expanded in x1 around 0 84.4%
if 1.31999999999999998e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+60.0%
Applied egg-rr60.0%
swap-sqr60.0%
metadata-eval60.0%
Simplified60.0%
Final simplification67.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_1 (+ x1 (+ (* x2 (- (* x1 -12.0) 6.0)) (+ x1 (* x1 -3.0))))))
(if (<= x1 -5.2e+71)
t_1
(if (<= x1 -1.85e-227)
t_0
(if (<= x1 3.8e-245)
t_1
(if (<= x1 2.2e+169)
t_0
(if (<= x1 5.5e+287)
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
(+ x1 (* 8.0 (* x1 (* x2 x2)))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
double tmp;
if (x1 <= -5.2e+71) {
tmp = t_1;
} else if (x1 <= -1.85e-227) {
tmp = t_0;
} else if (x1 <= 3.8e-245) {
tmp = t_1;
} else if (x1 <= 2.2e+169) {
tmp = t_0;
} else if (x1 <= 5.5e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_1 = x1 + ((x2 * ((x1 * (-12.0d0)) - 6.0d0)) + (x1 + (x1 * (-3.0d0))))
if (x1 <= (-5.2d+71)) then
tmp = t_1
else if (x1 <= (-1.85d-227)) then
tmp = t_0
else if (x1 <= 3.8d-245) then
tmp = t_1
else if (x1 <= 2.2d+169) then
tmp = t_0
else if (x1 <= 5.5d+287) then
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
else
tmp = x1 + (8.0d0 * (x1 * (x2 * x2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
double tmp;
if (x1 <= -5.2e+71) {
tmp = t_1;
} else if (x1 <= -1.85e-227) {
tmp = t_0;
} else if (x1 <= 3.8e-245) {
tmp = t_1;
} else if (x1 <= 2.2e+169) {
tmp = t_0;
} else if (x1 <= 5.5e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_1 = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))) tmp = 0 if x1 <= -5.2e+71: tmp = t_1 elif x1 <= -1.85e-227: tmp = t_0 elif x1 <= 3.8e-245: tmp = t_1 elif x1 <= 2.2e+169: tmp = t_0 elif x1 <= 5.5e+287: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) else: tmp = x1 + (8.0 * (x1 * (x2 * x2))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) t_1 = Float64(x1 + Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(x1 + Float64(x1 * -3.0)))) tmp = 0.0 if (x1 <= -5.2e+71) tmp = t_1; elseif (x1 <= -1.85e-227) tmp = t_0; elseif (x1 <= 3.8e-245) tmp = t_1; elseif (x1 <= 2.2e+169) tmp = t_0; elseif (x1 <= 5.5e+287) tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); t_1 = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))); tmp = 0.0; if (x1 <= -5.2e+71) tmp = t_1; elseif (x1 <= -1.85e-227) tmp = t_0; elseif (x1 <= 3.8e-245) tmp = t_1; elseif (x1 <= 2.2e+169) tmp = t_0; elseif (x1 <= 5.5e+287) tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); else tmp = x1 + (8.0 * (x1 * (x2 * x2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + 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] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.2e+71], t$95$1, If[LessEqual[x1, -1.85e-227], t$95$0, If[LessEqual[x1, 3.8e-245], t$95$1, If[LessEqual[x1, 2.2e+169], t$95$0, If[LessEqual[x1, 5.5e+287], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
t_1 := x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -3\right)\right)\\
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -1.85 \cdot 10^{-227}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 2.2 \cdot 10^{+169}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+287}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{else}:\\
\;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.19999999999999983e71 or -1.84999999999999989e-227 < x1 < 3.8000000000000001e-245Initial program 48.2%
Taylor expanded in x1 around 0 41.6%
Taylor expanded in x1 around 0 43.2%
Taylor expanded in x2 around 0 49.4%
if -5.19999999999999983e71 < x1 < -1.84999999999999989e-227 or 3.8000000000000001e-245 < x1 < 2.2e169Initial program 95.2%
Taylor expanded in x1 around 0 73.6%
Taylor expanded in x1 around 0 73.0%
if 2.2e169 < x1 < 5.5e287Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+75.0%
Applied egg-rr75.0%
swap-sqr75.0%
metadata-eval75.0%
Simplified75.0%
if 5.5e287 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification64.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -6e+70)
(+ x1 (+ (* 3.0 (- (* x2 -2.0) x1)) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 -1.15e-226)
t_0
(if (<= x1 8.8e-245)
(+ x1 (+ (* x2 (- (* x1 -12.0) 6.0)) (+ x1 (* x1 -3.0))))
(if (<= x1 4.3e+183)
t_0
(if (<= x1 5.5e+287)
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
(+ x1 (* 8.0 (* x1 (* x2 x2)))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -6e+70) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -1.15e-226) {
tmp = t_0;
} else if (x1 <= 8.8e-245) {
tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
} else if (x1 <= 4.3e+183) {
tmp = t_0;
} else if (x1 <= 5.5e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-6d+70)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= (-1.15d-226)) then
tmp = t_0
else if (x1 <= 8.8d-245) then
tmp = x1 + ((x2 * ((x1 * (-12.0d0)) - 6.0d0)) + (x1 + (x1 * (-3.0d0))))
else if (x1 <= 4.3d+183) then
tmp = t_0
else if (x1 <= 5.5d+287) then
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
else
tmp = x1 + (8.0d0 * (x1 * (x2 * x2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -6e+70) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -1.15e-226) {
tmp = t_0;
} else if (x1 <= 8.8e-245) {
tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
} else if (x1 <= 4.3e+183) {
tmp = t_0;
} else if (x1 <= 5.5e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -6e+70: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= -1.15e-226: tmp = t_0 elif x1 <= 8.8e-245: tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))) elif x1 <= 4.3e+183: tmp = t_0 elif x1 <= 5.5e+287: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) else: tmp = x1 + (8.0 * (x1 * (x2 * x2))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -6e+70) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= -1.15e-226) tmp = t_0; elseif (x1 <= 8.8e-245) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(x1 + Float64(x1 * -3.0)))); elseif (x1 <= 4.3e+183) tmp = t_0; elseif (x1 <= 5.5e+287) tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -6e+70) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= -1.15e-226) tmp = t_0; elseif (x1 <= 8.8e-245) tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))); elseif (x1 <= 4.3e+183) tmp = t_0; elseif (x1 <= 5.5e+287) tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); else tmp = x1 + (8.0 * (x1 * (x2 * x2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + 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] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6e+70], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e-226], t$95$0, If[LessEqual[x1, 8.8e-245], N[(x1 + N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.3e+183], t$95$0, If[LessEqual[x1, 5.5e+287], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+70}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-226}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 8.8 \cdot 10^{-245}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -3\right)\right)\\
\mathbf{elif}\;x1 \leq 4.3 \cdot 10^{+183}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+287}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{else}:\\
\;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.99999999999999952e70Initial program 14.8%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x2 around 0 25.5%
if -5.99999999999999952e70 < x1 < -1.15e-226 or 8.79999999999999971e-245 < x1 < 4.3000000000000004e183Initial program 95.2%
Taylor expanded in x1 around 0 73.6%
Taylor expanded in x1 around 0 73.0%
if -1.15e-226 < x1 < 8.79999999999999971e-245Initial program 96.9%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x2 around 0 84.8%
if 4.3000000000000004e183 < x1 < 5.5e287Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+75.0%
Applied egg-rr75.0%
swap-sqr75.0%
metadata-eval75.0%
Simplified75.0%
if 5.5e287 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification65.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -5e+71)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 2.2e+169)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 5.2e+287)
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))
(+ x1 (* 8.0 (* x1 (* x2 x2)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -5e+71) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 2.2e+169) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 5.2e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
if (x1 <= (-5d+71)) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 2.2d+169) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))))
else if (x1 <= 5.2d+287) then
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
else
tmp = x1 + (8.0d0 * (x1 * (x2 * x2)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -5e+71) {
tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 2.2e+169) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))));
} else if (x1 <= 5.2e+287) {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
} else {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x2 * -2.0) - x1) tmp = 0 if x1 <= -5e+71: tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 2.2e+169: tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))) elif x1 <= 5.2e+287: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) else: tmp = x1 + (8.0 * (x1 * (x2 * x2))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) tmp = 0.0 if (x1 <= -5e+71) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 2.2e+169) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))))); elseif (x1 <= 5.2e+287) tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((x2 * -2.0) - x1); tmp = 0.0; if (x1 <= -5e+71) tmp = x1 + (t_0 + (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 2.2e+169) tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0)))))); elseif (x1 <= 5.2e+287) tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); else tmp = x1 + (8.0 * (x1 * (x2 * x2))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+71], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.2e+169], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.2e+287], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+71}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.2 \cdot 10^{+169}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+287}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{else}:\\
\;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\end{array}
\end{array}
if x1 < -4.99999999999999972e71Initial program 14.8%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x1 around 0 4.5%
Taylor expanded in x2 around 0 25.5%
if -4.99999999999999972e71 < x1 < 2.2e169Initial program 95.6%
Taylor expanded in x1 around 0 78.7%
Taylor expanded in x1 around 0 80.3%
if 2.2e169 < x1 < 5.2000000000000003e287Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+75.0%
Applied egg-rr75.0%
swap-sqr75.0%
metadata-eval75.0%
Simplified75.0%
if 5.2000000000000003e287 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Final simplification68.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0)))
(if (or (<= x2 -2.8e-63) (not (<= x2 3.2e-31)))
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 t_0)))) (* 3.0 (* x2 -2.0))))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 t_0)) 2.0)))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double tmp;
if ((x2 <= -2.8e-63) || !(x2 <= 3.2e-31)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * t_0)) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
if ((x2 <= (-2.8d-63)) .or. (.not. (x2 <= 3.2d-31))) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * t_0)))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * t_0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double tmp;
if ((x2 <= -2.8e-63) || !(x2 <= 3.2e-31)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * t_0)) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 tmp = 0 if (x2 <= -2.8e-63) or not (x2 <= 3.2e-31): tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * t_0)) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) tmp = 0.0 if ((x2 <= -2.8e-63) || !(x2 <= 3.2e-31)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_0)))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_0)) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; tmp = 0.0; if ((x2 <= -2.8e-63) || ~((x2 <= 3.2e-31))) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * (x2 * -2.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * t_0)) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, If[Or[LessEqual[x2, -2.8e-63], N[Not[LessEqual[x2, 3.2e-31]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{-63} \lor \neg \left(x2 \leq 3.2 \cdot 10^{-31}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot t_0\right) - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -2.8000000000000002e-63 or 3.20000000000000018e-31 < x2 Initial program 66.1%
Taylor expanded in x1 around 0 54.9%
Taylor expanded in x1 around 0 62.0%
*-commutative62.0%
Simplified62.0%
if -2.8000000000000002e-63 < x2 < 3.20000000000000018e-31Initial program 80.8%
Taylor expanded in x1 around 0 61.7%
Taylor expanded in x1 around 0 62.6%
Final simplification62.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2))))))
(if (<= x2 -1.9e+214)
t_0
(if (<= x2 -2.35e-152)
(* x2 -6.0)
(if (<= x2 2.5e-130)
(+ x1 (* x1 -2.0))
(if (<= x2 7.5e+93)
(+ x1 (* x2 -6.0))
(if (<= x2 8.5e+202)
t_0
(if (<= x2 9.5e+219)
(* x2 -6.0)
(if (<= x2 3.2e+236)
(+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))
t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x2 <= -1.9e+214) {
tmp = t_0;
} else if (x2 <= -2.35e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 2.5e-130) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 7.5e+93) {
tmp = x1 + (x2 * -6.0);
} else if (x2 <= 8.5e+202) {
tmp = t_0;
} else if (x2 <= 9.5e+219) {
tmp = x2 * -6.0;
} else if (x2 <= 3.2e+236) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
if (x2 <= (-1.9d+214)) then
tmp = t_0
else if (x2 <= (-2.35d-152)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 2.5d-130) then
tmp = x1 + (x1 * (-2.0d0))
else if (x2 <= 7.5d+93) then
tmp = x1 + (x2 * (-6.0d0))
else if (x2 <= 8.5d+202) then
tmp = t_0
else if (x2 <= 9.5d+219) then
tmp = x2 * (-6.0d0)
else if (x2 <= 3.2d+236) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x2 <= -1.9e+214) {
tmp = t_0;
} else if (x2 <= -2.35e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 2.5e-130) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 7.5e+93) {
tmp = x1 + (x2 * -6.0);
} else if (x2 <= 8.5e+202) {
tmp = t_0;
} else if (x2 <= 9.5e+219) {
tmp = x2 * -6.0;
} else if (x2 <= 3.2e+236) {
tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x2 * (x1 * x2))) tmp = 0 if x2 <= -1.9e+214: tmp = t_0 elif x2 <= -2.35e-152: tmp = x2 * -6.0 elif x2 <= 2.5e-130: tmp = x1 + (x1 * -2.0) elif x2 <= 7.5e+93: tmp = x1 + (x2 * -6.0) elif x2 <= 8.5e+202: tmp = t_0 elif x2 <= 9.5e+219: tmp = x2 * -6.0 elif x2 <= 3.2e+236: tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) tmp = 0.0 if (x2 <= -1.9e+214) tmp = t_0; elseif (x2 <= -2.35e-152) tmp = Float64(x2 * -6.0); elseif (x2 <= 2.5e-130) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x2 <= 7.5e+93) tmp = Float64(x1 + Float64(x2 * -6.0)); elseif (x2 <= 8.5e+202) tmp = t_0; elseif (x2 <= 9.5e+219) tmp = Float64(x2 * -6.0); elseif (x2 <= 3.2e+236) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x2 * (x1 * x2))); tmp = 0.0; if (x2 <= -1.9e+214) tmp = t_0; elseif (x2 <= -2.35e-152) tmp = x2 * -6.0; elseif (x2 <= 2.5e-130) tmp = x1 + (x1 * -2.0); elseif (x2 <= 7.5e+93) tmp = x1 + (x2 * -6.0); elseif (x2 <= 8.5e+202) tmp = t_0; elseif (x2 <= 9.5e+219) tmp = x2 * -6.0; elseif (x2 <= 3.2e+236) tmp = 9.0 + (x1 * (2.0 + (x2 * -12.0))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.9e+214], t$95$0, If[LessEqual[x2, -2.35e-152], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 2.5e-130], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 7.5e+93], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 8.5e+202], t$95$0, If[LessEqual[x2, 9.5e+219], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3.2e+236], N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{if}\;x2 \leq -1.9 \cdot 10^{+214}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -2.35 \cdot 10^{-152}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 2.5 \cdot 10^{-130}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x2 \leq 7.5 \cdot 10^{+93}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 8.5 \cdot 10^{+202}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq 9.5 \cdot 10^{+219}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 3.2 \cdot 10^{+236}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -1.89999999999999999e214 or 7.5000000000000002e93 < x2 < 8.5000000000000003e202 or 3.2000000000000002e236 < x2 Initial program 64.2%
Taylor expanded in x1 around 0 58.2%
Taylor expanded in x2 around inf 56.0%
unpow256.0%
associate-*l*63.7%
Simplified63.7%
if -1.89999999999999999e214 < x2 < -2.35000000000000006e-152 or 8.5000000000000003e202 < x2 < 9.49999999999999959e219Initial program 68.9%
Taylor expanded in x1 around 0 52.1%
Taylor expanded in x1 around 0 38.7%
*-commutative38.7%
Simplified38.7%
Taylor expanded in x1 around 0 39.2%
*-commutative39.2%
Simplified39.2%
if -2.35000000000000006e-152 < x2 < 2.4999999999999998e-130Initial program 79.7%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 50.7%
distribute-rgt1-in51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
if 2.4999999999999998e-130 < x2 < 7.5000000000000002e93Initial program 92.2%
Taylor expanded in x1 around 0 67.7%
Taylor expanded in x1 around 0 59.4%
*-commutative59.4%
Simplified59.4%
if 9.49999999999999959e219 < x2 < 3.2000000000000002e236Initial program 25.0%
Taylor expanded in x1 around 0 25.0%
Taylor expanded in x1 around inf 25.0%
Taylor expanded in x2 around 0 75.1%
associate-*r*75.1%
distribute-rgt-out75.1%
*-commutative75.1%
Simplified75.1%
Final simplification51.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -5e+238) (not (<= x2 3e+253))) (+ x1 (* 8.0 (* x2 (* x1 x2)))) (+ x1 (+ (* x2 (- (* x1 -12.0) 6.0)) (+ x1 (* x1 -3.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+238) || !(x2 <= 3e+253)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-5d+238)) .or. (.not. (x2 <= 3d+253))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x1 + ((x2 * ((x1 * (-12.0d0)) - 6.0d0)) + (x1 + (x1 * (-3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+238) || !(x2 <= 3e+253)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -5e+238) or not (x2 <= 3e+253): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -5e+238) || !(x2 <= 3e+253)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) + Float64(x1 + Float64(x1 * -3.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -5e+238) || ~((x2 <= 3e+253))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x1 + ((x2 * ((x1 * -12.0) - 6.0)) + (x1 + (x1 * -3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -5e+238], N[Not[LessEqual[x2, 3e+253]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5 \cdot 10^{+238} \lor \neg \left(x2 \leq 3 \cdot 10^{+253}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(x1 \cdot -12 - 6\right) + \left(x1 + x1 \cdot -3\right)\right)\\
\end{array}
\end{array}
if x2 < -4.99999999999999995e238 or 2.9999999999999998e253 < x2 Initial program 78.5%
Taylor expanded in x1 around 0 82.1%
Taylor expanded in x2 around inf 76.6%
unpow276.6%
associate-*l*89.2%
Simplified89.2%
if -4.99999999999999995e238 < x2 < 2.9999999999999998e253Initial program 72.7%
Taylor expanded in x1 around 0 55.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 53.2%
Final simplification57.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 9.0 (* x1 (+ 2.0 (* x2 -12.0))))))
(if (<= x2 -2.3e+214)
t_0
(if (<= x2 -1.02e-150)
(* x2 -6.0)
(if (<= x2 1e-129)
(+ x1 (* x1 -2.0))
(if (<= x2 6e+224) (+ x1 (* x2 -6.0)) t_0))))))
double code(double x1, double x2) {
double t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
double tmp;
if (x2 <= -2.3e+214) {
tmp = t_0;
} else if (x2 <= -1.02e-150) {
tmp = x2 * -6.0;
} else if (x2 <= 1e-129) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6e+224) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 9.0d0 + (x1 * (2.0d0 + (x2 * (-12.0d0))))
if (x2 <= (-2.3d+214)) then
tmp = t_0
else if (x2 <= (-1.02d-150)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1d-129) then
tmp = x1 + (x1 * (-2.0d0))
else if (x2 <= 6d+224) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0)));
double tmp;
if (x2 <= -2.3e+214) {
tmp = t_0;
} else if (x2 <= -1.02e-150) {
tmp = x2 * -6.0;
} else if (x2 <= 1e-129) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6e+224) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0))) tmp = 0 if x2 <= -2.3e+214: tmp = t_0 elif x2 <= -1.02e-150: tmp = x2 * -6.0 elif x2 <= 1e-129: tmp = x1 + (x1 * -2.0) elif x2 <= 6e+224: tmp = x1 + (x2 * -6.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x2 * -12.0)))) tmp = 0.0 if (x2 <= -2.3e+214) tmp = t_0; elseif (x2 <= -1.02e-150) tmp = Float64(x2 * -6.0); elseif (x2 <= 1e-129) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x2 <= 6e+224) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = 9.0 + (x1 * (2.0 + (x2 * -12.0))); tmp = 0.0; if (x2 <= -2.3e+214) tmp = t_0; elseif (x2 <= -1.02e-150) tmp = x2 * -6.0; elseif (x2 <= 1e-129) tmp = x1 + (x1 * -2.0); elseif (x2 <= 6e+224) tmp = x1 + (x2 * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(9.0 + N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -2.3e+214], t$95$0, If[LessEqual[x2, -1.02e-150], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1e-129], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 6e+224], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 9 + x1 \cdot \left(2 + x2 \cdot -12\right)\\
\mathbf{if}\;x2 \leq -2.3 \cdot 10^{+214}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -1.02 \cdot 10^{-150}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 10^{-129}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x2 \leq 6 \cdot 10^{+224}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -2.2999999999999999e214 or 6.0000000000000002e224 < x2 Initial program 59.4%
Taylor expanded in x1 around 0 61.8%
Taylor expanded in x1 around inf 60.9%
Taylor expanded in x2 around 0 32.0%
associate-*r*34.3%
distribute-rgt-out34.3%
*-commutative34.3%
Simplified34.3%
if -2.2999999999999999e214 < x2 < -1.0199999999999999e-150Initial program 66.4%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in x1 around 0 36.9%
*-commutative36.9%
Simplified36.9%
if -1.0199999999999999e-150 < x2 < 9.9999999999999993e-130Initial program 79.7%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 50.7%
distribute-rgt1-in51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
if 9.9999999999999993e-130 < x2 < 6.0000000000000002e224Initial program 83.0%
Taylor expanded in x1 around 0 60.4%
Taylor expanded in x1 around 0 41.6%
*-commutative41.6%
Simplified41.6%
Final simplification42.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x1 (* x2 x2))))))
(if (<= x2 -1.9e+214)
t_0
(if (<= x2 -8.5e-152)
(* x2 -6.0)
(if (<= x2 1.35e-130)
(+ x1 (* x1 -2.0))
(if (<= x2 6.1e+91) (+ x1 (* x2 -6.0)) t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
double tmp;
if (x2 <= -1.9e+214) {
tmp = t_0;
} else if (x2 <= -8.5e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 1.35e-130) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6.1e+91) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (8.0d0 * (x1 * (x2 * x2)))
if (x2 <= (-1.9d+214)) then
tmp = t_0
else if (x2 <= (-8.5d-152)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1.35d-130) then
tmp = x1 + (x1 * (-2.0d0))
else if (x2 <= 6.1d+91) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x1 * (x2 * x2)));
double tmp;
if (x2 <= -1.9e+214) {
tmp = t_0;
} else if (x2 <= -8.5e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 1.35e-130) {
tmp = x1 + (x1 * -2.0);
} else if (x2 <= 6.1e+91) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x1 * (x2 * x2))) tmp = 0 if x2 <= -1.9e+214: tmp = t_0 elif x2 <= -8.5e-152: tmp = x2 * -6.0 elif x2 <= 1.35e-130: tmp = x1 + (x1 * -2.0) elif x2 <= 6.1e+91: tmp = x1 + (x2 * -6.0) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))) tmp = 0.0 if (x2 <= -1.9e+214) tmp = t_0; elseif (x2 <= -8.5e-152) tmp = Float64(x2 * -6.0); elseif (x2 <= 1.35e-130) tmp = Float64(x1 + Float64(x1 * -2.0)); elseif (x2 <= 6.1e+91) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x1 * (x2 * x2))); tmp = 0.0; if (x2 <= -1.9e+214) tmp = t_0; elseif (x2 <= -8.5e-152) tmp = x2 * -6.0; elseif (x2 <= 1.35e-130) tmp = x1 + (x1 * -2.0); elseif (x2 <= 6.1e+91) tmp = x1 + (x2 * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.9e+214], t$95$0, If[LessEqual[x2, -8.5e-152], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1.35e-130], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 6.1e+91], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{if}\;x2 \leq -1.9 \cdot 10^{+214}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -8.5 \cdot 10^{-152}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 1.35 \cdot 10^{-130}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{elif}\;x2 \leq 6.1 \cdot 10^{+91}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -1.89999999999999999e214 or 6.1e91 < x2 Initial program 65.0%
Taylor expanded in x1 around 0 58.4%
Taylor expanded in x2 around inf 49.5%
*-commutative49.5%
unpow249.5%
Simplified49.5%
if -1.89999999999999999e214 < x2 < -8.5000000000000007e-152Initial program 66.4%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 36.3%
*-commutative36.3%
Simplified36.3%
Taylor expanded in x1 around 0 36.9%
*-commutative36.9%
Simplified36.9%
if -8.5000000000000007e-152 < x2 < 1.34999999999999996e-130Initial program 79.7%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 50.7%
distribute-rgt1-in51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
if 1.34999999999999996e-130 < x2 < 6.1e91Initial program 92.2%
Taylor expanded in x1 around 0 67.7%
Taylor expanded in x1 around 0 59.4%
*-commutative59.4%
Simplified59.4%
Final simplification47.7%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -6.4e-150) (* x2 -6.0) (if (<= x2 2.4e-130) (+ x1 (* x1 -2.0)) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -6.4e-150) {
tmp = x2 * -6.0;
} else if (x2 <= 2.4e-130) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-6.4d-150)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 2.4d-130) then
tmp = x1 + (x1 * (-2.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -6.4e-150) {
tmp = x2 * -6.0;
} else if (x2 <= 2.4e-130) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -6.4e-150: tmp = x2 * -6.0 elif x2 <= 2.4e-130: tmp = x1 + (x1 * -2.0) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -6.4e-150) tmp = Float64(x2 * -6.0); elseif (x2 <= 2.4e-130) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -6.4e-150) tmp = x2 * -6.0; elseif (x2 <= 2.4e-130) tmp = x1 + (x1 * -2.0); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -6.4e-150], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 2.4e-130], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.4 \cdot 10^{-150}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 2.4 \cdot 10^{-130}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -6.3999999999999996e-150 or 2.39999999999999997e-130 < x2 Initial program 70.0%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x1 around 0 31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in x1 around 0 31.9%
*-commutative31.9%
Simplified31.9%
if -6.3999999999999996e-150 < x2 < 2.39999999999999997e-130Initial program 79.7%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 50.7%
distribute-rgt1-in51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
Final simplification38.6%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -3.9e-152) (* x2 -6.0) (if (<= x2 5.2e-130) (+ x1 (* x1 -2.0)) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -3.9e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 5.2e-130) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-3.9d-152)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 5.2d-130) then
tmp = x1 + (x1 * (-2.0d0))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -3.9e-152) {
tmp = x2 * -6.0;
} else if (x2 <= 5.2e-130) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -3.9e-152: tmp = x2 * -6.0 elif x2 <= 5.2e-130: tmp = x1 + (x1 * -2.0) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -3.9e-152) tmp = Float64(x2 * -6.0); elseif (x2 <= 5.2e-130) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -3.9e-152) tmp = x2 * -6.0; elseif (x2 <= 5.2e-130) tmp = x1 + (x1 * -2.0); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -3.9e-152], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 5.2e-130], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.9 \cdot 10^{-152}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 5.2 \cdot 10^{-130}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -3.9000000000000004e-152Initial program 64.2%
Taylor expanded in x1 around 0 51.8%
Taylor expanded in x1 around 0 31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in x1 around 0 32.4%
*-commutative32.4%
Simplified32.4%
if -3.9000000000000004e-152 < x2 < 5.2000000000000001e-130Initial program 79.7%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 50.7%
distribute-rgt1-in51.4%
metadata-eval51.4%
*-commutative51.4%
Simplified51.4%
if 5.2000000000000001e-130 < x2 Initial program 76.6%
Taylor expanded in x1 around 0 61.0%
Taylor expanded in x1 around 0 31.8%
*-commutative31.8%
Simplified31.8%
Final simplification38.7%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 73.3%
Taylor expanded in x1 around 0 58.2%
Taylor expanded in x1 around 0 24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in x1 around 0 25.0%
*-commutative25.0%
Simplified25.0%
Final simplification25.0%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 73.3%
Taylor expanded in x1 around 0 58.2%
Taylor expanded in x1 around inf 18.8%
Taylor expanded in x1 around 0 3.6%
Final simplification3.6%
herbie shell --seed 2023238
(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))))))