
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* t_0 (* (* x1 2.0) (+ t_0 -3.0))))
(fma t_1 t_0 (pow x1 3.0))))))
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), (t_0 * ((x1 * 2.0) * (t_0 + -3.0)))), fma(t_1, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(t_0 * Float64(Float64(x1 * 2.0) * Float64(t_0 + -3.0)))), fma(t_1, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), t_0 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_0 + -3\right)\right)\right), \mathsf{fma}\left(t_1, t_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\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 inf 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in x1 around inf 98.6%
sqr-pow98.6%
metadata-eval98.6%
pow298.6%
metadata-eval98.6%
pow298.6%
Applied egg-rr98.6%
Final simplification99.4%
(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 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5 (* (* t_4 (* x1 2.0)) (- t_4 3.0)))
(t_6 (* t_1 t_4)))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))) t_6) t_0))
t_3))
INFINITY)
(+
x1
(+
t_3
(+
x1
(+
t_0
(+
t_6
(*
t_2
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(*
(- (fma (* x1 3.0) x1 (+ x2 x2)) x1)
(/ 1.0 (fma x1 x1 1.0))))
6.0)))))))))
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0);
double t_6 = t_1 * t_4;
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (x2 + x2)) - x1) * (1.0 / fma(x1, x1, 1.0)))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) t_6 = Float64(t_1 * t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) - x1) * Float64(1.0 / fma(x1, x1, 1.0)))) - 6.0))))))))); else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right)\\
t_6 := t_1 \cdot t_4\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_6\right) + t_0\right)\right) + t_3\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(t_6 + t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \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) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
fma-def99.3%
div-inv99.4%
fma-def99.4%
count-299.4%
Applied egg-rr99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in x1 around inf 98.6%
sqr-pow98.6%
metadata-eval98.6%
pow298.6%
metadata-eval98.6%
pow298.6%
Applied egg-rr98.6%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in x1 around inf 98.6%
sqr-pow98.6%
metadata-eval98.6%
pow298.6%
metadata-eval98.6%
pow298.6%
Applied egg-rr98.6%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5e+102) (not (<= x1 5e+86)))
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 5e+86)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 5d+86))) then
tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 5e+86)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5e+102) or not (x1 <= 5e+86): tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5e+102) || !(x1 <= 5e+86)) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5e+102) || ~((x1 <= 5e+86))) tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 5e+86]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 5 \cdot 10^{+86}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102 or 4.9999999999999998e86 < x1 Initial program 18.6%
Taylor expanded in x1 around inf 30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in x1 around inf 98.8%
sqr-pow98.8%
metadata-eval98.8%
pow298.8%
metadata-eval98.8%
pow298.8%
Applied egg-rr98.8%
if -5e102 < x1 < 4.9999999999999998e86Initial program 98.7%
Taylor expanded in x1 around inf 97.9%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.7e+102)
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
(if (<= x1 1.85e+53)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* t_2 (* x1 2.0)) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.7d+102)) then
tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
else if (x1 <= 1.85d+53) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.7e+102: tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) elif x1 <= 1.85e+53: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); elseif (x1 <= 1.85e+53) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); elseif (x1 <= 1.85e+53) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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[(x1 + N[(6.0 * N[Power[x1, 4.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}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 2.4%
Taylor expanded in x1 around inf 23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in x1 around inf 97.6%
sqr-pow97.6%
metadata-eval97.6%
pow297.6%
metadata-eval97.6%
pow297.6%
Applied egg-rr97.6%
if -5.6999999999999999e102 < x1 < 1.85e53Initial program 98.7%
Taylor expanded in x1 around inf 96.8%
if 1.85e53 < x1 Initial program 41.8%
Taylor expanded in x1 around inf 40.6%
*-commutative40.6%
Simplified40.6%
Taylor expanded in x1 around inf 96.6%
Final simplification96.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5
(*
t_3
(+
(* (* t_4 (* x1 2.0)) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0)))))
(t_6 (* 3.0 (* x2 -2.0))))
(if (<= x1 -5.7e+102)
t_2
(if (<= x1 -0.0165)
(+ x1 (+ (+ x1 (+ t_0 (+ t_5 (* 3.0 t_1)))) t_6))
(if (<= x1 2e-22)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
(if (<= x1 5e+85)
(+ x1 (+ t_6 (+ x1 (+ t_0 (+ t_5 (* t_1 (+ 3.0 (/ -1.0 x1))))))))
t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
double t_6 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -5.7e+102) {
tmp = t_2;
} else if (x1 <= -0.0165) {
tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6);
} else if (x1 <= 2e-22) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 5e+85) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_5 = t_3 * (((t_4 * (x1 * 2.0d0)) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))
t_6 = 3.0d0 * (x2 * (-2.0d0))
if (x1 <= (-5.7d+102)) then
tmp = t_2
else if (x1 <= (-0.0165d0)) then
tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0d0 * t_1)))) + t_6)
else if (x1 <= 2d-22) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
else if (x1 <= 5d+85) then
tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0d0 + ((-1.0d0) / x1)))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)));
double t_6 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -5.7e+102) {
tmp = t_2;
} else if (x1 <= -0.0165) {
tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6);
} else if (x1 <= 2e-22) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 5e+85) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1)))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))) t_6 = 3.0 * (x2 * -2.0) tmp = 0 if x1 <= -5.7e+102: tmp = t_2 elif x1 <= -0.0165: tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6) elif x1 <= 2e-22: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))) elif x1 <= 5e+85: tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1))))))) else: tmp = 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(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(t_3 * Float64(Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) t_6 = Float64(3.0 * Float64(x2 * -2.0)) tmp = 0.0 if (x1 <= -5.7e+102) tmp = t_2; elseif (x1 <= -0.0165) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(3.0 * t_1)))) + t_6)); elseif (x1 <= 2e-22) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))))); elseif (x1 <= 5e+85) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1)))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = t_3 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0))); t_6 = 3.0 * (x2 * -2.0); tmp = 0.0; if (x1 <= -5.7e+102) tmp = t_2; elseif (x1 <= -0.0165) tmp = x1 + ((x1 + (t_0 + (t_5 + (3.0 * t_1)))) + t_6); elseif (x1 <= 2e-22) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))); elseif (x1 <= 5e+85) tmp = x1 + (t_6 + (x1 + (t_0 + (t_5 + (t_1 * (3.0 + (-1.0 / x1))))))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(t$95$3 * N[(N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $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]}, Block[{t$95$6 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], t$95$2, If[LessEqual[x1, -0.0165], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-22], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+85], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\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 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_3 \cdot \left(\left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right)\\
t_6 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -0.0165:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_5 + 3 \cdot t_1\right)\right)\right) + t_6\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_5 + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102 or 5.0000000000000001e85 < x1 Initial program 18.6%
Taylor expanded in x1 around inf 30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in x1 around inf 98.8%
sqr-pow98.8%
metadata-eval98.8%
pow298.8%
metadata-eval98.8%
pow298.8%
Applied egg-rr98.8%
if -5.6999999999999999e102 < x1 < -0.016500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around inf 99.4%
if -0.016500000000000001 < x1 < 2.0000000000000001e-22Initial program 98.5%
Taylor expanded in x1 around 0 89.2%
Taylor expanded in x2 around inf 89.2%
*-commutative89.0%
unpow289.0%
associate-*l*98.3%
Simplified98.5%
if 2.0000000000000001e-22 < x1 < 5.0000000000000001e85Initial program 98.9%
Taylor expanded in x1 around 0 91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in x1 around inf 98.9%
Final simplification98.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (* x2 -2.0))))))
(if (<= x1 -5e+102)
t_1
(if (<= x1 -0.004)
t_4
(if (<= x1 1.16e-7)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
(if (<= x1 3.6e+86) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5e+102) {
tmp = t_1;
} else if (x1 <= -0.004) {
tmp = t_4;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 3.6e+86) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * (x2 * (-2.0d0))))
if (x1 <= (-5d+102)) then
tmp = t_1
else if (x1 <= (-0.004d0)) then
tmp = t_4
else if (x1 <= 1.16d-7) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
else if (x1 <= 3.6d+86) then
tmp = t_4
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5e+102) {
tmp = t_1;
} else if (x1 <= -0.004) {
tmp = t_4;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 3.6e+86) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0))) tmp = 0 if x1 <= -5e+102: tmp = t_1 elif x1 <= -0.004: tmp = t_4 elif x1 <= 1.16e-7: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))) elif x1 <= 3.6e+86: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(x2 * -2.0)))) tmp = 0.0 if (x1 <= -5e+102) tmp = t_1; elseif (x1 <= -0.004) tmp = t_4; elseif (x1 <= 1.16e-7) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))))); elseif (x1 <= 3.6e+86) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0))); tmp = 0.0; if (x1 <= -5e+102) tmp = t_1; elseif (x1 <= -0.004) tmp = t_4; elseif (x1 <= 1.16e-7) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))); elseif (x1 <= 3.6e+86) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], t$95$1, If[LessEqual[x1, -0.004], t$95$4, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.6e+86], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -0.004:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{+86}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -5e102 or 3.60000000000000005e86 < x1 Initial program 18.6%
Taylor expanded in x1 around inf 30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in x1 around inf 98.8%
sqr-pow98.8%
metadata-eval98.8%
pow298.8%
metadata-eval98.8%
pow298.8%
Applied egg-rr98.8%
if -5e102 < x1 < -0.0040000000000000001 or 1.1600000000000001e-7 < x1 < 3.60000000000000005e86Initial program 99.0%
Taylor expanded in x1 around 0 97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x1 around inf 96.8%
if -0.0040000000000000001 < x1 < 1.1600000000000001e-7Initial program 98.6%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around inf 89.4%
*-commutative89.0%
unpow289.0%
associate-*l*98.1%
Simplified98.6%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -33000.0)
t_1
(if (<= x1 1.16e-7)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
(if (<= x1 1.85e+53)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(*
t_0
(+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0))))))
(* 3.0 (* x2 -2.0))))
t_1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -33000.0) {
tmp = t_1;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-33000.0d0)) then
tmp = t_1
else if (x1 <= 1.16d-7) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
else if (x1 <= 1.85d+53) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -33000.0) {
tmp = t_1;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -33000.0: tmp = t_1 elif x1 <= 1.16e-7: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))) elif x1 <= 1.85e+53: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -33000.0) tmp = t_1; elseif (x1 <= 1.16e-7) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))))); elseif (x1 <= 1.85e+53) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -33000.0) tmp = t_1; elseif (x1 <= 1.16e-7) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))); elseif (x1 <= 1.85e+53) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))) + (3.0 * (x2 * -2.0))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -33000.0], t$95$1, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -33000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot t_3 + t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -33000 or 1.85e53 < x1 Initial program 35.6%
Taylor expanded in x1 around inf 39.5%
*-commutative39.5%
Simplified39.5%
Taylor expanded in x1 around inf 93.6%
sqr-pow93.6%
metadata-eval93.6%
pow293.6%
metadata-eval93.6%
pow293.6%
Applied egg-rr93.6%
if -33000 < x1 < 1.1600000000000001e-7Initial program 98.6%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around inf 89.4%
*-commutative89.0%
unpow289.0%
associate-*l*98.1%
Simplified98.6%
if 1.1600000000000001e-7 < x1 < 1.85e53Initial program 98.9%
Taylor expanded in x1 around 0 94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x1 around inf 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -52000.0)
t_1
(if (<= x1 1.16e-7)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))
(if (<= x1 1.85e+53)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0)))
(* (* x1 x1) 9.0))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -52000.0) {
tmp = t_1;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-52000.0d0)) then
tmp = t_1
else if (x1 <= 1.16d-7) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
else if (x1 <= 1.85d+53) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + ((x1 * x1) * 9.0d0)))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -52000.0) {
tmp = t_1;
} else if (x1 <= 1.16e-7) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
} else if (x1 <= 1.85e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -52000.0: tmp = t_1 elif x1 <= 1.16e-7: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))) elif x1 <= 1.85e+53: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -52000.0) tmp = t_1; elseif (x1 <= 1.16e-7) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))))); elseif (x1 <= 1.85e+53) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(Float64(x1 * x1) * 9.0)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -52000.0) tmp = t_1; elseif (x1 <= 1.16e-7) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))); elseif (x1 <= 1.85e+53) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))) + ((x1 * x1) * 9.0))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -52000.0], t$95$1, If[LessEqual[x1, 1.16e-7], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e+53], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -52000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -52000 or 1.85e53 < x1 Initial program 35.6%
Taylor expanded in x1 around inf 39.5%
*-commutative39.5%
Simplified39.5%
Taylor expanded in x1 around inf 93.6%
sqr-pow93.6%
metadata-eval93.6%
pow293.6%
metadata-eval93.6%
pow293.6%
Applied egg-rr93.6%
if -52000 < x1 < 1.1600000000000001e-7Initial program 98.6%
Taylor expanded in x1 around 0 89.4%
Taylor expanded in x2 around inf 89.4%
*-commutative89.0%
unpow289.0%
associate-*l*98.1%
Simplified98.6%
if 1.1600000000000001e-7 < x1 < 1.85e53Initial program 98.9%
Taylor expanded in x1 around 0 94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x1 around inf 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
Taylor expanded in x1 around inf 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -16800000000.0) (not (<= x1 9.5e+36)))
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-16800000000.0d0)) .or. (.not. (x1 <= 9.5d+36))) then
tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -16800000000.0) or not (x1 <= 9.5e+36): tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -16800000000.0) || !(x1 <= 9.5e+36)) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); else 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(2.0 * Float64(x2 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -16800000000.0) || ~((x1 <= 9.5e+36))) tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (2.0 * (x2 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -16800000000.0], N[Not[LessEqual[x1, 9.5e+36]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $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] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -16800000000 \lor \neg \left(x1 \leq 9.5 \cdot 10^{+36}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.68e10 or 9.49999999999999974e36 < x1 Initial program 37.8%
Taylor expanded in x1 around inf 40.3%
*-commutative40.3%
Simplified40.3%
Taylor expanded in x1 around inf 92.6%
sqr-pow92.5%
metadata-eval92.5%
pow292.5%
metadata-eval92.5%
pow292.5%
Applied egg-rr92.5%
if -1.68e10 < x1 < 9.49999999999999974e36Initial program 98.6%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x2 around inf 87.0%
*-commutative86.4%
unpow286.4%
associate-*l*94.9%
Simplified95.5%
Final simplification94.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1))))))
(t_1
(+
x1
(+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
(if (<= x1 -7800000.0)
t_0
(if (<= x1 -4.2e-198)
t_1
(if (<= x1 1.75e-234)
(- (* x2 -6.0) x1)
(if (<= x1 8.2e+27) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -7800000.0) {
tmp = t_0;
} else if (x1 <= -4.2e-198) {
tmp = t_1;
} else if (x1 <= 1.75e-234) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 8.2e+27) {
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 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-7800000.0d0)) then
tmp = t_0
else if (x1 <= (-4.2d-198)) then
tmp = t_1
else if (x1 <= 1.75d-234) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 8.2d+27) 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 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -7800000.0) {
tmp = t_0;
} else if (x1 <= -4.2e-198) {
tmp = t_1;
} else if (x1 <= 1.75e-234) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 8.2e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -7800000.0: tmp = t_0 elif x1 <= -4.2e-198: tmp = t_1 elif x1 <= 1.75e-234: tmp = (x2 * -6.0) - x1 elif x1 <= 8.2e+27: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -7800000.0) tmp = t_0; elseif (x1 <= -4.2e-198) tmp = t_1; elseif (x1 <= 1.75e-234) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 8.2e+27) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -7800000.0) tmp = t_0; elseif (x1 <= -4.2e-198) tmp = t_1; elseif (x1 <= 1.75e-234) tmp = (x2 * -6.0) - x1; elseif (x1 <= 8.2e+27) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7800000.0], t$95$0, If[LessEqual[x1, -4.2e-198], t$95$1, If[LessEqual[x1, 1.75e-234], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 8.2e+27], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -7800000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.75 \cdot 10^{-234}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -7.8e6 or 8.2000000000000005e27 < x1 Initial program 39.9%
Taylor expanded in x1 around inf 40.7%
*-commutative40.7%
Simplified40.7%
Taylor expanded in x1 around inf 91.2%
sqr-pow91.1%
metadata-eval91.1%
pow291.1%
metadata-eval91.1%
pow291.1%
Applied egg-rr91.1%
if -7.8e6 < x1 < -4.19999999999999986e-198 or 1.7500000000000001e-234 < x1 < 8.2000000000000005e27Initial program 99.3%
Taylor expanded in x1 around 0 91.2%
Taylor expanded in x1 around 0 90.9%
if -4.19999999999999986e-198 < x1 < 1.7500000000000001e-234Initial program 96.8%
Taylor expanded in x1 around inf 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in x1 around 0 91.7%
*-commutative91.7%
fma-def91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in x1 around 0 91.8%
*-commutative91.8%
mul-1-neg91.8%
unsub-neg91.8%
Simplified91.8%
Final simplification91.1%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -52000000.0) (not (<= x1 8.2e+27)))
(+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))
(+
x1
(+ (+ x1 (* 4.0 (* 2.0 (* x2 (* x1 x2))))) (+ (* x1 -3.0) (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (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 <= (-52000000.0d0)) .or. (.not. (x1 <= 8.2d+27))) then
tmp = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
else
tmp = x1 + ((x1 + (4.0d0 * (2.0d0 * (x2 * (x1 * x2))))) + ((x1 * (-3.0d0)) + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27)) {
tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
} else {
tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -52000000.0) or not (x1 <= 8.2e+27): tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) else: tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -52000000.0) || !(x1 <= 8.2e+27)) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(2.0 * Float64(x2 * Float64(x1 * x2))))) + Float64(Float64(x1 * -3.0) + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -52000000.0) || ~((x1 <= 8.2e+27))) tmp = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); else tmp = x1 + ((x1 + (4.0 * (2.0 * (x2 * (x1 * x2))))) + ((x1 * -3.0) + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -52000000.0], N[Not[LessEqual[x1, 8.2e+27]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(2.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -52000000 \lor \neg \left(x1 \leq 8.2 \cdot 10^{+27}\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(2 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\right) + \left(x1 \cdot -3 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -5.2e7 or 8.2000000000000005e27 < x1 Initial program 39.9%
Taylor expanded in x1 around inf 40.7%
*-commutative40.7%
Simplified40.7%
Taylor expanded in x1 around inf 91.2%
sqr-pow91.1%
metadata-eval91.1%
pow291.1%
metadata-eval91.1%
pow291.1%
Applied egg-rr91.1%
if -5.2e7 < x1 < 8.2000000000000005e27Initial program 98.6%
Taylor expanded in x1 around 0 88.0%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x2 around inf 87.5%
*-commutative87.5%
unpow287.5%
associate-*l*96.2%
Simplified96.2%
Final simplification93.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))))
(if (<= x1 -1.75)
t_0
(if (<= x1 -4.8e-76)
(+ x1 (* x1 (* 8.0 (* x2 x2))))
(if (<= x1 1.16e-7) (- (* x2 -6.0) x1) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double tmp;
if (x1 <= -1.75) {
tmp = t_0;
} else if (x1 <= -4.8e-76) {
tmp = x1 + (x1 * (8.0 * (x2 * x2)));
} else if (x1 <= 1.16e-7) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
if (x1 <= (-1.75d0)) then
tmp = t_0
else if (x1 <= (-4.8d-76)) then
tmp = x1 + (x1 * (8.0d0 * (x2 * x2)))
else if (x1 <= 1.16d-7) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double tmp;
if (x1 <= -1.75) {
tmp = t_0;
} else if (x1 <= -4.8e-76) {
tmp = x1 + (x1 * (8.0 * (x2 * x2)));
} else if (x1 <= 1.16e-7) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) tmp = 0 if x1 <= -1.75: tmp = t_0 elif x1 <= -4.8e-76: tmp = x1 + (x1 * (8.0 * (x2 * x2))) elif x1 <= 1.16e-7: tmp = (x2 * -6.0) - x1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) tmp = 0.0 if (x1 <= -1.75) tmp = t_0; elseif (x1 <= -4.8e-76) tmp = Float64(x1 + Float64(x1 * Float64(8.0 * Float64(x2 * x2)))); elseif (x1 <= 1.16e-7) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); tmp = 0.0; if (x1 <= -1.75) tmp = t_0; elseif (x1 <= -4.8e-76) tmp = x1 + (x1 * (8.0 * (x2 * x2))); elseif (x1 <= 1.16e-7) tmp = (x2 * -6.0) - x1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.75], t$95$0, If[LessEqual[x1, -4.8e-76], N[(x1 + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.75:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-76}:\\
\;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.75 or 1.1600000000000001e-7 < x1 Initial program 43.3%
Taylor expanded in x1 around inf 39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in x1 around inf 86.7%
sqr-pow86.6%
metadata-eval86.6%
pow286.6%
metadata-eval86.6%
pow286.6%
Applied egg-rr86.6%
if -1.75 < x1 < -4.80000000000000026e-76Initial program 99.6%
Taylor expanded in x1 around 0 95.3%
Taylor expanded in x2 around inf 56.7%
*-commutative56.7%
associate-*l*56.7%
unpow256.7%
Simplified56.7%
if -4.80000000000000026e-76 < x1 < 1.1600000000000001e-7Initial program 98.4%
Taylor expanded in x1 around inf 80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in x1 around 0 80.3%
*-commutative80.3%
fma-def80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in x1 around 0 80.4%
*-commutative80.4%
mul-1-neg80.4%
unsub-neg80.4%
Simplified80.4%
Final simplification81.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* 6.0 (* (* x1 x1) (* x1 x1)))))))
(if (<= x1 -3900000.0)
t_0
(if (<= x1 -4e-117)
(+ x1 (+ (* x2 -6.0) (* (* x1 8.0) (* x2 x2))))
(if (<= x1 1.16e-7) (- (* x2 -6.0) x1) t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double tmp;
if (x1 <= -3900000.0) {
tmp = t_0;
} else if (x1 <= -4e-117) {
tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)));
} else if (x1 <= 1.16e-7) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + (x1 + (6.0d0 * ((x1 * x1) * (x1 * x1))))
if (x1 <= (-3900000.0d0)) then
tmp = t_0
else if (x1 <= (-4d-117)) then
tmp = x1 + ((x2 * (-6.0d0)) + ((x1 * 8.0d0) * (x2 * x2)))
else if (x1 <= 1.16d-7) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1))));
double tmp;
if (x1 <= -3900000.0) {
tmp = t_0;
} else if (x1 <= -4e-117) {
tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2)));
} else if (x1 <= 1.16e-7) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))) tmp = 0 if x1 <= -3900000.0: tmp = t_0 elif x1 <= -4e-117: tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2))) elif x1 <= 1.16e-7: tmp = (x2 * -6.0) - x1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(6.0 * Float64(Float64(x1 * x1) * Float64(x1 * x1))))) tmp = 0.0 if (x1 <= -3900000.0) tmp = t_0; elseif (x1 <= -4e-117) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(x1 * 8.0) * Float64(x2 * x2)))); elseif (x1 <= 1.16e-7) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (6.0 * ((x1 * x1) * (x1 * x1)))); tmp = 0.0; if (x1 <= -3900000.0) tmp = t_0; elseif (x1 <= -4e-117) tmp = x1 + ((x2 * -6.0) + ((x1 * 8.0) * (x2 * x2))); elseif (x1 <= 1.16e-7) tmp = (x2 * -6.0) - x1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3900000.0], t$95$0, If[LessEqual[x1, -4e-117], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x1 * 8.0), $MachinePrecision] * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.16e-7], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + 6 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3900000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4 \cdot 10^{-117}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 \cdot 8\right) \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.16 \cdot 10^{-7}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -3.9e6 or 1.1600000000000001e-7 < x1 Initial program 43.3%
Taylor expanded in x1 around inf 39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in x1 around inf 86.7%
sqr-pow86.6%
metadata-eval86.6%
pow286.6%
metadata-eval86.6%
pow286.6%
Applied egg-rr86.6%
if -3.9e6 < x1 < -4.00000000000000012e-117Initial program 99.7%
Taylor expanded in x1 around 0 96.5%
Taylor expanded in x1 around 0 95.6%
Taylor expanded in x2 around inf 73.1%
associate-*r*73.1%
unpow273.1%
Simplified73.1%
if -4.00000000000000012e-117 < x1 < 1.1600000000000001e-7Initial program 98.3%
Taylor expanded in x1 around inf 81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in x1 around 0 81.6%
*-commutative81.6%
fma-def81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in x1 around 0 81.7%
*-commutative81.7%
mul-1-neg81.7%
unsub-neg81.7%
Simplified81.7%
Final simplification83.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.8e+32) (not (<= x2 1.46e+128))) (+ x1 (* x1 (* 8.0 (* x2 x2)))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128)) {
tmp = x1 + (x1 * (8.0 * (x2 * x2)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-2.8d+32)) .or. (.not. (x2 <= 1.46d+128))) then
tmp = x1 + (x1 * (8.0d0 * (x2 * x2)))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128)) {
tmp = x1 + (x1 * (8.0 * (x2 * x2)));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.8e+32) or not (x2 <= 1.46e+128): tmp = x1 + (x1 * (8.0 * (x2 * x2))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.8e+32) || !(x2 <= 1.46e+128)) tmp = Float64(x1 + Float64(x1 * Float64(8.0 * Float64(x2 * x2)))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.8e+32) || ~((x2 <= 1.46e+128))) tmp = x1 + (x1 * (8.0 * (x2 * x2))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.8e+32], N[Not[LessEqual[x2, 1.46e+128]], $MachinePrecision]], N[(x1 + N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{+32} \lor \neg \left(x2 \leq 1.46 \cdot 10^{+128}\right):\\
\;\;\;\;x1 + x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x2 < -2.8e32 or 1.4599999999999999e128 < x2 Initial program 69.9%
Taylor expanded in x1 around 0 50.9%
Taylor expanded in x2 around inf 64.4%
*-commutative64.4%
associate-*l*64.4%
unpow264.4%
Simplified64.4%
if -2.8e32 < x2 < 1.4599999999999999e128Initial program 72.7%
Taylor expanded in x1 around inf 73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in x1 around 0 52.6%
*-commutative52.6%
fma-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x1 around 0 52.6%
*-commutative52.6%
mul-1-neg52.6%
unsub-neg52.6%
Simplified52.6%
Final simplification56.6%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.85e-195) (* x2 -6.0) (if (<= x2 8e-85) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.85e-195) {
tmp = x2 * -6.0;
} else if (x2 <= 8e-85) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-1.85d-195)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 8d-85) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.85e-195) {
tmp = x2 * -6.0;
} else if (x2 <= 8e-85) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.85e-195: tmp = x2 * -6.0 elif x2 <= 8e-85: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.85e-195) tmp = Float64(x2 * -6.0); elseif (x2 <= 8e-85) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.85e-195) tmp = x2 * -6.0; elseif (x2 <= 8e-85) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.85e-195], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 8e-85], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.85 \cdot 10^{-195}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 8 \cdot 10^{-85}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.84999999999999981e-195Initial program 64.7%
Taylor expanded in x1 around 0 47.4%
Taylor expanded in x1 around 0 29.5%
*-commutative29.5%
Simplified29.5%
Taylor expanded in x1 around 0 29.6%
*-commutative29.6%
Simplified29.6%
if -1.84999999999999981e-195 < x2 < 7.9999999999999998e-85Initial program 75.7%
Taylor expanded in x1 around 0 52.2%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x2 around 0 38.9%
distribute-rgt1-in38.9%
metadata-eval38.9%
mul-1-neg38.9%
Simplified38.9%
if 7.9999999999999998e-85 < x2 Initial program 76.5%
Taylor expanded in x1 around 0 58.2%
Taylor expanded in x1 around 0 32.7%
*-commutative32.7%
Simplified32.7%
Final simplification33.4%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -8.2e-199) (* x2 -6.0) (if (<= x2 7.6e-85) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -8.2e-199) {
tmp = x2 * -6.0;
} else if (x2 <= 7.6e-85) {
tmp = -x1;
} 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 <= (-8.2d-199)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 7.6d-85) then
tmp = -x1
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -8.2e-199) {
tmp = x2 * -6.0;
} else if (x2 <= 7.6e-85) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -8.2e-199: tmp = x2 * -6.0 elif x2 <= 7.6e-85: tmp = -x1 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -8.2e-199) tmp = Float64(x2 * -6.0); elseif (x2 <= 7.6e-85) tmp = Float64(-x1); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -8.2e-199) tmp = x2 * -6.0; elseif (x2 <= 7.6e-85) tmp = -x1; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -8.2e-199], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 7.6e-85], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8.2 \cdot 10^{-199}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 7.6 \cdot 10^{-85}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -8.20000000000000043e-199 or 7.5999999999999997e-85 < x2 Initial program 70.1%
Taylor expanded in x1 around 0 52.4%
Taylor expanded in x1 around 0 31.0%
*-commutative31.0%
Simplified31.0%
Taylor expanded in x1 around 0 31.0%
*-commutative31.0%
Simplified31.0%
if -8.20000000000000043e-199 < x2 < 7.5999999999999997e-85Initial program 75.7%
Taylor expanded in x1 around 0 52.2%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x2 around 0 38.9%
distribute-rgt1-in38.9%
metadata-eval38.9%
mul-1-neg38.9%
Simplified38.9%
Final simplification33.4%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 71.8%
Taylor expanded in x1 around inf 56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in x1 around 0 39.7%
*-commutative39.7%
fma-def39.8%
*-commutative39.8%
Simplified39.8%
Taylor expanded in x1 around 0 39.8%
*-commutative39.8%
mul-1-neg39.8%
unsub-neg39.8%
Simplified39.8%
Final simplification39.8%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 71.8%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x2 around 0 15.0%
distribute-rgt1-in15.0%
metadata-eval15.0%
mul-1-neg15.0%
Simplified15.0%
Final simplification15.0%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 71.8%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 25.9%
*-commutative25.9%
Simplified25.9%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2023271
(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))))))