
(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 19 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.5%
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 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(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 (* (* x1 2.0) t_3))
(t_5 (* t_1 t_3))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+ (+ x1 (+ (+ (* t_2 (+ (* t_4 (- t_3 3.0)) t_6)) t_5) t_0)) t_7))
INFINITY)
(+
x1
(+
t_7
(+
x1
(+
t_0
(+
t_5
(*
t_2
(+
t_6
(*
t_4
(-
(-
(/ (fma 3.0 (pow x1 2.0) (* 2.0 x2)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0)))
3.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 = (x1 * 2.0) * t_3;
double t_5 = t_1 * t_3;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((t_4 * (t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= ((double) INFINITY)) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_5 + (t_2 * (t_6 + (t_4 * (((fma(3.0, pow(x1, 2.0), (2.0 * x2)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0))) - 3.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(x1 * 2.0) * t_3) t_5 = Float64(t_1 * t_3) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(t_4 * Float64(t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= Inf) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_2 * Float64(t_6 + Float64(t_4 * Float64(Float64(Float64(fma(3.0, (x1 ^ 2.0), Float64(2.0 * x2)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0))) - 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[(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[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$4 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$2 * N[(t$95$6 + N[(t$95$4 * N[(N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := t_1 \cdot t_3\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
t_7 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_4 \cdot \left(t_3 - 3\right) + t_6\right) + t_5\right) + t_0\right)\right) + t_7\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_7 + \left(x1 + \left(t_0 + \left(t_5 + t_2 \cdot \left(t_6 + t_4 \cdot \left(\left(\frac{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 3\right)\right)\right)\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.5%
div-sub99.5%
*-commutative99.5%
fma-def99.5%
*-commutative99.5%
fma-udef99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.5%
fma-def99.5%
pow299.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
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 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(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) (* x2 -2.0)) (fma x1 x1 1.0))
(/ 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), (x2 * -2.0)) / fma(x1, x1, 1.0)) - (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(Float64(fma(3.0, (x1 ^ 2.0), Float64(x2 * -2.0)) / fma(x1, x1, 1.0)) - Float64(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[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / 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 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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\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.5%
div-sub99.5%
cancel-sign-sub-inv99.5%
associate-*r*99.5%
fma-def99.5%
pow299.5%
metadata-eval99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
*-commutative99.5%
Simplified99.5%
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 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(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.5%
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 6.8%
*-commutative6.8%
Simplified6.8%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(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 -1e+102) (not (<= x1 5e+93)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(+
(+
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))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1e+102) || !(x1 <= 5e+93)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
}
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 <= (-1d+102)) .or. (.not. (x1 <= 5d+93))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((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)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
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 <= -1e+102) || !(x1 <= 5e+93)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1e+102) or not (x1 <= 5e+93): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1e+102) || !(x1 <= 5e+93)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(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)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1e+102) || ~((x1 <= 5e+93))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1e+102], N[Not[LessEqual[x1, 5e+93]], $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[(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] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+102} \lor \neg \left(x1 \leq 5 \cdot 10^{+93}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -9.99999999999999977e101 or 5.0000000000000001e93 < x1 Initial program 12.0%
Taylor expanded in x1 around inf 18.1%
*-commutative18.1%
Simplified18.1%
Taylor expanded in x1 around inf 100.0%
if -9.99999999999999977e101 < x1 < 5.0000000000000001e93Initial program 99.4%
Taylor expanded in x1 around inf 97.1%
Taylor expanded in x1 around 0 98.7%
mul-1-neg98.7%
unsub-neg98.7%
*-commutative98.7%
Simplified98.7%
Final simplification99.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 1.8e+146)
(+
x1
(+
(+
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))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* (* x1 8.0) (pow x2 2.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 * 8.0) * pow(x2, 2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: 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 <= 1.8d+146) then
tmp = x1 + ((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)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + ((x1 * 8.0d0) * (x2 ** 2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 * 8.0) * Math.pow(x2, 2.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 <= 1.8e+146: tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + ((x1 * 8.0) * math.pow(x2, 2.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= 1.8e+146) tmp = Float64(x1 + Float64(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)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(Float64(x1 * 8.0) * (x2 ^ 2.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 <= 1.8e+146) tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + ((x1 * 8.0) * (x2 ^ 2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, 1.8e+146], N[(x1 + N[(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] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * 8.0), $MachinePrecision] * N[Power[x2, 2.0], $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 1.8 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot 8\right) \cdot {x2}^{2}\\
\end{array}
\end{array}
if x1 < 1.7999999999999999e146Initial program 81.8%
Taylor expanded in x1 around inf 80.0%
Taylor expanded in x1 around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
*-commutative81.3%
Simplified81.3%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x2 around inf 51.4%
associate-*r*53.7%
Simplified53.7%
Final simplification77.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 t_1))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 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 (- (* 2.0 x2) 3.0)))
(if (<= x1 0.0046)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+ x1 (+ t_0 (+ t_2 (* t_3 (+ t_6 (* t_5 t_7))))))))
(if (<= x1 1.8e+146)
(+
x1
(+
(+ x1 (+ t_0 (+ (* t_3 (+ (* t_5 (- t_4 3.0)) t_6)) t_2)))
(* 3.0 (* x2 -2.0))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_7)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= 0.0046) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_0 + (t_2 + (t_3 * (t_6 + (t_5 * t_7)))))));
} else if (x1 <= 1.8e+146) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + t_2))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_7))));
}
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 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * t_1
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (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 = (2.0d0 * x2) - 3.0d0
if (x1 <= 0.0046d0) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (t_0 + (t_2 + (t_3 * (t_6 + (t_5 * t_7)))))))
else if (x1 <= 1.8d+146) then
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((t_5 * (t_4 - 3.0d0)) + t_6)) + t_2))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * t_7))))
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 = 3.0 * t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= 0.0046) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_0 + (t_2 + (t_3 * (t_6 + (t_5 * t_7)))))));
} else if (x1 <= 1.8e+146) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + t_2))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_7))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * t_1 t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (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 = (2.0 * x2) - 3.0 tmp = 0 if x1 <= 0.0046: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_0 + (t_2 + (t_3 * (t_6 + (t_5 * t_7))))))) elif x1 <= 1.8e+146: tmp = x1 + ((x1 + (t_0 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + t_2))) + (3.0 * (x2 * -2.0))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_7)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * t_1) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * 2.0) * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(Float64(2.0 * x2) - 3.0) tmp = 0.0 if (x1 <= 0.0046) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(t_0 + Float64(t_2 + Float64(t_3 * Float64(t_6 + Float64(t_5 * t_7)))))))); elseif (x1 <= 1.8e+146) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + t_2))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * t_7))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * t_1; t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (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 = (2.0 * x2) - 3.0; tmp = 0.0; if (x1 <= 0.0046) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_0 + (t_2 + (t_3 * (t_6 + (t_5 * t_7))))))); elseif (x1 <= 1.8e+146) tmp = x1 + ((x1 + (t_0 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + t_2))) + (3.0 * (x2 * -2.0))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_7)))); 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[(3.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 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[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, If[LessEqual[x1, 0.0046], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$2 + N[(t$95$3 * N[(t$95$6 + N[(t$95$5 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+146], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$7), $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 := 3 \cdot t_1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 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 := 2 \cdot x2 - 3\\
\mathbf{if}\;x1 \leq 0.0046:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(t_0 + \left(t_2 + t_3 \cdot \left(t_6 + t_5 \cdot t_7\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_3 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t_7\right)\right)\\
\end{array}
\end{array}
if x1 < 0.0045999999999999999Initial program 78.8%
Taylor expanded in x1 around inf 77.0%
Taylor expanded in x1 around 0 78.4%
mul-1-neg78.4%
unsub-neg78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in x1 around 0 76.8%
if 0.0045999999999999999 < x1 < 1.7999999999999999e146Initial program 99.3%
Taylor expanded in x1 around 0 97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in x1 around inf 96.7%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 51.4%
Final simplification75.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)))
(if (<= x1 1.8e+146)
(+
x1
(+
(+
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))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= 1.8d+146) then
tmp = x1 + ((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)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= 1.8e+146: tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= 1.8e+146) tmp = Float64(x1 + Float64(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)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= 1.8e+146) tmp = x1 + ((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)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, 1.8e+146], N[(x1 + N[(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] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(\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) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 1.7999999999999999e146Initial program 81.8%
Taylor expanded in x1 around inf 80.0%
Taylor expanded in x1 around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
*-commutative81.3%
Simplified81.3%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 51.4%
Final simplification77.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x1 t_0))))))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_2
(+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -0.156)
t_5
(if (<= x1 -5.2e-191)
t_3
(if (<= x1 4.8e-197)
t_5
(if (<= x1 3.6e-6)
t_3
(if (<= x1 1.8e+146) t_5 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0)))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_0))));
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -0.156) {
tmp = t_5;
} else if (x1 <= -5.2e-191) {
tmp = t_3;
} else if (x1 <= 4.8e-197) {
tmp = t_5;
} else if (x1 <= 3.6e-6) {
tmp = t_3;
} else if (x1 <= 1.8e+146) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x1 * t_0))))
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_5 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-0.156d0)) then
tmp = t_5
else if (x1 <= (-5.2d-191)) then
tmp = t_3
else if (x1 <= 4.8d-197) then
tmp = t_5
else if (x1 <= 3.6d-6) then
tmp = t_3
else if (x1 <= 1.8d+146) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_0))));
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -0.156) {
tmp = t_5;
} else if (x1 <= -5.2e-191) {
tmp = t_3;
} else if (x1 <= 4.8e-197) {
tmp = t_5;
} else if (x1 <= 3.6e-6) {
tmp = t_3;
} else if (x1 <= 1.8e+146) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_0)))) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -0.156: tmp = t_5 elif x1 <= -5.2e-191: tmp = t_3 elif x1 <= 4.8e-197: tmp = t_5 elif x1 <= 3.6e-6: tmp = t_3 elif x1 <= 1.8e+146: tmp = t_5 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -0.156) tmp = t_5; elseif (x1 <= -5.2e-191) tmp = t_3; elseif (x1 <= 4.8e-197) tmp = t_5; elseif (x1 <= 3.6e-6) tmp = t_3; elseif (x1 <= 1.8e+146) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_0)))); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -0.156) tmp = t_5; elseif (x1 <= -5.2e-191) tmp = t_3; elseif (x1 <= 4.8e-197) tmp = t_5; elseif (x1 <= 3.6e-6) tmp = t_3; elseif (x1 <= 1.8e+146) tmp = t_5; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -0.156], t$95$5, If[LessEqual[x1, -5.2e-191], t$95$3, If[LessEqual[x1, 4.8e-197], t$95$5, If[LessEqual[x1, 3.6e-6], t$95$3, If[LessEqual[x1, 1.8e+146], t$95$5, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_5 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -0.156:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-191}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{-197}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -0.156 or -5.19999999999999972e-191 < x1 < 4.8000000000000002e-197 or 3.59999999999999984e-6 < x1 < 1.7999999999999999e146Initial program 72.0%
Taylor expanded in x1 around 0 68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in x1 around inf 68.7%
Taylor expanded in x1 around inf 64.8%
if -0.156 < x1 < -5.19999999999999972e-191 or 4.8000000000000002e-197 < x1 < 3.59999999999999984e-6Initial program 99.5%
Taylor expanded in x1 around 0 89.3%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 51.4%
Final simplification70.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 1.8e+146)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= 1.8d+146) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= 1.8e+146) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= 1.8e+146: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= 1.8e+146) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= 1.8e+146) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, 1.8e+146], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \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 t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 1.7999999999999999e146Initial program 81.8%
Taylor expanded in x1 around inf 80.0%
Taylor expanded in x1 around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x1 around inf 77.4%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 51.4%
Final simplification73.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (+ x1 (+ t_3 (+ x1 (* 4.0 (* x1 t_0))))))
(t_5
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_2
(+
(* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_2) 4.0) 6.0))
-6.0)))))))))
(if (<= x1 -162.0)
t_5
(if (<= x1 -5.6e-212)
t_4
(if (<= x1 6.4e-208)
(+ x1 (+ t_3 (+ x1 (* 4.0 (* x2 (* x1 -3.0))))))
(if (<= x1 480000000.0)
t_4
(if (<= x1 1.8e+146) t_5 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0)))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0))));
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -162.0) {
tmp = t_5;
} else if (x1 <= -5.6e-212) {
tmp = t_4;
} else if (x1 <= 6.4e-208) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 480000000.0) {
tmp = t_4;
} else if (x1 <= 1.8e+146) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = x1 + (t_3 + (x1 + (4.0d0 * (x1 * t_0))))
t_5 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_2) * 4.0d0) - 6.0d0)) + (-6.0d0)))))))
if (x1 <= (-162.0d0)) then
tmp = t_5
else if (x1 <= (-5.6d-212)) then
tmp = t_4
else if (x1 <= 6.4d-208) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
else if (x1 <= 480000000.0d0) then
tmp = t_4
else if (x1 <= 1.8d+146) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0))));
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -162.0) {
tmp = t_5;
} else if (x1 <= -5.6e-212) {
tmp = t_4;
} else if (x1 <= 6.4e-208) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
} else if (x1 <= 480000000.0) {
tmp = t_4;
} else if (x1 <= 1.8e+146) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0)))) t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + -6.0)))))) tmp = 0 if x1 <= -162.0: tmp = t_5 elif x1 <= -5.6e-212: tmp = t_4 elif x1 <= 6.4e-208: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0))))) elif x1 <= 480000000.0: tmp = t_4 elif x1 <= 1.8e+146: tmp = t_5 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))) t_5 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + -6.0))))))) tmp = 0.0 if (x1 <= -162.0) tmp = t_5; elseif (x1 <= -5.6e-212) tmp = t_4; elseif (x1 <= 6.4e-208) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); elseif (x1 <= 480000000.0) tmp = t_4; elseif (x1 <= 1.8e+146) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * t_0)))); t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + -6.0)))))); tmp = 0.0; if (x1 <= -162.0) tmp = t_5; elseif (x1 <= -5.6e-212) tmp = t_4; elseif (x1 <= 6.4e-208) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * (x1 * -3.0))))); elseif (x1 <= 480000000.0) tmp = t_4; elseif (x1 <= 1.8e+146) tmp = t_5; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -162.0], t$95$5, If[LessEqual[x1, -5.6e-212], t$95$4, If[LessEqual[x1, 6.4e-208], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 480000000.0], t$95$4, If[LessEqual[x1, 1.8e+146], t$95$5, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\
t_5 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2} \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -162:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-212}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-208}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 480000000:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+146}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -162 or 4.8e8 < x1 < 1.7999999999999999e146Initial program 49.6%
Taylor expanded in x1 around 0 49.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in x1 around inf 49.6%
Taylor expanded in x1 around inf 43.6%
Taylor expanded in x1 around inf 43.6%
if -162 < x1 < -5.60000000000000027e-212 or 6.4000000000000003e-208 < x1 < 4.8e8Initial program 99.4%
Taylor expanded in x1 around 0 84.4%
if -5.60000000000000027e-212 < x1 < 6.4000000000000003e-208Initial program 99.7%
Taylor expanded in x1 around 0 77.3%
Taylor expanded in x2 around 0 91.7%
associate-*r*91.7%
*-commutative91.7%
Simplified91.7%
if 1.7999999999999999e146 < x1 Initial program 5.6%
Taylor expanded in x1 around 0 5.6%
Taylor expanded in x1 around inf 51.4%
Final simplification68.7%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -1.05e-211) (not (<= x1 4.5e-207)))
(+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 -3.0))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.05e-211) || !(x1 <= 4.5e-207)) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (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 <= (-1.05d-211)) .or. (.not. (x1 <= 4.5d-207))) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.05e-211) || !(x1 <= 4.5e-207)) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * -3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.05e-211) or not (x1 <= 4.5e-207): tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * -3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.05e-211) || !(x1 <= 4.5e-207)) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.05e-211) || ~((x1 <= 4.5e-207))) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * -3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.05e-211], N[Not[LessEqual[x1, 4.5e-207]], $MachinePrecision]], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{-211} \lor \neg \left(x1 \leq 4.5 \cdot 10^{-207}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.05000000000000004e-211 or 4.49999999999999992e-207 < x1 Initial program 64.7%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around 0 50.3%
if -1.05000000000000004e-211 < x1 < 4.49999999999999992e-207Initial program 99.7%
Taylor expanded in x1 around 0 77.3%
Taylor expanded in x2 around 0 91.7%
associate-*r*91.7%
*-commutative91.7%
Simplified91.7%
Final simplification57.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9.5e-233) (not (<= x1 2.35e-272))) (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.5e-233) || !(x1 <= 2.35e-272)) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-9.5d-233)) .or. (.not. (x1 <= 2.35d-272))) then
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.5e-233) || !(x1 <= 2.35e-272)) {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9.5e-233) or not (x1 <= 2.35e-272): tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9.5e-233) || !(x1 <= 2.35e-272)) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -9.5e-233) || ~((x1 <= 2.35e-272))) tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9.5e-233], N[Not[LessEqual[x1, 2.35e-272]], $MachinePrecision]], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{-233} \lor \neg \left(x1 \leq 2.35 \cdot 10^{-272}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -9.5000000000000003e-233 or 2.3499999999999999e-272 < x1 Initial program 68.7%
Taylor expanded in x1 around 0 47.4%
Taylor expanded in x1 around 0 54.0%
if -9.5000000000000003e-233 < x1 < 2.3499999999999999e-272Initial program 99.8%
Taylor expanded in x1 around 0 70.5%
Taylor expanded in x1 around 0 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x1 around 0 99.8%
*-commutative99.8%
Simplified99.8%
Final simplification57.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.05e-128) (not (<= x1 6.4e-104))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.05e-128) || !(x1 <= 6.4e-104)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.05d-128)) .or. (.not. (x1 <= 6.4d-104))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.05e-128) || !(x1 <= 6.4e-104)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.05e-128) or not (x1 <= 6.4e-104): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.05e-128) || !(x1 <= 6.4e-104)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.05e-128) || ~((x1 <= 6.4e-104))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.05e-128], N[Not[LessEqual[x1, 6.4e-104]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{-128} \lor \neg \left(x1 \leq 6.4 \cdot 10^{-104}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.05e-128 or 6.39999999999999978e-104 < x1 Initial program 55.6%
Taylor expanded in x1 around 0 31.6%
Taylor expanded in x1 around inf 25.5%
if -2.05e-128 < x1 < 6.39999999999999978e-104Initial program 99.7%
Taylor expanded in x1 around 0 81.8%
Taylor expanded in x1 around 0 71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in x1 around 0 71.5%
*-commutative71.5%
Simplified71.5%
Final simplification41.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -1.4e-128)
(+ x1 (+ 9.0 (+ x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 1.5e-105) (* x2 -6.0) (+ x1 (* x1 (+ 1.0 (* 4.0 t_0))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -1.4e-128) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 1.5e-105) {
tmp = x2 * -6.0;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-1.4d-128)) then
tmp = x1 + (9.0d0 + (x1 + (4.0d0 * (x1 * t_0))))
else if (x1 <= 1.5d-105) then
tmp = x2 * (-6.0d0)
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -1.4e-128) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 1.5e-105) {
tmp = x2 * -6.0;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -1.4e-128: tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0)))) elif x1 <= 1.5e-105: tmp = x2 * -6.0 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -1.4e-128) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 1.5e-105) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -1.4e-128) tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0)))); elseif (x1 <= 1.5e-105) tmp = x2 * -6.0; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.4e-128], N[(x1 + N[(9.0 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-105], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{-128}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-105}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -1.3999999999999999e-128Initial program 49.6%
Taylor expanded in x1 around 0 35.3%
Taylor expanded in x1 around inf 17.5%
if -1.3999999999999999e-128 < x1 < 1.5e-105Initial program 99.7%
Taylor expanded in x1 around 0 81.8%
Taylor expanded in x1 around 0 71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in x1 around 0 71.5%
*-commutative71.5%
Simplified71.5%
if 1.5e-105 < x1 Initial program 61.0%
Taylor expanded in x1 around 0 28.3%
Taylor expanded in x1 around inf 33.3%
Final simplification41.9%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
return x1 + (x1 + (x2 * -6.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x1 + (x2 * (-6.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + (x1 + (x2 * -6.0));
}
def code(x1, x2): return x1 + (x1 + (x2 * -6.0))
function code(x1, x2) return Float64(x1 + Float64(x1 + Float64(x2 * -6.0))) end
function tmp = code(x1, x2) tmp = x1 + (x1 + (x2 * -6.0)); end
code[x1_, x2_] := N[(x1 + N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x1 + x2 \cdot -6\right)
\end{array}
Initial program 71.1%
Taylor expanded in x1 around 0 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in x2 around inf 40.3%
associate-*r/40.3%
associate-/l*40.3%
+-commutative40.3%
unpow240.3%
fma-udef40.3%
Simplified40.3%
Taylor expanded in x1 around inf 30.1%
*-commutative30.1%
Simplified30.1%
Final simplification30.1%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 71.1%
Taylor expanded in x1 around 0 49.2%
Taylor expanded in x1 around 0 30.1%
*-commutative30.1%
Simplified30.1%
Final simplification30.1%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 71.1%
Taylor expanded in x1 around 0 49.2%
Taylor expanded in x1 around 0 30.1%
*-commutative30.1%
Simplified30.1%
Taylor expanded in x1 around 0 29.7%
*-commutative29.7%
Simplified29.7%
Final simplification29.7%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 71.1%
Taylor expanded in x1 around 0 49.2%
Taylor expanded in x1 around 0 30.1%
*-commutative30.1%
Simplified30.1%
Taylor expanded in x1 around inf 3.5%
Final simplification3.5%
herbie shell --seed 2023332
(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))))))