
(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))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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 7.6%
*-commutative7.6%
Simplified7.6%
Taylor expanded in x1 around inf 97.9%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
t_0
(fma
(fma (* (* x1 2.0) t_4) (+ -3.0 t_4) (* (* x1 x1) (fma 4.0 t_4 -6.0)))
(fma x1 x1 1.0)
(* t_1 t_4)))
(+ x1 (* 3.0 (/ (- t_1 (+ x1 (* 2.0 x2))) (fma x1 x1 1.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_0 + fma(fma(((x1 * 2.0) * t_4), (-3.0 + t_4), ((x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), (t_1 * t_4))) + (x1 + (3.0 * ((t_1 - (x1 + (2.0 * x2))) / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_0 + fma(fma(Float64(Float64(x1 * 2.0) * t_4), Float64(-3.0 + t_4), Float64(Float64(x1 * x1) * fma(4.0, t_4, -6.0))), fma(x1, x1, 1.0), Float64(t_1 * t_4))) + Float64(x1 + Float64(3.0 * Float64(Float64(t_1 - Float64(x1 + Float64(2.0 * x2))) / fma(x1, x1, 1.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$0 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(-3.0 + t$95$4), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$4 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t\_0 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t\_4, -3 + t\_4, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t\_4, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t\_1 \cdot t\_4\right)\right) + \left(x1 + 3 \cdot \frac{t\_1 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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.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 7.6%
*-commutative7.6%
Simplified7.6%
Taylor expanded in x1 around inf 97.9%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))))
(if (<= (+ x1 (+ t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))) INFINITY)
(+
x1
(+
t_3
(* 3.0 (/ (fma 3.0 (pow x1 2.0) (- (fma 2.0 x2 x1))) (fma x1 x1 1.0)))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)));
double tmp;
if ((x1 + (t_3 + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (3.0 * (fma(3.0, pow(x1, 2.0), -fma(2.0, x2, x1)) / fma(x1, x1, 1.0))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(fma(3.0, (x1 ^ 2.0), Float64(-fma(2.0, x2, x1))) / fma(x1, x1, 1.0))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + (-N[(2.0 * x2 + x1), $MachinePrecision])), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{if}\;x1 + \left(t\_3 + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_3 + 3 \cdot \frac{\mathsf{fma}\left(3, {x1}^{2}, -\mathsf{fma}\left(2, x2, x1\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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-define99.3%
*-un-lft-identity99.3%
associate--l-99.3%
associate-*r*99.3%
fma-neg99.3%
fma-define99.3%
pow299.3%
Applied egg-rr99.3%
*-lft-identity99.3%
Simplified99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 7.6%
*-commutative7.6%
Simplified7.6%
Taylor expanded in x1 around inf 97.9%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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 7.6%
*-commutative7.6%
Simplified7.6%
Taylor expanded in x1 around inf 97.9%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3))
(t_5 (* (* x1 2.0) t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_3 (+ (* t_5 (- t_4 3.0)) t_6))
(* t_0 (+ 3.0 (/ -1.0 x1))))))))))
(if (<= x1 -3.5e+120)
t_2
(if (<= x1 -0.00125)
t_7
(if (<= x1 0.44)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))
(+
x1
(+
t_1
(+
(* t_3 (+ t_6 (* t_5 (- (* 2.0 x2) 3.0))))
(* t_0 (* 2.0 x2)))))))
(if (<= x1 3.5e+50) t_7 t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (3.0 + (-1.0 / x1)))))));
double tmp;
if (x1 <= -3.5e+120) {
tmp = t_2;
} else if (x1 <= -0.00125) {
tmp = t_7;
} else if (x1 <= 0.44) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_3 * (t_6 + (t_5 * ((2.0 * x2) - 3.0)))) + (t_0 * (2.0 * x2))))));
} else if (x1 <= 3.5e+50) {
tmp = t_7;
} 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) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_3
t_5 = (x1 * 2.0d0) * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_7 = x1 + (9.0d0 + (x1 + (t_1 + ((t_3 * ((t_5 * (t_4 - 3.0d0)) + t_6)) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))))
if (x1 <= (-3.5d+120)) then
tmp = t_2
else if (x1 <= (-0.00125d0)) then
tmp = t_7
else if (x1 <= 0.44d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_3 * (t_6 + (t_5 * ((2.0d0 * x2) - 3.0d0)))) + (t_0 * (2.0d0 * x2))))))
else if (x1 <= 3.5d+50) then
tmp = t_7
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (3.0 + (-1.0 / x1)))))));
double tmp;
if (x1 <= -3.5e+120) {
tmp = t_2;
} else if (x1 <= -0.00125) {
tmp = t_7;
} else if (x1 <= 0.44) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_3 * (t_6 + (t_5 * ((2.0 * x2) - 3.0)))) + (t_0 * (2.0 * x2))))));
} else if (x1 <= 3.5e+50) {
tmp = t_7;
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3 t_5 = (x1 * 2.0) * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_7 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (3.0 + (-1.0 / x1))))))) tmp = 0 if x1 <= -3.5e+120: tmp = t_2 elif x1 <= -0.00125: tmp = t_7 elif x1 <= 0.44: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_3 * (t_6 + (t_5 * ((2.0 * x2) - 3.0)))) + (t_0 * (2.0 * x2)))))) elif x1 <= 3.5e+50: tmp = t_7 else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * 2.0) * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))))) tmp = 0.0 if (x1 <= -3.5e+120) tmp = t_2; elseif (x1 <= -0.00125) tmp = t_7; elseif (x1 <= 0.44) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * Float64(t_6 + Float64(t_5 * Float64(Float64(2.0 * x2) - 3.0)))) + Float64(t_0 * Float64(2.0 * x2))))))); elseif (x1 <= 3.5e+50) tmp = t_7; else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3; t_5 = (x1 * 2.0) * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_7 = x1 + (9.0 + (x1 + (t_1 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (3.0 + (-1.0 / x1))))))); tmp = 0.0; if (x1 <= -3.5e+120) tmp = t_2; elseif (x1 <= -0.00125) tmp = t_7; elseif (x1 <= 0.44) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_1 + ((t_3 * (t_6 + (t_5 * ((2.0 * x2) - 3.0)))) + (t_0 * (2.0 * x2)))))); elseif (x1 <= 3.5e+50) tmp = t_7; else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.5e+120], t$95$2, If[LessEqual[x1, -0.00125], t$95$7, If[LessEqual[x1, 0.44], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * N[(t$95$6 + N[(t$95$5 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.5e+50], t$95$7, t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \left(x1 \cdot 2\right) \cdot t\_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\\
t_7 := x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_3 \cdot \left(t\_5 \cdot \left(t\_4 - 3\right) + t\_6\right) + t\_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{+120}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -0.00125:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq 0.44:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(t\_1 + \left(t\_3 \cdot \left(t\_6 + t\_5 \cdot \left(2 \cdot x2 - 3\right)\right) + t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.5 \cdot 10^{+50}:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -3.50000000000000007e120 or 3.50000000000000006e50 < x1 Initial program 16.0%
Taylor expanded in x1 around inf 20.7%
*-commutative20.7%
Simplified20.7%
Taylor expanded in x1 around inf 100.0%
if -3.50000000000000007e120 < x1 < -0.00125000000000000003 or 0.440000000000000002 < x1 < 3.50000000000000006e50Initial program 96.7%
fma-define96.7%
*-un-lft-identity96.7%
associate--l-96.7%
associate-*r*96.7%
fma-neg96.7%
fma-define96.7%
pow296.7%
Applied egg-rr96.7%
*-lft-identity96.7%
Simplified96.7%
Taylor expanded in x1 around inf 95.8%
Taylor expanded in x1 around inf 95.6%
if -0.00125000000000000003 < x1 < 0.440000000000000002Initial program 97.5%
Taylor expanded in x1 around 0 95.7%
Taylor expanded in x1 around 0 95.6%
Final simplification97.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ x1 (* 9.0 (pow x1 2.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4 (* x1 (* x1 x1))))
(if (<= x1 -3.1e+130)
t_1
(if (<= x1 1.6e-10)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+
x1
(+
t_4
(+
(* t_0 t_3)
(*
t_2
(+
(* (- (* 2.0 x2) 3.0) (* (* x1 2.0) (* 2.0 x2)))
(* (* x1 x1) 6.0))))))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(+
x1
(+
t_4
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 (+ 3.0 (/ -1.0 x1))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 + (9.0 * pow(x1, 2.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.1e+130) {
tmp = t_1;
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_4 + ((t_0 * t_3) + (t_2 * ((((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} 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 + (9.0d0 * (x1 ** 2.0d0))
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 * (x1 * x1)
if (x1 <= (-3.1d+130)) then
tmp = t_1
else if (x1 <= 1.6d-10) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_4 + ((t_0 * t_3) + (t_2 * ((((2.0d0 * x2) - 3.0d0) * ((x1 * 2.0d0) * (2.0d0 * x2))) + ((x1 * x1) * 6.0d0)))))))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_4 + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))))
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 + (9.0 * Math.pow(x1, 2.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 * (x1 * x1);
double tmp;
if (x1 <= -3.1e+130) {
tmp = t_1;
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_4 + ((t_0 * t_3) + (t_2 * ((((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 + (9.0 * math.pow(x1, 2.0)) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 * (x1 * x1) tmp = 0 if x1 <= -3.1e+130: tmp = t_1 elif x1 <= 1.6e-10: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_4 + ((t_0 * t_3) + (t_2 * ((((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 + (t_4 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 + Float64(9.0 * (x1 ^ 2.0))) 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(x1 * x1)) tmp = 0.0 if (x1 <= -3.1e+130) tmp = t_1; elseif (x1 <= 1.6e-10) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_4 + Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(Float64(Float64(Float64(2.0 * x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) + Float64(Float64(x1 * x1) * 6.0)))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_4 + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 + (9.0 * (x1 ^ 2.0)); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -3.1e+130) tmp = t_1; elseif (x1 <= 1.6e-10) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_4 + ((t_0 * t_3) + (t_2 * ((((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 + (t_4 + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1))))))); 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[(9.0 * N[Power[x1, 2.0], $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[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.1e+130], t$95$1, If[LessEqual[x1, 1.6e-10], 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[(t$95$4 + N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$4 + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 + 9 \cdot {x1}^{2}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-10}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(t\_4 + \left(t\_0 \cdot t\_3 + t\_2 \cdot \left(\left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_4 + \left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -3.1e130 or 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.4%
Taylor expanded in x2 around 0 94.9%
Taylor expanded in x1 around inf 94.9%
if -3.1e130 < x1 < 1.5999999999999999e-10Initial program 97.8%
Taylor expanded in x1 around 0 94.8%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around 0 95.1%
if 1.5999999999999999e-10 < x1 < 5.00000000000000018e153Initial program 96.3%
fma-define96.3%
*-un-lft-identity96.3%
associate--l-96.3%
associate-*r*96.3%
fma-neg96.3%
fma-define96.3%
pow296.3%
Applied egg-rr96.3%
*-lft-identity96.3%
Simplified96.3%
Taylor expanded in x1 around inf 88.1%
Taylor expanded in x1 around inf 88.1%
Final simplification94.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 -3.5e+120) (not (<= x1 3.5e+50)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 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 <= -3.5e+120) || !(x1 <= 3.5e+50)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((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 <= (-3.5d+120)) .or. (.not. (x1 <= 3.5d+50))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((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 <= -3.5e+120) || !(x1 <= 3.5e+50)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((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 <= -3.5e+120) or not (x1 <= 3.5e+50): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((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 <= -3.5e+120) || !(x1 <= 3.5e+50)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 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 <= -3.5e+120) || ~((x1 <= 3.5e+50))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((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, -3.5e+120], N[Not[LessEqual[x1, 3.5e+50]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 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 -3.5 \cdot 10^{+120} \lor \neg \left(x1 \leq 3.5 \cdot 10^{+50}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\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(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.50000000000000007e120 or 3.50000000000000006e50 < x1 Initial program 16.0%
Taylor expanded in x1 around inf 20.7%
*-commutative20.7%
Simplified20.7%
Taylor expanded in x1 around inf 100.0%
if -3.50000000000000007e120 < x1 < 3.50000000000000006e50Initial program 97.3%
Taylor expanded in x1 around inf 94.2%
Final simplification96.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3)))
(if (<= x1 -5.7e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.6e-10)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(+
x1
(+
t_0
(+
(* t_1 t_4)
(*
t_3
(+ (* t_2 (* (* x1 2.0) (* 2.0 x2))) (* (* x1 x1) 6.0))))))))
(if (<= x1 1.35e+154)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_1 (+ 3.0 (/ -1.0 x1))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_2))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
if (x1 <= (-5.7d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.6d-10) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0d0) * (2.0d0 * x2))) + ((x1 * x1) * 6.0d0)))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (t_1 * (3.0d0 + ((-1.0d0) / x1)))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * 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 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_2))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (2.0 * x2) - 3.0 t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 tmp = 0 if x1 <= -5.7e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.6e-10: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))) elif x1 <= 1.35e+154: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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(Float64(2.0 * x2) - 3.0) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.6e-10) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(Float64(t_2 * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) + Float64(Float64(x1 * x1) * 6.0)))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * 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 = (2.0 * x2) - 3.0; t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.6e-10) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))); elseif (x1 <= 1.35e+154) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (3.0 + (-1.0 / x1))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e-10], 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[(t$95$0 + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(N[(t$95$2 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$2), $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 := 2 \cdot x2 - 3\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-10}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(t\_0 + \left(t\_1 \cdot t\_4 + t\_3 \cdot \left(t\_2 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t\_2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 5.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around 0 8.9%
fma-define8.9%
fma-neg8.9%
fma-neg8.9%
metadata-eval8.9%
metadata-eval8.9%
Simplified8.9%
Taylor expanded in x2 around 0 27.0%
if -5.6999999999999999e102 < x1 < 1.5999999999999999e-10Initial program 98.5%
Taylor expanded in x1 around 0 95.4%
Taylor expanded in x1 around inf 95.6%
Taylor expanded in x1 around 0 95.7%
if 1.5999999999999999e-10 < x1 < 1.35000000000000003e154Initial program 96.3%
fma-define96.3%
*-un-lft-identity96.3%
associate--l-96.3%
associate-*r*96.3%
fma-neg96.3%
fma-define96.3%
pow296.3%
Applied egg-rr96.3%
*-lft-identity96.3%
Simplified96.3%
Taylor expanded in x1 around inf 88.1%
Taylor expanded in x1 around inf 88.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.6%
Final simplification72.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3)))
(if (<= x1 -5.7e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.6e-10)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(+
x1
(+
t_0
(+
(* t_1 t_4)
(*
t_3
(+ (* t_2 (* (* x1 2.0) (* 2.0 x2))) (* (* x1 x1) 6.0))))))))
(if (<= x1 1.35e+154)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* 3.0 t_1))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_2))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
if (x1 <= (-5.7d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.6d-10) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0d0) * (2.0d0 * x2))) + ((x1 * x1) * 6.0d0)))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * 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 = (2.0 * x2) - 3.0;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.6e-10) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_2))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (2.0 * x2) - 3.0 t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 tmp = 0 if x1 <= -5.7e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.6e-10: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))) elif x1 <= 1.35e+154: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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(Float64(2.0 * x2) - 3.0) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.6e-10) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * t_4) + Float64(t_3 * Float64(Float64(t_2 * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2))) + Float64(Float64(x1 * x1) * 6.0)))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * 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 = (2.0 * x2) - 3.0; t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.6e-10) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + ((t_1 * t_4) + (t_3 * ((t_2 * ((x1 * 2.0) * (2.0 * x2))) + ((x1 * x1) * 6.0))))))); elseif (x1 <= 1.35e+154) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e-10], 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[(t$95$0 + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(N[(t$95$2 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$2), $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 := 2 \cdot x2 - 3\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-10}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(t\_0 + \left(t\_1 \cdot t\_4 + t\_3 \cdot \left(t\_2 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t\_2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 5.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around 0 8.9%
fma-define8.9%
fma-neg8.9%
fma-neg8.9%
metadata-eval8.9%
metadata-eval8.9%
Simplified8.9%
Taylor expanded in x2 around 0 27.0%
if -5.6999999999999999e102 < x1 < 1.5999999999999999e-10Initial program 98.5%
Taylor expanded in x1 around 0 95.4%
Taylor expanded in x1 around inf 95.6%
Taylor expanded in x1 around 0 95.7%
if 1.5999999999999999e-10 < x1 < 1.35000000000000003e154Initial program 96.3%
fma-define96.3%
*-un-lft-identity96.3%
associate--l-96.3%
associate-*r*96.3%
fma-neg96.3%
fma-define96.3%
pow296.3%
Applied egg-rr96.3%
*-lft-identity96.3%
Simplified96.3%
Taylor expanded in x1 around inf 88.1%
Taylor expanded in x1 around inf 87.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.6%
Final simplification71.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(* t_0 (+ (* x1 2.0) (* (* x1 x1) (- (* t_3 4.0) 6.0)))))))))))
(if (<= x1 -5.7e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -24000000.0)
t_4
(if (<= x1 15000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_1)))))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (+ 1.0 (* 4.0 t_1))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -24000000.0) {
tmp = t_4;
} else if (x1 <= 15000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0))))))))
if (x1 <= (-5.7d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-24000000.0d0)) then
tmp = t_4
else if (x1 <= 15000.0d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_1))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -24000000.0) {
tmp = t_4;
} else if (x1 <= 15000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))))))) tmp = 0 if x1 <= -5.7e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -24000000.0: tmp = t_4 elif x1 <= 15000.0: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))))))))) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -24000000.0) tmp = t_4; elseif (x1 <= 15000.0) 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(x1 * t_1))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))))))); tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -24000000.0) tmp = t_4; elseif (x1 <= 15000.0) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 + (4.0 * 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[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(9.0 + 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[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -24000000.0], t$95$4, If[LessEqual[x1, 15000.0], 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[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -24000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 15000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 5.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around 0 8.9%
fma-define8.9%
fma-neg8.9%
fma-neg8.9%
metadata-eval8.9%
metadata-eval8.9%
Simplified8.9%
Taylor expanded in x2 around 0 27.0%
if -5.6999999999999999e102 < x1 < -2.4e7 or 15000 < x1 < 1.35000000000000003e154Initial program 99.5%
fma-define99.5%
*-un-lft-identity99.5%
associate--l-99.5%
associate-*r*99.5%
fma-neg99.5%
fma-define99.5%
pow299.5%
Applied egg-rr99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in x1 around inf 99.5%
Taylor expanded in x1 around 0 87.6%
+-commutative87.6%
mul-1-neg87.6%
sub-neg87.6%
Simplified87.6%
Taylor expanded in x1 around inf 87.1%
*-commutative87.1%
Simplified87.1%
if -2.4e7 < x1 < 15000Initial program 97.5%
Taylor expanded in x1 around 0 86.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.6%
Final simplification67.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* 2.0 x2) 3.0)))
(if (<= x1 -5.7e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 7.5e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* (* x1 2.0) (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)) t_2)
(* (* x1 x1) 6.0))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_2)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 7.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * (((t_0 + (2.0 * x2)) - x1) / t_1)) * t_2) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * 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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (2.0d0 * x2) - 3.0d0
if (x1 <= (-5.7d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 7.5d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) * t_2) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * t_2))))
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 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 7.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * (((t_0 + (2.0 * x2)) - x1) / t_1)) * t_2) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_2))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (2.0 * x2) - 3.0 tmp = 0 if x1 <= -5.7e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 7.5e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * (((t_0 + (2.0 * x2)) - x1) / t_1)) * t_2) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_2)))) 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(2.0 * x2) - 3.0) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 7.5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) * t_2) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * t_2))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (2.0 * x2) - 3.0; tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 7.5e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * (((t_0 + (2.0 * x2)) - x1) / t_1)) * t_2) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_2)))); 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[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$2), $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 := 2 \cdot x2 - 3\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\right) \cdot t\_2 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t\_2\right)\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 5.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around 0 8.9%
fma-define8.9%
fma-neg8.9%
fma-neg8.9%
metadata-eval8.9%
metadata-eval8.9%
Simplified8.9%
Taylor expanded in x2 around 0 27.0%
if -5.6999999999999999e102 < x1 < 7.50000000000000065e153Initial program 98.1%
Taylor expanded in x1 around 0 92.1%
Taylor expanded in x1 around inf 91.5%
Taylor expanded in x1 around inf 91.4%
if 7.50000000000000065e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.6%
Final simplification70.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))
(t_3 (- (* 2.0 x2) 3.0))
(t_4
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(* t_0 (+ (* (* x1 x1) 6.0) (* t_3 (* (* x1 2.0) 3.0))))))))))
(t_5 (* x2 t_3)))
(if (<= x1 -5.7e+102)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -33000000.0)
t_4
(if (<= x1 14200.0)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 t_5)))))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (+ 1.0 (* 4.0 t_5))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = (2.0 * x2) - 3.0;
double t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + (t_3 * ((x1 * 2.0) * 3.0))))))));
double t_5 = x2 * t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -33000000.0) {
tmp = t_4;
} else if (x1 <= 14200.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_5))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_5)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)
t_3 = (2.0d0 * x2) - 3.0d0
t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * 6.0d0) + (t_3 * ((x1 * 2.0d0) * 3.0d0))))))))
t_5 = x2 * t_3
if (x1 <= (-5.7d+102)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-33000000.0d0)) then
tmp = t_4
else if (x1 <= 14200.0d0) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x1 * t_5))))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_5)))
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 * 3.0);
double t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0);
double t_3 = (2.0 * x2) - 3.0;
double t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + (t_3 * ((x1 * 2.0) * 3.0))))))));
double t_5 = x2 * t_3;
double tmp;
if (x1 <= -5.7e+102) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -33000000.0) {
tmp = t_4;
} else if (x1 <= 14200.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_5))));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_5)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0) t_3 = (2.0 * x2) - 3.0 t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + (t_3 * ((x1 * 2.0) * 3.0)))))))) t_5 = x2 * t_3 tmp = 0 if x1 <= -5.7e+102: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -33000000.0: tmp = t_4 elif x1 <= 14200.0: tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_5)))) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_5))) 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(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) t_3 = Float64(Float64(2.0 * x2) - 3.0) t_4 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(t_3 * Float64(Float64(x1 * 2.0) * 3.0))))))))) t_5 = Float64(x2 * t_3) tmp = 0.0 if (x1 <= -5.7e+102) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -33000000.0) tmp = t_4; elseif (x1 <= 14200.0) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * t_5))))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_5)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0); t_3 = (2.0 * x2) - 3.0; t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + (t_3 * ((x1 * 2.0) * 3.0)))))))); t_5 = x2 * t_3; tmp = 0.0; if (x1 <= -5.7e+102) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -33000000.0) tmp = t_4; elseif (x1 <= 14200.0) tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_5)))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 + (4.0 * t_5))); 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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * t$95$3), $MachinePrecision]}, If[LessEqual[x1, -5.7e+102], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -33000000.0], t$95$4, If[LessEqual[x1, 14200.0], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$5), $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 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := 2 \cdot x2 - 3\\
t_4 := x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_1 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + t\_3 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
t_5 := x2 \cdot t\_3\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -33000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 14200:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + 4 \cdot \left(x1 \cdot t\_5\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_5\right)\\
\end{array}
\end{array}
if x1 < -5.6999999999999999e102Initial program 5.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around 0 8.9%
fma-define8.9%
fma-neg8.9%
fma-neg8.9%
metadata-eval8.9%
metadata-eval8.9%
Simplified8.9%
Taylor expanded in x2 around 0 27.0%
if -5.6999999999999999e102 < x1 < -3.3e7 or 14200 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 84.7%
Taylor expanded in x1 around inf 84.7%
Taylor expanded in x1 around inf 80.1%
Taylor expanded in x1 around inf 80.1%
if -3.3e7 < x1 < 14200Initial program 97.5%
Taylor expanded in x1 around 0 86.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 40.6%
Final simplification65.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.95e+78)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (or (<= x1 -4.5e-150) (not (<= x1 6e-101)))
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.95e+78) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -4.5e-150) || !(x1 <= 6e-101)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.95d+78)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if ((x1 <= (-4.5d-150)) .or. (.not. (x1 <= 6d-101))) then
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.95e+78) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if ((x1 <= -4.5e-150) || !(x1 <= 6e-101)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.95e+78: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif (x1 <= -4.5e-150) or not (x1 <= 6e-101): tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.95e+78) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif ((x1 <= -4.5e-150) || !(x1 <= 6e-101)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.95e+78) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif ((x1 <= -4.5e-150) || ~((x1 <= 6e-101))) tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.95e+78], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -4.5e-150], N[Not[LessEqual[x1, 6e-101]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.95 \cdot 10^{+78}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -4.5 \cdot 10^{-150} \lor \neg \left(x1 \leq 6 \cdot 10^{-101}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -2.95e78Initial program 14.3%
Taylor expanded in x1 around 0 5.4%
Taylor expanded in x1 around 0 8.3%
fma-define8.3%
fma-neg8.3%
fma-neg8.3%
metadata-eval8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x2 around 0 25.0%
if -2.95e78 < x1 < -4.5000000000000002e-150 or 6.0000000000000006e-101 < x1 Initial program 69.5%
Taylor expanded in x1 around 0 41.9%
Taylor expanded in x1 around 0 51.8%
fma-define52.5%
fma-neg52.5%
fma-neg52.5%
metadata-eval52.5%
metadata-eval52.5%
Simplified52.5%
Taylor expanded in x1 around inf 45.5%
if -4.5000000000000002e-150 < x1 < 6.0000000000000006e-101Initial program 99.4%
Taylor expanded in x1 around 0 85.1%
Taylor expanded in x1 around 0 83.5%
Taylor expanded in x2 around 0 81.8%
Taylor expanded in x1 around 0 81.9%
neg-mul-181.9%
unsub-neg81.9%
Simplified81.9%
Final simplification48.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.3e+77)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(+ (* x2 -6.0) (* x1 -3.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.3e+77) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.3d+77)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + ((x2 * (-6.0d0)) + (x1 * (-3.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.3e+77) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.3e+77: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.3e+77) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(Float64(x2 * -6.0) + Float64(x1 * -3.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.3e+77) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + ((x2 * -6.0) + (x1 * -3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.3e+77], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.3 \cdot 10^{+77}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + \left(x2 \cdot -6 + x1 \cdot -3\right)\right)\\
\end{array}
\end{array}
if x1 < -2.29999999999999995e77Initial program 14.3%
Taylor expanded in x1 around 0 5.4%
Taylor expanded in x1 around 0 8.3%
fma-define8.3%
fma-neg8.3%
fma-neg8.3%
metadata-eval8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x2 around 0 25.0%
if -2.29999999999999995e77 < x1 Initial program 77.4%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 60.5%
Final simplification52.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.5e+39) (not (<= x2 2.05e+52))) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5e+39) || !(x2 <= 2.05e+52)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.5d+39)) .or. (.not. (x2 <= 2.05d+52))) then
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.5e+39) || !(x2 <= 2.05e+52)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.5e+39) or not (x2 <= 2.05e+52): tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.5e+39) || !(x2 <= 2.05e+52)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.5e+39) || ~((x2 <= 2.05e+52))) tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.5e+39], N[Not[LessEqual[x2, 2.05e+52]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.5 \cdot 10^{+39} \lor \neg \left(x2 \leq 2.05 \cdot 10^{+52}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x2 < -1.5e39 or 2.05e52 < x2 Initial program 61.6%
Taylor expanded in x1 around 0 45.1%
Taylor expanded in x1 around 0 59.0%
fma-define60.0%
fma-neg60.0%
fma-neg60.0%
metadata-eval60.0%
metadata-eval60.0%
Simplified60.0%
Taylor expanded in x1 around inf 52.2%
if -1.5e39 < x2 < 2.05e52Initial program 65.0%
Taylor expanded in x1 around 0 41.4%
Taylor expanded in x1 around 0 73.0%
Taylor expanded in x2 around 0 73.7%
Taylor expanded in x1 around 0 41.2%
neg-mul-141.2%
unsub-neg41.2%
Simplified41.2%
Final simplification45.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.2e+79) (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))) (+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.2e+79) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.2d+79)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.2e+79) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.2e+79: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) else: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.2e+79) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.2e+79) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); else tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.2e+79], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+79}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -1.19999999999999993e79Initial program 14.3%
Taylor expanded in x1 around 0 5.4%
Taylor expanded in x1 around 0 8.3%
fma-define8.3%
fma-neg8.3%
fma-neg8.3%
metadata-eval8.3%
metadata-eval8.3%
Simplified8.3%
Taylor expanded in x2 around 0 25.0%
if -1.19999999999999993e79 < x1 Initial program 77.4%
Taylor expanded in x1 around 0 53.3%
Taylor expanded in x1 around 0 60.2%
fma-define60.8%
fma-neg60.8%
fma-neg60.8%
metadata-eval60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in x1 around 0 60.3%
Final simplification52.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.26e-64) (not (<= x2 2.6e-101))) (+ x1 (* x2 -6.0)) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.26e-64) || !(x2 <= 2.6e-101)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.26d-64)) .or. (.not. (x2 <= 2.6d-101))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.26e-64) || !(x2 <= 2.6e-101)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.26e-64) or not (x2 <= 2.6e-101): tmp = x1 + (x2 * -6.0) else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.26e-64) || !(x2 <= 2.6e-101)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.26e-64) || ~((x2 <= 2.6e-101))) tmp = x1 + (x2 * -6.0); else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.26e-64], N[Not[LessEqual[x2, 2.6e-101]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.26 \cdot 10^{-64} \lor \neg \left(x2 \leq 2.6 \cdot 10^{-101}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -1.2599999999999999e-64 or 2.6000000000000001e-101 < x2 Initial program 60.5%
Taylor expanded in x1 around 0 43.3%
Taylor expanded in x1 around 0 23.2%
*-commutative23.2%
Simplified23.2%
if -1.2599999999999999e-64 < x2 < 2.6000000000000001e-101Initial program 68.7%
Taylor expanded in x1 around 0 42.1%
Taylor expanded in x1 around 0 42.4%
fma-define42.4%
fma-neg42.4%
fma-neg42.4%
metadata-eval42.4%
metadata-eval42.4%
Simplified42.4%
Taylor expanded in x2 around 0 31.1%
distribute-rgt1-in31.1%
metadata-eval31.1%
neg-mul-131.1%
Simplified31.1%
Final simplification26.2%
(FPCore (x1 x2) :precision binary64 (if (<= x1 0.62) (- x1) x1))
double code(double x1, double x2) {
double tmp;
if (x1 <= 0.62) {
tmp = -x1;
} else {
tmp = x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 0.62d0) then
tmp = -x1
else
tmp = x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 0.62) {
tmp = -x1;
} else {
tmp = x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 0.62: tmp = -x1 else: tmp = x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 0.62) tmp = Float64(-x1); else tmp = x1; end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 0.62) tmp = -x1; else tmp = x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 0.62], (-x1), x1]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 0.62:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1\\
\end{array}
\end{array}
if x1 < 0.619999999999999996Initial program 72.6%
Taylor expanded in x1 around 0 56.0%
Taylor expanded in x1 around 0 56.4%
fma-define57.0%
fma-neg57.0%
fma-neg57.0%
metadata-eval57.0%
metadata-eval57.0%
Simplified57.0%
Taylor expanded in x2 around 0 18.5%
distribute-rgt1-in18.5%
metadata-eval18.5%
neg-mul-118.5%
Simplified18.5%
if 0.619999999999999996 < x1 Initial program 39.8%
Taylor expanded in x1 around 0 7.9%
Taylor expanded in x1 around 0 6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in x1 around inf 6.2%
Final simplification15.2%
(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 63.6%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around 0 65.4%
Taylor expanded in x2 around 0 63.3%
Taylor expanded in x1 around 0 30.5%
neg-mul-130.5%
unsub-neg30.5%
Simplified30.5%
Final simplification30.5%
(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 63.6%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around 0 19.0%
*-commutative19.0%
Simplified19.0%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2024053
(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))))))