
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<=
(+
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))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
(fma t_0 t_3 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if ((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) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), fma(t_0, t_3, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (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)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), fma(t_0, t_3, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return 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[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3 + N[Power[x1, 3.0], $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[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), \mathsf{fma}\left(t_0, t_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\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.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_6 (- t_4 3.0)))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_3 (+ (* (* (* x1 2.0) t_4) t_6) t_5)) (* 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
(*
t_6
(*
(* x1 2.0)
(*
(- (fma (* x1 3.0) x1 (+ x2 x2)) x1)
(/ 1.0 (fma x1 x1 1.0)))))))
(* x1 (+ -3.0 (* x1 9.0))))))))
(+ 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);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_6 = t_4 - 3.0;
double tmp;
if ((x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * t_6) + t_5)) + (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 + (t_6 * ((x1 * 2.0) * ((fma((x1 * 3.0), x1, (x2 + x2)) - x1) * (1.0 / fma(x1, x1, 1.0))))))) + (x1 * (-3.0 + (x1 * 9.0)))))));
} 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(x2 * -2.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_6 = Float64(t_4 - 3.0) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * t_6) + t_5)) + 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(t_6 * Float64(Float64(x1 * 2.0) * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0))))))) + Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0)))))))); 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[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 - 3.0), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * t$95$6), $MachinePrecision] + t$95$5), $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[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $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\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_6 := t_4 - 3\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot t_6 + t_5\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 + t_6 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\left(\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right) + x1 \cdot \left(-3 + x1 \cdot 9\right)\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 0 77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in x1 around inf 92.4%
Taylor expanded in x1 around 0 99.3%
+-commutative99.3%
metadata-eval99.3%
unpow299.3%
swap-sqr99.3%
associate-*r*99.3%
distribute-rgt-out99.3%
*-commutative99.3%
associate-*l*99.3%
metadata-eval99.3%
Simplified99.3%
fma-def99.3%
div-inv99.3%
fma-def99.3%
count-299.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 0 0.0%
*-commutative0.0%
Simplified0.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 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0)))))
(t_5 (* 3.0 (* x2 -2.0))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+ x1 (+ t_5 (+ x1 (+ t_0 (+ t_4 (* x1 (+ -3.0 (* x1 9.0))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) t_5)))))
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_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double t_5 = 3.0 * (x2 * -2.0);
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_4 + (x1 * (-3.0 + (x1 * 9.0)))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + t_5);
}
return tmp;
}
public static 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_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double t_5 = 3.0 * (x2 * -2.0);
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_4 + (x1 * (-3.0 + (x1 * 9.0)))))));
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + t_5);
}
return tmp;
}
def code(x1, x2): 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_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))) t_5 = 3.0 * (x2 * -2.0) tmp = 0 if (x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = x1 + (t_5 + (x1 + (t_0 + (t_4 + (x1 * (-3.0 + (x1 * 9.0))))))) else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + t_5) 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_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)))) t_5 = Float64(3.0 * Float64(x2 * -2.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_5)); end return tmp end
function tmp_2 = code(x1, x2) 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_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))); t_5 = 3.0 * (x2 * -2.0); tmp = 0.0; if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = x1 + (t_5 + (x1 + (t_0 + (t_4 + (x1 * (-3.0 + (x1 * 9.0))))))); else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + t_5); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(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$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]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $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_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_5 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_4 + t_1 \cdot t_3\right) + t_0\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_0 + \left(t_4 + x1 \cdot \left(-3 + x1 \cdot 9\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_5\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 0 77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in x1 around inf 92.4%
Taylor expanded in x1 around 0 99.3%
+-commutative99.3%
metadata-eval99.3%
unpow299.3%
swap-sqr99.3%
associate-*r*99.3%
distribute-rgt-out99.3%
*-commutative99.3%
associate-*l*99.3%
metadata-eval99.3%
Simplified99.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 0 0.0%
*-commutative0.0%
Simplified0.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 (+ -3.0 (* x1 9.0))))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_3)))
(if (<= x1 -1.45e+105)
(/ (fma x1 x1 (* (* x2 x2) -36.0)) (+ x1 (* x2 6.0)))
(if (<= x1 9e+47)
(+
x1
(+
t_1
(+
x1
(+
t_2
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
t_0)))))
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ t_0 (* t_3 (* x1 (* x1 6.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-3.0 + (x1 * 9.0));
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -1.45e+105) {
tmp = fma(x1, x1, ((x2 * x2) * -36.0)) / (x1 + (x2 * 6.0));
} else if (x1 <= 9e+47) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_0))));
} else {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_0 + (t_3 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_3) tmp = 0.0 if (x1 <= -1.45e+105) tmp = Float64(fma(x1, x1, Float64(Float64(x2 * x2) * -36.0)) / Float64(x1 + Float64(x2 * 6.0))); elseif (x1 <= 9e+47) tmp = Float64(x1 + Float64(t_1 + 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_0))))); else tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_0 + Float64(t_3 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.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[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[x1, -1.45e+105], N[(N[(x1 * x1 + N[(N[(x2 * x2), $MachinePrecision] * -36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e+47], N[(x1 + N[(t$95$1 + 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$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$0 + N[(t$95$3 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-3 + x1 \cdot 9\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_3}\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x1, x1, \left(x2 \cdot x2\right) \cdot -36\right)}{x1 + x2 \cdot 6}\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{+47}:\\
\;\;\;\;x1 + \left(t_1 + \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_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_0 + t_3 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.45000000000000005e105Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.5%
*-commutative0.5%
Simplified0.5%
flip-+2.3%
Applied egg-rr2.3%
fma-neg22.3%
swap-sqr22.3%
unpow222.3%
distribute-rgt-neg-in22.3%
unpow222.3%
metadata-eval22.3%
metadata-eval22.3%
sub-neg22.3%
distribute-rgt-neg-in22.3%
metadata-eval22.3%
Simplified22.3%
if -1.45000000000000005e105 < x1 < 8.99999999999999958e47Initial program 99.3%
Taylor expanded in x1 around 0 75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around 0 99.2%
+-commutative99.2%
metadata-eval99.2%
unpow299.2%
swap-sqr99.2%
associate-*r*99.2%
distribute-rgt-out99.3%
*-commutative99.3%
associate-*l*99.3%
metadata-eval99.3%
Simplified99.3%
if 8.99999999999999958e47 < x1 Initial program 41.3%
Taylor expanded in x1 around 0 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in x1 around inf 41.3%
Taylor expanded in x1 around 0 41.3%
+-commutative41.3%
metadata-eval41.3%
unpow241.3%
swap-sqr41.3%
associate-*r*41.3%
distribute-rgt-out41.3%
*-commutative41.3%
associate-*l*41.3%
metadata-eval41.3%
Simplified41.3%
Taylor expanded in x1 around inf 99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.9%
Simplified99.9%
Final simplification85.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_2))
(t_4 (* x1 (+ -3.0 (* x1 9.0)))))
(if (<= x1 -2e+103)
(+ x1 (+ t_0 (+ x1 (* 6.0 (* x1 (- (* 2.0 x2) 3.0))))))
(if (<= x1 9e+47)
(+
x1
(+
t_0
(+
x1
(+
t_1
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
t_4)))))
(+ x1 (+ t_0 (+ x1 (+ t_1 (+ t_4 (* t_2 (* x1 (* x1 6.0))))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -2e+103) {
tmp = x1 + (t_0 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 9e+47) {
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4))));
} else {
tmp = x1 + (t_0 + (x1 + (t_1 + (t_4 + (t_2 * (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 = 3.0d0 * (x2 * (-2.0d0))
t_1 = x1 * (x1 * x1)
t_2 = (x1 * x1) + 1.0d0
t_3 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 * ((-3.0d0) + (x1 * 9.0d0))
if (x1 <= (-2d+103)) then
tmp = x1 + (t_0 + (x1 + (6.0d0 * (x1 * ((2.0d0 * x2) - 3.0d0)))))
else if (x1 <= 9d+47) then
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + t_4))))
else
tmp = x1 + (t_0 + (x1 + (t_1 + (t_4 + (t_2 * (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);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -2e+103) {
tmp = x1 + (t_0 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 9e+47) {
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4))));
} else {
tmp = x1 + (t_0 + (x1 + (t_1 + (t_4 + (t_2 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = x1 * (x1 * x1) t_2 = (x1 * x1) + 1.0 t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_2 t_4 = x1 * (-3.0 + (x1 * 9.0)) tmp = 0 if x1 <= -2e+103: tmp = x1 + (t_0 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))) elif x1 <= 9e+47: tmp = x1 + (t_0 + (x1 + (t_1 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4)))) else: tmp = x1 + (t_0 + (x1 + (t_1 + (t_4 + (t_2 * (x1 * (x1 * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -2e+103) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(6.0 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))); elseif (x1 <= 9e+47) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_1 + 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)))) + t_4))))); else tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_1 + Float64(t_4 + Float64(t_2 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = x1 * (x1 * x1); t_2 = (x1 * x1) + 1.0; t_3 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_2; t_4 = x1 * (-3.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -2e+103) tmp = x1 + (t_0 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))); elseif (x1 <= 9e+47) tmp = x1 + (t_0 + (x1 + (t_1 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4)))); else tmp = x1 + (t_0 + (x1 + (t_1 + (t_4 + (t_2 * (x1 * (x1 * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+103], N[(x1 + N[(t$95$0 + N[(x1 + N[(6.0 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e+47], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$1 + 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] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$1 + N[(t$95$4 + N[(t$95$2 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 \cdot \left(-3 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + 6 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{+47}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \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_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \left(t_4 + t_2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -2e103 < x1 < 8.99999999999999958e47Initial program 99.3%
Taylor expanded in x1 around 0 75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around 0 99.2%
+-commutative99.2%
metadata-eval99.2%
unpow299.2%
swap-sqr99.2%
associate-*r*99.2%
distribute-rgt-out99.3%
*-commutative99.3%
associate-*l*99.3%
metadata-eval99.3%
Simplified99.3%
if 8.99999999999999958e47 < x1 Initial program 41.3%
Taylor expanded in x1 around 0 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in x1 around inf 41.3%
Taylor expanded in x1 around 0 41.3%
+-commutative41.3%
metadata-eval41.3%
unpow241.3%
swap-sqr41.3%
associate-*r*41.3%
distribute-rgt-out41.3%
*-commutative41.3%
associate-*l*41.3%
metadata-eval41.3%
Simplified41.3%
Taylor expanded in x1 around inf 99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.9%
Simplified99.9%
Final simplification85.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_0))
(t_3 (* x1 (* x1 x1)))
(t_4 (* x1 (+ -3.0 (* x1 9.0)))))
(if (<= x1 -1.25e+103)
(+ x1 (+ t_1 (+ x1 (* 6.0 (* x1 (- (* 2.0 x2) 3.0))))))
(if (<= x1 2e+44)
(+
x1
(+
t_1
(+
x1
(+
t_3
(+
t_4
(*
t_0
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (+ t_1 (+ x1 (+ t_3 (+ 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);
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -1.25e+103) {
tmp = x1 + (t_1 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 2e+44) {
tmp = x1 + (t_1 + (x1 + (t_3 + (t_4 + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_3 + (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))
t_2 = (((x1 * (x1 * 3.0d0)) + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 * (x1 * x1)
t_4 = x1 * ((-3.0d0) + (x1 * 9.0d0))
if (x1 <= (-1.25d+103)) then
tmp = x1 + (t_1 + (x1 + (6.0d0 * (x1 * ((2.0d0 * x2) - 3.0d0)))))
else if (x1 <= 2d+44) then
tmp = x1 + (t_1 + (x1 + (t_3 + (t_4 + (t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (t_1 + (x1 + (t_3 + (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);
double t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -1.25e+103) {
tmp = x1 + (t_1 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 2e+44) {
tmp = x1 + (t_1 + (x1 + (t_3 + (t_4 + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (t_1 + (x1 + (t_3 + (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) t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0 t_3 = x1 * (x1 * x1) t_4 = x1 * (-3.0 + (x1 * 9.0)) tmp = 0 if x1 <= -1.25e+103: tmp = x1 + (t_1 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))) elif x1 <= 2e+44: tmp = x1 + (t_1 + (x1 + (t_3 + (t_4 + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (t_1 + (x1 + (t_3 + (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(x2 * -2.0)) t_2 = Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -1.25e+103) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(6.0 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))); elseif (x1 <= 2e+44) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_3 + Float64(t_4 + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_3 + Float64(t_4 + Float64(t_0 * Float64(x1 * Float64(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); t_2 = (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / t_0; t_3 = x1 * (x1 * x1); t_4 = x1 * (-3.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -1.25e+103) tmp = x1 + (t_1 + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))); elseif (x1 <= 2e+44) tmp = x1 + (t_1 + (x1 + (t_3 + (t_4 + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (t_1 + (x1 + (t_3 + (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[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.25e+103], N[(x1 + N[(t$95$1 + N[(x1 + N[(6.0 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+44], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$3 + N[(t$95$4 + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$3 + N[(t$95$4 + N[(t$95$0 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $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\right)\\
t_2 := \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(-3 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -1.25 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + 6 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+44}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_3 + \left(t_4 + t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_3 + \left(t_4 + t_0 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.25e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -1.25e103 < x1 < 2.0000000000000002e44Initial program 99.3%
Taylor expanded in x1 around 0 75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x1 around inf 91.7%
Taylor expanded in x1 around 0 99.2%
+-commutative99.2%
metadata-eval99.2%
unpow299.2%
swap-sqr99.2%
associate-*r*99.2%
distribute-rgt-out99.3%
*-commutative99.3%
associate-*l*99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x1 around inf 96.8%
*-commutative47.2%
unpow247.2%
Simplified96.8%
if 2.0000000000000002e44 < x1 Initial program 41.3%
Taylor expanded in x1 around 0 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in x1 around inf 41.3%
Taylor expanded in x1 around 0 41.3%
+-commutative41.3%
metadata-eval41.3%
unpow241.3%
swap-sqr41.3%
associate-*r*41.3%
distribute-rgt-out41.3%
*-commutative41.3%
associate-*l*41.3%
metadata-eval41.3%
Simplified41.3%
Taylor expanded in x1 around inf 99.8%
*-commutative99.8%
unpow299.8%
associate-*l*99.9%
Simplified99.9%
Final simplification83.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (* x2 -2.0)))
(t_4 (* x1 (* x1 3.0))))
(if (<= x1 -1.6e+105)
(+ x1 (+ t_3 (+ x1 (* 6.0 t_0))))
(if (<= x1 -3.4e+19)
(+
x1
(+
t_3
(+
x1
(+
t_1
(+
(*
t_2
(+
(* (* x1 x1) (- (* (/ (- (+ t_4 (* 2.0 x2)) x1) t_2) 4.0) 6.0))
(* (* (* x1 2.0) 3.0) (/ -1.0 x1))))
(* 3.0 t_4))))))
(if (<= x1 13000000000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x2 t_0)))))
(+
x1
(+
t_3
(+
x1
(+
t_1
(+ (* x1 (+ -3.0 (* x1 9.0))) (* t_2 (* x1 (* x1 6.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -1.6e+105) {
tmp = x1 + (t_3 + (x1 + (6.0 * t_0)));
} else if (x1 <= -3.4e+19) {
tmp = x1 + (t_3 + (x1 + (t_1 + ((t_2 * (((x1 * x1) * (((((t_4 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))) + (3.0 * t_4)))));
} else if (x1 <= 13000000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_3 + (x1 + (t_1 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (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 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (x2 * (-2.0d0))
t_4 = x1 * (x1 * 3.0d0)
if (x1 <= (-1.6d+105)) then
tmp = x1 + (t_3 + (x1 + (6.0d0 * t_0)))
else if (x1 <= (-3.4d+19)) then
tmp = x1 + (t_3 + (x1 + (t_1 + ((t_2 * (((x1 * x1) * (((((t_4 + (2.0d0 * x2)) - x1) / t_2) * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * 3.0d0) * ((-1.0d0) / x1)))) + (3.0d0 * t_4)))))
else if (x1 <= 13000000000.0d0) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x2 * t_0))))
else
tmp = x1 + (t_3 + (x1 + (t_1 + ((x1 * ((-3.0d0) + (x1 * 9.0d0))) + (t_2 * (x1 * (x1 * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -1.6e+105) {
tmp = x1 + (t_3 + (x1 + (6.0 * t_0)));
} else if (x1 <= -3.4e+19) {
tmp = x1 + (t_3 + (x1 + (t_1 + ((t_2 * (((x1 * x1) * (((((t_4 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))) + (3.0 * t_4)))));
} else if (x1 <= 13000000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_3 + (x1 + (t_1 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * x1) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (x2 * -2.0) t_4 = x1 * (x1 * 3.0) tmp = 0 if x1 <= -1.6e+105: tmp = x1 + (t_3 + (x1 + (6.0 * t_0))) elif x1 <= -3.4e+19: tmp = x1 + (t_3 + (x1 + (t_1 + ((t_2 * (((x1 * x1) * (((((t_4 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))) + (3.0 * t_4))))) elif x1 <= 13000000000.0: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0)))) else: tmp = x1 + (t_3 + (x1 + (t_1 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(x2 * -2.0)) t_4 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= -1.6e+105) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * t_0)))); elseif (x1 <= -3.4e+19) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_1 + Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * 3.0) * Float64(-1.0 / x1)))) + Float64(3.0 * t_4)))))); elseif (x1 <= 13000000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x2 * t_0))))); else tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_1 + Float64(Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) + Float64(t_2 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * x1); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (x2 * -2.0); t_4 = x1 * (x1 * 3.0); tmp = 0.0; if (x1 <= -1.6e+105) tmp = x1 + (t_3 + (x1 + (6.0 * t_0))); elseif (x1 <= -3.4e+19) tmp = x1 + (t_3 + (x1 + (t_1 + ((t_2 * (((x1 * x1) * (((((t_4 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (((x1 * 2.0) * 3.0) * (-1.0 / x1)))) + (3.0 * t_4))))); elseif (x1 <= 13000000000.0) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0)))); else tmp = x1 + (t_3 + (x1 + (t_1 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+105], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.4e+19], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$1 + N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $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] + N[(3.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 13000000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$1 + N[(N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \left(x2 \cdot -2\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+105}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq -3.4 \cdot 10^{+19}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_1 + \left(t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_4 + 2 \cdot x2\right) - x1}{t_2} \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot \frac{-1}{x1}\right) + 3 \cdot t_4\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 13000000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_1 + \left(x1 \cdot \left(-3 + x1 \cdot 9\right) + t_2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.6e105Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -1.6e105 < x1 < -3.4e19Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
Taylor expanded in x1 around inf 85.4%
Taylor expanded in x1 around inf 85.4%
if -3.4e19 < x1 < 1.3e10Initial program 99.2%
Taylor expanded in x1 around 0 95.4%
if 1.3e10 < x1 Initial program 47.5%
Taylor expanded in x1 around 0 47.5%
*-commutative47.5%
Simplified47.5%
Taylor expanded in x1 around inf 47.5%
Taylor expanded in x1 around 0 47.5%
+-commutative47.5%
metadata-eval47.5%
unpow247.5%
swap-sqr47.5%
associate-*r*47.5%
distribute-rgt-out47.5%
*-commutative47.5%
associate-*l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in x1 around inf 95.1%
*-commutative95.1%
unpow295.1%
associate-*l*95.1%
Simplified95.1%
Final simplification81.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (* x1 (* x1 x1)))
(t_4 (* x1 (* x1 3.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_2 (+ x1 (* 6.0 t_0))))
(if (<= x1 -1.15e+31)
(+
x1
(+
t_2
(+
x1
(+
t_3
(+
(* 3.0 t_4)
(*
t_1
(+
(* (* x1 x1) 6.0)
(*
(- (/ (- (+ t_4 (* 2.0 x2)) x1) t_1) 3.0)
(* (* x1 2.0) 3.0)))))))))
(if (<= x1 2450000000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x2 t_0)))))
(+
x1
(+
t_2
(+
x1
(+
t_3
(+ (* x1 (+ -3.0 (* x1 9.0))) (* t_1 (* x1 (* x1 6.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.15e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((3.0 * t_4) + (t_1 * (((x1 * x1) * 6.0) + (((((t_4 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 2450000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (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 * ((2.0d0 * x2) - 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = x1 * (x1 * x1)
t_4 = x1 * (x1 * 3.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_2 + (x1 + (6.0d0 * t_0)))
else if (x1 <= (-1.15d+31)) then
tmp = x1 + (t_2 + (x1 + (t_3 + ((3.0d0 * t_4) + (t_1 * (((x1 * x1) * 6.0d0) + (((((t_4 + (2.0d0 * x2)) - x1) / t_1) - 3.0d0) * ((x1 * 2.0d0) * 3.0d0))))))))
else if (x1 <= 2450000000.0d0) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x2 * t_0))))
else
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * ((-3.0d0) + (x1 * 9.0d0))) + (t_1 * (x1 * (x1 * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.15e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((3.0 * t_4) + (t_1 * (((x1 * x1) * 6.0) + (((((t_4 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 2450000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (x2 * -2.0) t_3 = x1 * (x1 * x1) t_4 = x1 * (x1 * 3.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_2 + (x1 + (6.0 * t_0))) elif x1 <= -1.15e+31: tmp = x1 + (t_2 + (x1 + (t_3 + ((3.0 * t_4) + (t_1 * (((x1 * x1) * 6.0) + (((((t_4 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * 3.0)))))))) elif x1 <= 2450000000.0: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))) else: tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(x2 * -2.0)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * t_0)))); elseif (x1 <= -1.15e+31) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(Float64(3.0 * t_4) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_1) - 3.0) * Float64(Float64(x1 * 2.0) * 3.0))))))))); elseif (x1 <= 2450000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x2 * t_0))))); else tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) + Float64(t_1 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((2.0 * x2) - 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (x2 * -2.0); t_3 = x1 * (x1 * x1); t_4 = x1 * (x1 * 3.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_2 + (x1 + (6.0 * t_0))); elseif (x1 <= -1.15e+31) tmp = x1 + (t_2 + (x1 + (t_3 + ((3.0 * t_4) + (t_1 * (((x1 * x1) * 6.0) + (((((t_4 + (2.0 * x2)) - x1) / t_1) - 3.0) * ((x1 * 2.0) * 3.0)))))))); elseif (x1 <= 2450000000.0) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))); else tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e+31], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(N[(3.0 * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2450000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(3 \cdot t_4 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\frac{\left(t_4 + 2 \cdot x2\right) - x1}{t_1} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2450000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(x1 \cdot \left(-3 + x1 \cdot 9\right) + t_1 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -5.60000000000000037e102 < x1 < -1.15e31Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
Taylor expanded in x1 around inf 88.4%
Taylor expanded in x1 around inf 68.8%
*-commutative68.8%
unpow268.8%
Simplified68.8%
if -1.15e31 < x1 < 2.45e9Initial program 99.2%
Taylor expanded in x1 around 0 94.8%
if 2.45e9 < x1 Initial program 47.5%
Taylor expanded in x1 around 0 47.5%
*-commutative47.5%
Simplified47.5%
Taylor expanded in x1 around inf 47.5%
Taylor expanded in x1 around 0 47.5%
+-commutative47.5%
metadata-eval47.5%
unpow247.5%
swap-sqr47.5%
associate-*r*47.5%
distribute-rgt-out47.5%
*-commutative47.5%
associate-*l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in x1 around inf 95.1%
*-commutative95.1%
unpow295.1%
associate-*l*95.1%
Simplified95.1%
Final simplification79.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (* x1 (* x1 x1)))
(t_4 (* x1 (* x1 3.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_2 (+ x1 (* 6.0 t_0))))
(if (<= x1 -1.5e+31)
(+
x1
(+
t_2
(+
x1
(+
t_3
(+
(* t_4 (/ (- (+ t_4 (* 2.0 x2)) x1) t_1))
(* t_1 (* (* x1 x1) 6.0)))))))
(if (<= x1 13500000000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x2 t_0)))))
(+
x1
(+
t_2
(+
x1
(+
t_3
(+ (* x1 (+ -3.0 (* x1 9.0))) (* t_1 (* x1 (* x1 6.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.5e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_4 * (((t_4 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((x1 * x1) * 6.0))))));
} else if (x1 <= 13500000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (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 * ((2.0d0 * x2) - 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = x1 * (x1 * x1)
t_4 = x1 * (x1 * 3.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_2 + (x1 + (6.0d0 * t_0)))
else if (x1 <= (-1.5d+31)) then
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_4 * (((t_4 + (2.0d0 * x2)) - x1) / t_1)) + (t_1 * ((x1 * x1) * 6.0d0))))))
else if (x1 <= 13500000000.0d0) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x2 * t_0))))
else
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * ((-3.0d0) + (x1 * 9.0d0))) + (t_1 * (x1 * (x1 * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.5e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + ((t_4 * (((t_4 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((x1 * x1) * 6.0))))));
} else if (x1 <= 13500000000.0) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (x2 * -2.0) t_3 = x1 * (x1 * x1) t_4 = x1 * (x1 * 3.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_2 + (x1 + (6.0 * t_0))) elif x1 <= -1.5e+31: tmp = x1 + (t_2 + (x1 + (t_3 + ((t_4 * (((t_4 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((x1 * x1) * 6.0)))))) elif x1 <= 13500000000.0: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))) else: tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(x2 * -2.0)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * t_0)))); elseif (x1 <= -1.5e+31) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(Float64(t_4 * Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(t_1 * Float64(Float64(x1 * x1) * 6.0))))))); elseif (x1 <= 13500000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x2 * t_0))))); else tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) + Float64(t_1 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((2.0 * x2) - 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (x2 * -2.0); t_3 = x1 * (x1 * x1); t_4 = x1 * (x1 * 3.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_2 + (x1 + (6.0 * t_0))); elseif (x1 <= -1.5e+31) tmp = x1 + (t_2 + (x1 + (t_3 + ((t_4 * (((t_4 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((x1 * x1) * 6.0)))))); elseif (x1 <= 13500000000.0) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))); else tmp = x1 + (t_2 + (x1 + (t_3 + ((x1 * (-3.0 + (x1 * 9.0))) + (t_1 * (x1 * (x1 * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.5e+31], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(N[(t$95$4 * N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 13500000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq -1.5 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(t_4 \cdot \frac{\left(t_4 + 2 \cdot x2\right) - x1}{t_1} + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 13500000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_4 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(x1 \cdot \left(-3 + x1 \cdot 9\right) + t_1 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -5.60000000000000037e102 < x1 < -1.49999999999999995e31Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 68.5%
*-commutative68.4%
unpow268.4%
Simplified68.5%
if -1.49999999999999995e31 < x1 < 1.35e10Initial program 99.2%
Taylor expanded in x1 around 0 94.8%
if 1.35e10 < x1 Initial program 47.5%
Taylor expanded in x1 around 0 47.5%
*-commutative47.5%
Simplified47.5%
Taylor expanded in x1 around inf 47.5%
Taylor expanded in x1 around 0 47.5%
+-commutative47.5%
metadata-eval47.5%
unpow247.5%
swap-sqr47.5%
associate-*r*47.5%
distribute-rgt-out47.5%
*-commutative47.5%
associate-*l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in x1 around inf 95.1%
*-commutative95.1%
unpow295.1%
associate-*l*95.1%
Simplified95.1%
Final simplification79.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0)))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (+ (* x1 x1) 1.0)))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_1 (+ x1 (* 6.0 t_0))))
(if (or (<= x1 -1.15e+31) (not (<= x1 2400000000.0)))
(+
x1
(+
t_1
(+
x1
(+
(* x1 (* x1 x1))
(+ (* x1 (+ -3.0 (* x1 9.0))) (* t_2 (* x1 (* x1 6.0))))))))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x2 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (6.0 * t_0)));
} else if ((x1 <= -1.15e+31) || !(x1 <= 2400000000.0)) {
tmp = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0)))))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * ((2.0d0 * x2) - 3.0d0)
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = (x1 * x1) + 1.0d0
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_1 + (x1 + (6.0d0 * t_0)))
else if ((x1 <= (-1.15d+31)) .or. (.not. (x1 <= 2400000000.0d0))) then
tmp = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((x1 * ((-3.0d0) + (x1 * 9.0d0))) + (t_2 * (x1 * (x1 * 6.0d0)))))))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x2 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + (6.0 * t_0)));
} else if ((x1 <= -1.15e+31) || !(x1 <= 2400000000.0)) {
tmp = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0)))))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) t_1 = 3.0 * (x2 * -2.0) t_2 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_1 + (x1 + (6.0 * t_0))) elif (x1 <= -1.15e+31) or not (x1 <= 2400000000.0): tmp = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0))))))) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(6.0 * t_0)))); elseif ((x1 <= -1.15e+31) || !(x1 <= 2400000000.0)) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) + Float64(t_2 * Float64(x1 * Float64(x1 * 6.0)))))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x2 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((2.0 * x2) - 3.0); t_1 = 3.0 * (x2 * -2.0); t_2 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_1 + (x1 + (6.0 * t_0))); elseif ((x1 <= -1.15e+31) || ~((x1 <= 2400000000.0))) tmp = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((x1 * (-3.0 + (x1 * 9.0))) + (t_2 * (x1 * (x1 * 6.0))))))); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x2 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.15e+31], N[Not[LessEqual[x1, 2400000000.0]], $MachinePrecision]], N[(x1 + N[(t$95$1 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot x1 + 1\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+31} \lor \neg \left(x1 \leq 2400000000\right):\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(x1 \cdot \left(-3 + x1 \cdot 9\right) + t_2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -5.60000000000000037e102 < x1 < -1.15e31 or 2.4e9 < x1 Initial program 61.5%
Taylor expanded in x1 around 0 61.5%
*-commutative61.5%
Simplified61.5%
Taylor expanded in x1 around inf 61.5%
Taylor expanded in x1 around 0 61.5%
+-commutative61.5%
metadata-eval61.5%
unpow261.5%
swap-sqr61.5%
associate-*r*61.5%
distribute-rgt-out61.5%
*-commutative61.5%
associate-*l*61.5%
metadata-eval61.5%
Simplified61.5%
Taylor expanded in x1 around inf 87.9%
*-commutative87.9%
unpow287.9%
associate-*l*87.9%
Simplified87.9%
if -1.15e31 < x1 < 2.4e9Initial program 99.2%
Taylor expanded in x1 around 0 94.8%
Final simplification79.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (* x1 (* x1 x1)))
(t_4 (* x1 (+ -3.0 (* x1 9.0)))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_2 (+ x1 (* 6.0 t_0))))
(if (<= x1 -1.15e+31)
(+ x1 (+ t_2 (+ x1 (+ t_3 (+ t_4 (* t_1 (* (* x1 x1) 6.0)))))))
(if (<= x1 13000000000.0)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x2 t_0)))))
(+ x1 (+ t_2 (+ x1 (+ t_3 (+ t_4 (* t_1 (* x1 (* x1 6.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.15e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * ((x1 * x1) * 6.0))))));
} else if (x1 <= 13000000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * (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 * ((2.0d0 * x2) - 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = x1 * (x1 * x1)
t_4 = x1 * ((-3.0d0) + (x1 * 9.0d0))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_2 + (x1 + (6.0d0 * t_0)))
else if (x1 <= (-1.15d+31)) then
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * ((x1 * x1) * 6.0d0))))))
else if (x1 <= 13000000000.0d0) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x2 * t_0))))
else
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * (x1 * (x1 * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * x1);
double t_4 = x1 * (-3.0 + (x1 * 9.0));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_2 + (x1 + (6.0 * t_0)));
} else if (x1 <= -1.15e+31) {
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * ((x1 * x1) * 6.0))))));
} else if (x1 <= 13000000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0))));
} else {
tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * (x1 * (x1 * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (x2 * -2.0) t_3 = x1 * (x1 * x1) t_4 = x1 * (-3.0 + (x1 * 9.0)) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_2 + (x1 + (6.0 * t_0))) elif x1 <= -1.15e+31: tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * ((x1 * x1) * 6.0)))))) elif x1 <= 13000000000.0: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))) else: tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * (x1 * (x1 * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(x2 * -2.0)) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(6.0 * t_0)))); elseif (x1 <= -1.15e+31) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(t_4 + Float64(t_1 * Float64(Float64(x1 * x1) * 6.0))))))); elseif (x1 <= 13000000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x2 * t_0))))); else tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_3 + Float64(t_4 + Float64(t_1 * Float64(x1 * Float64(x1 * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((2.0 * x2) - 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (x2 * -2.0); t_3 = x1 * (x1 * x1); t_4 = x1 * (-3.0 + (x1 * 9.0)); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_2 + (x1 + (6.0 * t_0))); elseif (x1 <= -1.15e+31) tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * ((x1 * x1) * 6.0)))))); elseif (x1 <= 13000000000.0) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x2 * t_0)))); else tmp = x1 + (t_2 + (x1 + (t_3 + (t_4 + (t_1 * (x1 * (x1 * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e+31], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(t$95$4 + N[(t$95$1 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 13000000000.0], 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] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$3 + N[(t$95$4 + N[(t$95$1 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := x1 \cdot \left(-3 + x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(t_4 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 13000000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_3 + \left(t_4 + t_1 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 19.4%
if -5.60000000000000037e102 < x1 < -1.15e31Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
Taylor expanded in x1 around 0 99.6%
+-commutative99.6%
metadata-eval99.6%
unpow299.6%
swap-sqr99.6%
associate-*r*99.6%
distribute-rgt-out99.6%
*-commutative99.6%
associate-*l*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x1 around inf 68.4%
*-commutative68.4%
unpow268.4%
Simplified68.4%
if -1.15e31 < x1 < 1.3e10Initial program 99.2%
Taylor expanded in x1 around 0 94.8%
if 1.3e10 < x1 Initial program 47.5%
Taylor expanded in x1 around 0 47.5%
*-commutative47.5%
Simplified47.5%
Taylor expanded in x1 around inf 47.5%
Taylor expanded in x1 around 0 47.5%
+-commutative47.5%
metadata-eval47.5%
unpow247.5%
swap-sqr47.5%
associate-*r*47.5%
distribute-rgt-out47.5%
*-commutative47.5%
associate-*l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in x1 around inf 95.1%
*-commutative95.1%
unpow295.1%
associate-*l*95.1%
Simplified95.1%
Final simplification79.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -7.2e+74)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* 6.0 (* x1 (- (* 2.0 x2) 3.0))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -7.2e+74) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} 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 <= (-7.2d+74)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (6.0d0 * (x1 * ((2.0d0 * x2) - 3.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))))
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 <= -7.2e+74) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -7.2e+74: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -7.2e+74) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(6.0 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)))))); elseif (x1 <= 1.35e+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(2.0 * Float64(x1 * x2))))))); 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 <= -7.2e+74) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * (x1 * ((2.0 * x2) - 3.0))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -7.2e+74], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(6.0 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+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[(2.0 * N[(x1 * x2), $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 -7.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 6 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \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(2 \cdot \left(x1 \cdot x2\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 < -7.19999999999999975e74Initial program 11.8%
Taylor expanded in x1 around 0 11.8%
*-commutative11.8%
Simplified11.8%
Taylor expanded in x1 around inf 11.8%
Taylor expanded in x1 around inf 11.8%
Taylor expanded in x1 around 0 17.6%
if -7.19999999999999975e74 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 81.5%
Taylor expanded in x2 around inf 81.5%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.5%
*-commutative6.5%
Simplified6.5%
flip-+75.0%
Applied egg-rr75.0%
swap-sqr75.0%
metadata-eval75.0%
Simplified75.0%
Final simplification68.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* 2.0 x2) 3.0))))
(if (<= x1 -6.2e+78)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* 6.0 t_0))))
(if (<= x1 3.1e+150)
(+ x1 (+ (+ x1 (* 4.0 (* x2 t_0))) (* 3.0 (- (* x2 -2.0) x1))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -6.2e+78) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * t_0)));
} else if (x1 <= 3.1e+150) {
tmp = x1 + ((x1 + (4.0 * (x2 * t_0))) + (3.0 * ((x2 * -2.0) - x1)));
} 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) :: t_0
real(8) :: tmp
t_0 = x1 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-6.2d+78)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (6.0d0 * t_0)))
else if (x1 <= 3.1d+150) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * t_0))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
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 t_0 = x1 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -6.2e+78) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * t_0)));
} else if (x1 <= 3.1e+150) {
tmp = x1 + ((x1 + (4.0 * (x2 * t_0))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -6.2e+78: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * t_0))) elif x1 <= 3.1e+150: tmp = x1 + ((x1 + (4.0 * (x2 * t_0))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -6.2e+78) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(6.0 * t_0)))); elseif (x1 <= 3.1e+150) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * t_0))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); 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) t_0 = x1 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -6.2e+78) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (6.0 * t_0))); elseif (x1 <= 3.1e+150) tmp = x1 + ((x1 + (4.0 * (x2 * t_0))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.2e+78], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(6.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+150], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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}
t_0 := x1 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+78}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 6 \cdot t_0\right)\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot t_0\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\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 < -6.2e78Initial program 11.8%
Taylor expanded in x1 around 0 11.8%
*-commutative11.8%
Simplified11.8%
Taylor expanded in x1 around inf 11.8%
Taylor expanded in x1 around inf 11.8%
Taylor expanded in x1 around 0 17.6%
if -6.2e78 < x1 < 3.10000000000000014e150Initial program 99.2%
Taylor expanded in x1 around 0 82.4%
Taylor expanded in x1 around 0 81.8%
if 3.10000000000000014e150 < x1 Initial program 7.7%
Taylor expanded in x1 around 0 0.4%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+69.6%
Applied egg-rr69.6%
swap-sqr69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification67.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* 8.0 (* x2 (* x1 x2)))))
(t_1 (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))
(if (<= x2 -1.56e+107)
t_0
(if (<= x2 -1.45e-153)
t_1
(if (<= x2 1.85e-173) (* x2 -6.0) (if (<= x2 2.85e+110) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (8.0 * (x2 * (x1 * x2)));
double t_1 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
double tmp;
if (x2 <= -1.56e+107) {
tmp = t_0;
} else if (x2 <= -1.45e-153) {
tmp = t_1;
} else if (x2 <= 1.85e-173) {
tmp = x2 * -6.0;
} else if (x2 <= 2.85e+110) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x1 + (8.0d0 * (x2 * (x1 * x2)))
t_1 = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
if (x2 <= (-1.56d+107)) then
tmp = t_0
else if (x2 <= (-1.45d-153)) then
tmp = t_1
else if (x2 <= 1.85d-173) then
tmp = x2 * (-6.0d0)
else if (x2 <= 2.85d+110) then
tmp = t_1
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 t_1 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
double tmp;
if (x2 <= -1.56e+107) {
tmp = t_0;
} else if (x2 <= -1.45e-153) {
tmp = t_1;
} else if (x2 <= 1.85e-173) {
tmp = x2 * -6.0;
} else if (x2 <= 2.85e+110) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (8.0 * (x2 * (x1 * x2))) t_1 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) tmp = 0 if x2 <= -1.56e+107: tmp = t_0 elif x2 <= -1.45e-153: tmp = t_1 elif x2 <= 1.85e-173: tmp = x2 * -6.0 elif x2 <= 2.85e+110: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) t_1 = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))) tmp = 0.0 if (x2 <= -1.56e+107) tmp = t_0; elseif (x2 <= -1.45e-153) tmp = t_1; elseif (x2 <= 1.85e-173) tmp = Float64(x2 * -6.0); elseif (x2 <= 2.85e+110) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (8.0 * (x2 * (x1 * x2))); t_1 = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); tmp = 0.0; if (x2 <= -1.56e+107) tmp = t_0; elseif (x2 <= -1.45e-153) tmp = t_1; elseif (x2 <= 1.85e-173) tmp = x2 * -6.0; elseif (x2 <= 2.85e+110) tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.56e+107], t$95$0, If[LessEqual[x2, -1.45e-153], t$95$1, If[LessEqual[x2, 1.85e-173], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 2.85e+110], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
t_1 := \frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\mathbf{if}\;x2 \leq -1.56 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -1.45 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x2 \leq 1.85 \cdot 10^{-173}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 2.85 \cdot 10^{+110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -1.55999999999999987e107 or 2.8500000000000001e110 < x2 Initial program 72.7%
Taylor expanded in x1 around 0 65.9%
Taylor expanded in x2 around inf 55.0%
unpow255.0%
associate-*l*64.3%
Simplified64.3%
if -1.55999999999999987e107 < x2 < -1.45000000000000001e-153 or 1.85e-173 < x2 < 2.8500000000000001e110Initial program 70.0%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 40.7%
*-commutative40.7%
Simplified40.7%
flip-+52.7%
Applied egg-rr52.7%
swap-sqr52.6%
metadata-eval52.6%
Simplified52.6%
if -1.45000000000000001e-153 < x2 < 1.85e-173Initial program 76.7%
Taylor expanded in x1 around 0 60.5%
Taylor expanded in x1 around 0 14.2%
*-commutative14.2%
Simplified14.2%
Taylor expanded in x1 around 0 14.9%
*-commutative14.9%
Simplified14.9%
Final simplification47.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1e+145) (not (<= x2 2.3e-13))) (+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* 4.0 (* x2 (* 2.0 (* x1 x2))))))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1e+145) || !(x2 <= 2.3e-13)) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1d+145)) .or. (.not. (x2 <= 2.3d-13))) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (4.0d0 * (x2 * (2.0d0 * (x1 * x2))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1e+145) || !(x2 <= 2.3e-13)) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1e+145) or not (x2 <= 2.3e-13): tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1e+145) || !(x2 <= 2.3e-13)) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(2.0 * Float64(x1 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1e+145) || ~((x2 <= 2.3e-13))) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (4.0 * (x2 * (2.0 * (x1 * x2)))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1e+145], N[Not[LessEqual[x2, 2.3e-13]], $MachinePrecision]], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1 \cdot 10^{+145} \lor \neg \left(x2 \leq 2.3 \cdot 10^{-13}\right):\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + 4 \cdot \left(x2 \cdot \left(2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -9.9999999999999999e144 or 2.29999999999999979e-13 < x2 Initial program 73.7%
Taylor expanded in x1 around 0 64.7%
Taylor expanded in x1 around 0 72.1%
*-commutative73.7%
Simplified72.1%
Taylor expanded in x2 around inf 72.1%
if -9.9999999999999999e144 < x2 < 2.29999999999999979e-13Initial program 71.8%
Taylor expanded in x1 around 0 53.4%
Taylor expanded in x1 around 0 56.6%
Final simplification62.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.45e+110)
(+ x1 (+ x1 (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 3.1e+150)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.45e+110) {
tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 3.1e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.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 <= (-1.45d+110)) then
tmp = x1 + (x1 + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 3.1d+150) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.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 <= -1.45e+110) {
tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 3.1e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.45e+110: tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 3.1e+150: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.45e+110) tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 3.1e+150) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.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 <= -1.45e+110) tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 3.1e+150) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.45e+110], N[(x1 + N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.1e+150], 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], 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 -1.45 \cdot 10^{+110}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\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 < -1.45e110Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative0.0%
Simplified0.1%
Taylor expanded in x2 around 0 19.4%
if -1.45e110 < x1 < 3.10000000000000014e150Initial program 98.2%
Taylor expanded in x1 around 0 78.9%
Taylor expanded in x1 around 0 70.8%
if 3.10000000000000014e150 < x1 Initial program 7.7%
Taylor expanded in x1 around 0 0.4%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
flip-+69.6%
Applied egg-rr69.6%
swap-sqr69.6%
metadata-eval69.6%
Simplified69.6%
Final simplification62.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.1e+87)
(+ x1 (+ x1 (* x2 (- (* x1 -12.0) 6.0))))
(if (or (<= x1 -1.7e-101) (not (<= x1 4.4e-177)))
(+ x1 (* 8.0 (* x2 (* x1 x2))))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.1e+87) {
tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -1.7e-101) || !(x1 <= 4.4e-177)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.1d+87)) then
tmp = x1 + (x1 + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if ((x1 <= (-1.7d-101)) .or. (.not. (x1 <= 4.4d-177))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.1e+87) {
tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -1.7e-101) || !(x1 <= 4.4e-177)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.1e+87: tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0))) elif (x1 <= -1.7e-101) or not (x1 <= 4.4e-177): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.1e+87) tmp = Float64(x1 + Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif ((x1 <= -1.7e-101) || !(x1 <= 4.4e-177)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.1e+87) tmp = x1 + (x1 + (x2 * ((x1 * -12.0) - 6.0))); elseif ((x1 <= -1.7e-101) || ~((x1 <= 4.4e-177))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.1e+87], N[(x1 + N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.7e-101], N[Not[LessEqual[x1, 4.4e-177]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+87}:\\
\;\;\;\;x1 + \left(x1 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -1.7 \cdot 10^{-101} \lor \neg \left(x1 \leq 4.4 \cdot 10^{-177}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.1e87Initial program 4.3%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.1%
*-commutative4.3%
Simplified0.1%
Taylor expanded in x2 around 0 17.8%
if -2.1e87 < x1 < -1.69999999999999995e-101 or 4.40000000000000023e-177 < x1 Initial program 81.9%
Taylor expanded in x1 around 0 55.8%
Taylor expanded in x2 around inf 35.8%
unpow235.8%
associate-*l*40.3%
Simplified40.3%
if -1.69999999999999995e-101 < x1 < 4.40000000000000023e-177Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x1 around 0 69.3%
*-commutative69.3%
Simplified69.3%
Final simplification44.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.7e-99) (not (<= x1 2.6e-116))) (* x1 (+ 2.0 (* (* x2 x2) 8.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.7e-99) || !(x1 <= 2.6e-116)) {
tmp = x1 * (2.0 + ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.7d-99)) .or. (.not. (x1 <= 2.6d-116))) then
tmp = x1 * (2.0d0 + ((x2 * x2) * 8.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.7e-99) || !(x1 <= 2.6e-116)) {
tmp = x1 * (2.0 + ((x2 * x2) * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.7e-99) or not (x1 <= 2.6e-116): tmp = x1 * (2.0 + ((x2 * x2) * 8.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.7e-99) || !(x1 <= 2.6e-116)) tmp = Float64(x1 * Float64(2.0 + Float64(Float64(x2 * x2) * 8.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.7e-99) || ~((x1 <= 2.6e-116))) tmp = x1 * (2.0 + ((x2 * x2) * 8.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.7e-99], N[Not[LessEqual[x1, 2.6e-116]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.7 \cdot 10^{-99} \lor \neg \left(x1 \leq 2.6 \cdot 10^{-116}\right):\\
\;\;\;\;x1 \cdot \left(2 + \left(x2 \cdot x2\right) \cdot 8\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.70000000000000003e-99 or 2.6e-116 < x1 Initial program 58.5%
Taylor expanded in x1 around 0 35.8%
Taylor expanded in x1 around 0 31.6%
*-commutative46.0%
Simplified31.6%
Taylor expanded in x2 around inf 31.6%
Taylor expanded in x1 around inf 28.3%
*-commutative28.3%
unpow228.3%
Simplified28.3%
if -1.70000000000000003e-99 < x1 < 2.6e-116Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in x1 around 0 61.8%
*-commutative61.8%
Simplified61.8%
Final simplification39.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.7e+106) (not (<= x2 6.4e+120))) (+ x1 (* 8.0 (* x2 (* x1 x2)))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.7e+106) || !(x2 <= 6.4e+120)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} 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 <= (-2.7d+106)) .or. (.not. (x2 <= 6.4d+120))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.7e+106) || !(x2 <= 6.4e+120)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.7e+106) or not (x2 <= 6.4e+120): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.7e+106) || !(x2 <= 6.4e+120)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.7e+106) || ~((x2 <= 6.4e+120))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.7e+106], N[Not[LessEqual[x2, 6.4e+120]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.7 \cdot 10^{+106} \lor \neg \left(x2 \leq 6.4 \cdot 10^{+120}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -2.70000000000000006e106 or 6.39999999999999964e120 < x2 Initial program 73.5%
Taylor expanded in x1 around 0 66.6%
Taylor expanded in x2 around inf 55.6%
unpow255.6%
associate-*l*65.1%
Simplified65.1%
if -2.70000000000000006e106 < x2 < 6.39999999999999964e120Initial program 72.0%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 30.8%
*-commutative30.8%
Simplified30.8%
Taylor expanded in x1 around 0 30.8%
*-commutative30.8%
Simplified30.8%
Final simplification42.1%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.05e-100) (+ x1 (* 8.0 (* x1 (* x2 x2)))) (if (<= x1 1.7e-114) (* x2 -6.0) (* x1 (+ 2.0 (* (* x2 x2) 8.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e-100) {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
} else if (x1 <= 1.7e-114) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + ((x2 * x2) * 8.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.05d-100)) then
tmp = x1 + (8.0d0 * (x1 * (x2 * x2)))
else if (x1 <= 1.7d-114) then
tmp = x2 * (-6.0d0)
else
tmp = x1 * (2.0d0 + ((x2 * x2) * 8.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e-100) {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
} else if (x1 <= 1.7e-114) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (2.0 + ((x2 * x2) * 8.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.05e-100: tmp = x1 + (8.0 * (x1 * (x2 * x2))) elif x1 <= 1.7e-114: tmp = x2 * -6.0 else: tmp = x1 * (2.0 + ((x2 * x2) * 8.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.05e-100) tmp = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))); elseif (x1 <= 1.7e-114) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 * Float64(2.0 + Float64(Float64(x2 * x2) * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.05e-100) tmp = x1 + (8.0 * (x1 * (x2 * x2))); elseif (x1 <= 1.7e-114) tmp = x2 * -6.0; else tmp = x1 * (2.0 + ((x2 * x2) * 8.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.05e-100], N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.7e-114], N[(x2 * -6.0), $MachinePrecision], N[(x1 * N[(2.0 + N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{-100}:\\
\;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.7 \cdot 10^{-114}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + \left(x2 \cdot x2\right) \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -2.0499999999999999e-100Initial program 49.0%
Taylor expanded in x1 around 0 29.3%
Taylor expanded in x2 around inf 15.0%
*-commutative15.0%
unpow215.0%
Simplified15.0%
if -2.0499999999999999e-100 < x1 < 1.69999999999999991e-114Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
Taylor expanded in x1 around 0 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in x1 around 0 61.8%
*-commutative61.8%
Simplified61.8%
if 1.69999999999999991e-114 < x1 Initial program 69.1%
Taylor expanded in x1 around 0 43.2%
Taylor expanded in x1 around 0 46.8%
*-commutative56.0%
Simplified46.8%
Taylor expanded in x2 around inf 46.8%
Taylor expanded in x1 around inf 43.3%
*-commutative43.3%
unpow243.3%
Simplified43.3%
Final simplification39.8%
(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 72.5%
Taylor expanded in x1 around 0 57.7%
Taylor expanded in x1 around 0 24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in x1 around 0 24.6%
*-commutative24.6%
Simplified24.6%
Final simplification24.6%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 72.5%
Taylor expanded in x1 around 0 57.7%
Taylor expanded in x1 around 0 24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2023270
(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))))))