
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_0\right)\right) \cdot \left(t_0 + -3\right)\right), \mathsf{fma}\left(t_4, t_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ 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
(-
(+
(/ (* 2.0 x2) (fma x1 x1 1.0))
(/ (- (* 3.0 (pow x1 2.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 * ((((2.0 * x2) / fma(x1, x1, 1.0)) + (((3.0 * pow(x1, 2.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(Float64(2.0 * x2) / fma(x1, x1, 1.0)) + Float64(Float64(Float64(3.0 * (x1 ^ 2.0)) - 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[(2.0 * x2), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / 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{2 \cdot x2}{\mathsf{fma}\left(x1, x1, 1\right)} + \frac{3 \cdot {x1}^{2} - 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.4%
Taylor expanded in x2 around 0 99.4%
associate--l+99.4%
associate-*r/99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
associate-*r/99.4%
div-sub99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(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.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.6%
*-commutative98.6%
Simplified98.6%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_5 (* t_2 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7 (* (* x1 2.0) t_4)))
(if (<= x1 -1e+101)
t_1
(if (<= x1 0.0115)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))
(+ x1 (+ t_0 (+ t_5 (* t_3 (+ t_6 (* t_7 (- (* 2.0 x2) 3.0)))))))))
(if (<= x1 1.12e+75)
(+
x1
(+
(+ x1 (+ (+ (* t_3 (+ (* t_7 (- t_4 3.0)) t_6)) t_5) t_0))
(* 3.0 (+ 3.0 (/ -1.0 x1)))))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -1e+101) {
tmp = t_1;
} else if (x1 <= 0.0115) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + (3.0 * (3.0 + (-1.0 / x1))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_5 = t_2 * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_7 = (x1 * 2.0d0) * t_4
if (x1 <= (-1d+101)) then
tmp = t_1
else if (x1 <= 0.0115d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0d0 * x2) - 3.0d0))))))))
else if (x1 <= 1.12d+75) then
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0d0)) + t_6)) + t_5) + t_0)) + (3.0d0 * (3.0d0 + ((-1.0d0) / x1))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -1e+101) {
tmp = t_1;
} else if (x1 <= 0.0115) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + (3.0 * (3.0 + (-1.0 / x1))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_5 = t_2 * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_7 = (x1 * 2.0) * t_4 tmp = 0 if x1 <= -1e+101: tmp = t_1 elif x1 <= 0.0115: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))) elif x1 <= 1.12e+75: tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + (3.0 * (3.0 + (-1.0 / x1)))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(t_2 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(Float64(x1 * 2.0) * t_4) tmp = 0.0 if (x1 <= -1e+101) tmp = t_1; elseif (x1 <= 0.0115) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_3 * Float64(t_6 + Float64(t_7 * Float64(Float64(2.0 * x2) - 3.0))))))))); elseif (x1 <= 1.12e+75) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(t_7 * Float64(t_4 - 3.0)) + t_6)) + t_5) + t_0)) + Float64(3.0 * Float64(3.0 + Float64(-1.0 / x1))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_5 = t_2 * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_7 = (x1 * 2.0) * t_4; tmp = 0.0; if (x1 <= -1e+101) tmp = t_1; elseif (x1 <= 0.0115) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))); elseif (x1 <= 1.12e+75) tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + (3.0 * (3.0 + (-1.0 / x1)))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * 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[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -1e+101], t$95$1, If[LessEqual[x1, 0.0115], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$3 * N[(t$95$6 + N[(t$95$7 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e+75], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(t$95$7 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_2 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_7 := \left(x1 \cdot 2\right) \cdot t_4\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 0.0115:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_0 + \left(t_5 + t_3 \cdot \left(t_6 + t_7 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+75}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(t_7 \cdot \left(t_4 - 3\right) + t_6\right) + t_5\right) + t_0\right)\right) + 3 \cdot \left(3 + \frac{-1}{x1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -9.9999999999999998e100 or 1.12000000000000001e75 < x1 Initial program 15.1%
Taylor expanded in x1 around inf 15.1%
Taylor expanded in x1 around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -9.9999999999999998e100 < x1 < 0.0115Initial program 99.3%
Taylor expanded in x1 around 0 96.7%
if 0.0115 < x1 < 1.12000000000000001e75Initial program 99.3%
Taylor expanded in x1 around inf 96.8%
Final simplification97.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_5 (* t_2 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_7 (* (* x1 2.0) t_4)))
(if (<= x1 -5e+102)
t_1
(if (<= x1 0.0125)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))
(+ x1 (+ t_0 (+ t_5 (* t_3 (+ t_6 (* t_7 (- (* 2.0 x2) 3.0)))))))))
(if (<= x1 1.12e+75)
(+
x1
(+ (+ x1 (+ (+ (* t_3 (+ (* t_7 (- t_4 3.0)) t_6)) t_5) t_0)) 9.0))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -5e+102) {
tmp = t_1;
} else if (x1 <= 0.0125) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: 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 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_5 = t_2 * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_7 = (x1 * 2.0d0) * t_4
if (x1 <= (-5d+102)) then
tmp = t_1
else if (x1 <= 0.0125d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0d0 * x2) - 3.0d0))))))))
else if (x1 <= 1.12d+75) then
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0d0)) + t_6)) + t_5) + t_0)) + 9.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_7 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -5e+102) {
tmp = t_1;
} else if (x1 <= 0.0125) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_5 = t_2 * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_7 = (x1 * 2.0) * t_4 tmp = 0 if x1 <= -5e+102: tmp = t_1 elif x1 <= 0.0125: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))) elif x1 <= 1.12e+75: tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(t_2 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_7 = Float64(Float64(x1 * 2.0) * t_4) tmp = 0.0 if (x1 <= -5e+102) tmp = t_1; elseif (x1 <= 0.0125) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_3 * Float64(t_6 + Float64(t_7 * Float64(Float64(2.0 * x2) - 3.0))))))))); elseif (x1 <= 1.12e+75) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(t_7 * Float64(t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_5 = t_2 * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_7 = (x1 * 2.0) * t_4; tmp = 0.0; if (x1 <= -5e+102) tmp = t_1; elseif (x1 <= 0.0125) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (t_7 * ((2.0 * x2) - 3.0)))))))); elseif (x1 <= 1.12e+75) tmp = x1 + ((x1 + (((t_3 * ((t_7 * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0); else tmp = t_1; 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[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * 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[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -5e+102], t$95$1, If[LessEqual[x1, 0.0125], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$3 * N[(t$95$6 + N[(t$95$7 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e+75], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(t$95$7 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_2 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
t_7 := \left(x1 \cdot 2\right) \cdot t_4\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 0.0125:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_0 + \left(t_5 + t_3 \cdot \left(t_6 + t_7 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+75}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(t_7 \cdot \left(t_4 - 3\right) + t_6\right) + t_5\right) + t_0\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -5e102 or 1.12000000000000001e75 < x1 Initial program 15.1%
Taylor expanded in x1 around inf 15.1%
Taylor expanded in x1 around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -5e102 < x1 < 0.012500000000000001Initial program 99.3%
Taylor expanded in x1 around 0 96.7%
if 0.012500000000000001 < x1 < 1.12000000000000001e75Initial program 99.3%
Taylor expanded in x1 around inf 96.4%
Final simplification97.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_5 (* t_2 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(if (<= x1 -3.6e+99)
t_1
(if (<= x1 0.0036)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))
(+
x1
(+
t_0
(+
t_5
(*
t_3
(+
t_6
(* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0)))))))))
(if (<= x1 1.12e+75)
(+
x1
(+
(+
x1
(+ (+ (* t_3 (+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) t_6)) t_5) t_0))
9.0))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -3.6e+99) {
tmp = t_1;
} else if (x1 <= 0.0036) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_5 = t_2 * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
if (x1 <= (-3.6d+99)) then
tmp = t_1
else if (x1 <= 0.0036d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
else if (x1 <= 1.12d+75) then
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + t_6)) + t_5) + t_0)) + 9.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -3.6e+99) {
tmp = t_1;
} else if (x1 <= 0.0036) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else if (x1 <= 1.12e+75) {
tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_5 = t_2 * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) tmp = 0 if x1 <= -3.6e+99: tmp = t_1 elif x1 <= 0.0036: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))) elif x1 <= 1.12e+75: tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(t_2 * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -3.6e+99) tmp = t_1; elseif (x1 <= 0.0036) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_3 * Float64(t_6 + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0))))))))); elseif (x1 <= 1.12e+75) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_5 = t_2 * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -3.6e+99) tmp = t_1; elseif (x1 <= 0.0036) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_0 + (t_5 + (t_3 * (t_6 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))); elseif (x1 <= 1.12e+75) tmp = x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + t_6)) + t_5) + t_0)) + 9.0); else tmp = t_1; 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[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * 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]}, If[LessEqual[x1, -3.6e+99], t$95$1, If[LessEqual[x1, 0.0036], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$3 * N[(t$95$6 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e+75], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := t_2 \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 0.0036:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + \left(t_0 + \left(t_5 + t_3 \cdot \left(t_6 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{+75}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + t_6\right) + t_5\right) + t_0\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x1 < -3.6000000000000002e99 or 1.12000000000000001e75 < x1 Initial program 15.1%
Taylor expanded in x1 around inf 15.1%
Taylor expanded in x1 around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -3.6000000000000002e99 < x1 < 0.0035999999999999999Initial program 99.3%
Taylor expanded in x1 around 0 90.0%
+-commutative90.0%
mul-1-neg90.0%
sub-neg90.0%
Simplified90.0%
Taylor expanded in x1 around 0 96.1%
if 0.0035999999999999999 < x1 < 1.12000000000000001e75Initial program 99.3%
Taylor expanded in x1 around inf 96.4%
Final simplification97.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* t_1 t_3))
(t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 0.012)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
t_0
(+
t_4
(*
t_2
(+
t_5
(* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0)))))))))
(if (<= x1 5e+100)
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ (* (* (* x1 2.0) t_3) (- t_3 3.0)) t_5)) t_4) t_0))
9.0))
(+
x1
(+ 9.0 (+ x1 (+ t_0 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.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 = t_1 * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= 0.012) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else if (x1 <= 5e+100) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + t_5)) + t_4) + t_0)) + 9.0);
} else {
tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = t_1 * t_3
t_5 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= 0.012d0) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
else if (x1 <= 5d+100) then
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + t_5)) + t_4) + t_0)) + 9.0d0)
else
tmp = x1 + (9.0d0 + (x1 + (t_0 + (4.0d0 * (x1 * (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 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_1 * t_3;
double t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= 0.012) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else if (x1 <= 5e+100) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + t_5)) + t_4) + t_0)) + 9.0);
} else {
tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = t_1 * t_3 t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= 0.012: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))) elif x1 <= 5e+100: tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + t_5)) + t_4) + t_0)) + 9.0) else: tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.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(t_1 * t_3) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= 0.012) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_2 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0))))))))); elseif (x1 <= 5e+100) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + t_5)) + t_4) + t_0)) + 9.0)); else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = t_1 * t_3; t_5 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= 0.012) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))); elseif (x1 <= 5e+100) tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + t_5)) + t_4) + t_0)) + 9.0); else tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.012], 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[(t$95$0 + N[(t$95$4 + N[(t$95$2 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+100], 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] + t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_1 \cdot t_3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.012:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_0 + \left(t_4 + t_2 \cdot \left(t_5 + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+100}:\\
\;\;\;\;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) + t_5\right) + t_4\right) + t_0\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_0 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.1%
fma-def3.1%
*-commutative3.1%
Simplified3.1%
Taylor expanded in x2 around 0 19.4%
if -5.60000000000000037e102 < x1 < 0.012Initial program 99.3%
Taylor expanded in x1 around 0 90.0%
+-commutative90.0%
mul-1-neg90.0%
sub-neg90.0%
Simplified90.0%
Taylor expanded in x1 around 0 96.1%
if 0.012 < x1 < 4.9999999999999999e100Initial program 99.5%
Taylor expanded in x1 around inf 97.8%
if 4.9999999999999999e100 < x1 Initial program 8.9%
Taylor expanded in x1 around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
sub-neg8.9%
Simplified8.9%
Taylor expanded in x1 around inf 8.9%
Taylor expanded in x1 around 0 97.8%
Final simplification86.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_1 (* 2.0 x2))))))))
(t_6 (* x2 (- (* 2.0 x2) 3.0)))
(t_7 (* 4.0 (* x1 t_6))))
(if (<= x1 -5.6e+102)
t_0
(if (<= x1 -0.004)
t_5
(if (<= x1 -6.7e-242)
(+ x1 (+ (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)) (+ x1 t_7)))
(if (<= x1 2e-266)
t_0
(if (<= x1 0.036)
(+ x1 (+ (* x1 (- (* 4.0 t_6) 2.0)) (* x2 -6.0)))
(if (<= x1 8.4e+92) t_5 (+ x1 (+ 9.0 (+ x1 (+ t_2 t_7))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2))))));
double t_6 = x2 * ((2.0 * x2) - 3.0);
double t_7 = 4.0 * (x1 * t_6);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_0;
} else if (x1 <= -0.004) {
tmp = t_5;
} else if (x1 <= -6.7e-242) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + t_7));
} else if (x1 <= 2e-266) {
tmp = t_0;
} else if (x1 <= 0.036) {
tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 8.4e+92) {
tmp = t_5;
} else {
tmp = x1 + (9.0 + (x1 + (t_2 + 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 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (x1 * x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_5 = x1 + (9.0d0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (t_1 * (2.0d0 * x2))))))
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
t_7 = 4.0d0 * (x1 * t_6)
if (x1 <= (-5.6d+102)) then
tmp = t_0
else if (x1 <= (-0.004d0)) then
tmp = t_5
else if (x1 <= (-6.7d-242)) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + t_7))
else if (x1 <= 2d-266) then
tmp = t_0
else if (x1 <= 0.036d0) then
tmp = x1 + ((x1 * ((4.0d0 * t_6) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 8.4d+92) then
tmp = t_5
else
tmp = x1 + (9.0d0 + (x1 + (t_2 + t_7)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2))))));
double t_6 = x2 * ((2.0 * x2) - 3.0);
double t_7 = 4.0 * (x1 * t_6);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_0;
} else if (x1 <= -0.004) {
tmp = t_5;
} else if (x1 <= -6.7e-242) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + t_7));
} else if (x1 <= 2e-266) {
tmp = t_0;
} else if (x1 <= 0.036) {
tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 8.4e+92) {
tmp = t_5;
} else {
tmp = x1 + (9.0 + (x1 + (t_2 + t_7)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) t_1 = x1 * (x1 * 3.0) t_2 = x1 * (x1 * x1) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2)))))) t_6 = x2 * ((2.0 * x2) - 3.0) t_7 = 4.0 * (x1 * t_6) tmp = 0 if x1 <= -5.6e+102: tmp = t_0 elif x1 <= -0.004: tmp = t_5 elif x1 <= -6.7e-242: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + t_7)) elif x1 <= 2e-266: tmp = t_0 elif x1 <= 0.036: tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0)) elif x1 <= 8.4e+92: tmp = t_5 else: tmp = x1 + (9.0 + (x1 + (t_2 + t_7))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_1 * Float64(2.0 * x2))))))) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_7 = Float64(4.0 * Float64(x1 * t_6)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_0; elseif (x1 <= -0.004) tmp = t_5; elseif (x1 <= -6.7e-242) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + t_7))); elseif (x1 <= 2e-266) tmp = t_0; elseif (x1 <= 0.036) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * t_6) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 8.4e+92) tmp = t_5; else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + t_7)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); t_1 = x1 * (x1 * 3.0); t_2 = x1 * (x1 * x1); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2)))))); t_6 = x2 * ((2.0 * x2) - 3.0); t_7 = 4.0 * (x1 * t_6); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_0; elseif (x1 <= -0.004) tmp = t_5; elseif (x1 <= -6.7e-242) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + t_7)); elseif (x1 <= 2e-266) tmp = t_0; elseif (x1 <= 0.036) tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 8.4e+92) tmp = t_5; else tmp = x1 + (9.0 + (x1 + (t_2 + t_7))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$0, If[LessEqual[x1, -0.004], t$95$5, If[LessEqual[x1, -6.7e-242], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-266], t$95$0, If[LessEqual[x1, 0.036], N[(x1 + N[(N[(x1 * N[(N[(4.0 * t$95$6), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.4e+92], t$95$5, N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_7 := 4 \cdot \left(x1 \cdot t_6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -0.004:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -6.7 \cdot 10^{-242}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + t_7\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-266}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 0.036:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot t_6 - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 8.4 \cdot 10^{+92}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + t_7\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -6.70000000000000029e-242 < x1 < 2e-266Initial program 50.6%
Taylor expanded in x1 around 0 37.3%
Taylor expanded in x1 around 0 38.8%
fma-def38.8%
*-commutative38.8%
Simplified38.8%
Taylor expanded in x2 around 0 57.7%
if -5.60000000000000037e102 < x1 < -0.0040000000000000001 or 0.0359999999999999973 < x1 < 8.39999999999999944e92Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around 0 85.8%
if -0.0040000000000000001 < x1 < -6.70000000000000029e-242Initial program 99.3%
Taylor expanded in x1 around 0 92.5%
if 2e-266 < x1 < 0.0359999999999999973Initial program 99.2%
Taylor expanded in x1 around 0 95.7%
Taylor expanded in x1 around 0 96.0%
if 8.39999999999999944e92 < x1 Initial program 14.6%
Taylor expanded in x1 around 0 10.7%
+-commutative10.7%
mul-1-neg10.7%
sub-neg10.7%
Simplified10.7%
Taylor expanded in x1 around inf 10.7%
Taylor expanded in x1 around 0 96.1%
Final simplification84.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 5e+102)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
t_0
(+
(* t_1 t_3)
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0)))))))))
(+
x1
(+ 9.0 (+ x1 (+ t_0 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.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 tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= 5e+102) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else {
tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (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) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= 5d+102) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
else
tmp = x1 + (9.0d0 + (x1 + (t_0 + (4.0d0 * (x1 * (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 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= 5e+102) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
} else {
tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= 5e+102: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))) else: tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.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) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= 5e+102) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0))))))))); else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= 5e+102) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))); else tmp = x1 + (9.0 + (x1 + (t_0 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+102], 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[(t$95$0 + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_0 + \left(t_1 \cdot t_3 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_0 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 3.1%
fma-def3.1%
*-commutative3.1%
Simplified3.1%
Taylor expanded in x2 around 0 19.4%
if -5.60000000000000037e102 < x1 < 5e102Initial program 99.4%
Taylor expanded in x1 around 0 82.9%
+-commutative82.9%
mul-1-neg82.9%
sub-neg82.9%
Simplified82.9%
Taylor expanded in x1 around 0 93.0%
if 5e102 < x1 Initial program 8.9%
Taylor expanded in x1 around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
sub-neg8.9%
Simplified8.9%
Taylor expanded in x1 around inf 8.9%
Taylor expanded in x1 around 0 97.8%
Final simplification84.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(* t_3 t_4)
(*
t_0
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* (* (* x1 2.0) (* 2.0 x2)) (- (- (* 2.0 x2) x1) 3.0))))))))))
(t_6 (* x2 (- (* 2.0 x2) 3.0)))
(t_7 (* 4.0 (* x1 t_6))))
(if (<= x1 -5.6e+102)
t_1
(if (<= x1 -16000.0)
t_5
(if (<= x1 -7e-256)
(+ x1 (+ (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0)) (+ x1 t_7)))
(if (<= x1 9.8e-260)
t_1
(if (<= x1 1.4)
(+ x1 (+ (* x1 (- (* 4.0 t_6) 2.0)) (* x2 -6.0)))
(if (<= x1 5e+100) t_5 (+ x1 (+ 9.0 (+ x1 (+ t_2 t_7))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
double t_6 = x2 * ((2.0 * x2) - 3.0);
double t_7 = 4.0 * (x1 * t_6);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -16000.0) {
tmp = t_5;
} else if (x1 <= -7e-256) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + t_7));
} else if (x1 <= 9.8e-260) {
tmp = t_1;
} else if (x1 <= 1.4) {
tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 5e+100) {
tmp = t_5;
} else {
tmp = x1 + (9.0 + (x1 + (t_2 + 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) + 1.0d0
t_1 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + (9.0d0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * (2.0d0 * x2)) * (((2.0d0 * x2) - x1) - 3.0d0))))))))
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
t_7 = 4.0d0 * (x1 * t_6)
if (x1 <= (-5.6d+102)) then
tmp = t_1
else if (x1 <= (-16000.0d0)) then
tmp = t_5
else if (x1 <= (-7d-256)) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + t_7))
else if (x1 <= 9.8d-260) then
tmp = t_1
else if (x1 <= 1.4d0) then
tmp = x1 + ((x1 * ((4.0d0 * t_6) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 5d+100) then
tmp = t_5
else
tmp = x1 + (9.0d0 + (x1 + (t_2 + t_7)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0))))))));
double t_6 = x2 * ((2.0 * x2) - 3.0);
double t_7 = 4.0 * (x1 * t_6);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_1;
} else if (x1 <= -16000.0) {
tmp = t_5;
} else if (x1 <= -7e-256) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + t_7));
} else if (x1 <= 9.8e-260) {
tmp = t_1;
} else if (x1 <= 1.4) {
tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 5e+100) {
tmp = t_5;
} else {
tmp = x1 + (9.0 + (x1 + (t_2 + t_7)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))) t_6 = x2 * ((2.0 * x2) - 3.0) t_7 = 4.0 * (x1 * t_6) tmp = 0 if x1 <= -5.6e+102: tmp = t_1 elif x1 <= -16000.0: tmp = t_5 elif x1 <= -7e-256: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + t_7)) elif x1 <= 9.8e-260: tmp = t_1 elif x1 <= 1.4: tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0)) elif x1 <= 5e+100: tmp = t_5 else: tmp = x1 + (9.0 + (x1 + (t_2 + t_7))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)) * Float64(Float64(Float64(2.0 * x2) - x1) - 3.0))))))))) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_7 = Float64(4.0 * Float64(x1 * t_6)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -16000.0) tmp = t_5; elseif (x1 <= -7e-256) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + t_7))); elseif (x1 <= 9.8e-260) tmp = t_1; elseif (x1 <= 1.4) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * t_6) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 5e+100) tmp = t_5; else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + t_7)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + (9.0 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * (2.0 * x2)) * (((2.0 * x2) - x1) - 3.0)))))))); t_6 = x2 * ((2.0 * x2) - 3.0); t_7 = 4.0 * (x1 * t_6); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_1; elseif (x1 <= -16000.0) tmp = t_5; elseif (x1 <= -7e-256) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + t_7)); elseif (x1 <= 9.8e-260) tmp = t_1; elseif (x1 <= 1.4) tmp = x1 + ((x1 * ((4.0 * t_6) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 5e+100) tmp = t_5; else tmp = x1 + (9.0 + (x1 + (t_2 + t_7))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$1, If[LessEqual[x1, -16000.0], t$95$5, If[LessEqual[x1, -7e-256], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.8e-260], t$95$1, If[LessEqual[x1, 1.4], N[(x1 + N[(N[(x1 * N[(N[(4.0 * t$95$6), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+100], t$95$5, N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_3 \cdot t_4 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right) \cdot \left(\left(2 \cdot x2 - x1\right) - 3\right)\right)\right)\right)\right)\right)\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_7 := 4 \cdot \left(x1 \cdot t_6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq -16000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -7 \cdot 10^{-256}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + t_7\right)\right)\\
\mathbf{elif}\;x1 \leq 9.8 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot t_6 - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+100}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + t_7\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or -7.00000000000000028e-256 < x1 < 9.8000000000000005e-260Initial program 50.6%
Taylor expanded in x1 around 0 37.3%
Taylor expanded in x1 around 0 38.8%
fma-def38.8%
*-commutative38.8%
Simplified38.8%
Taylor expanded in x2 around 0 57.7%
if -5.60000000000000037e102 < x1 < -16000 or 1.3999999999999999 < x1 < 4.9999999999999999e100Initial program 99.5%
Taylor expanded in x1 around 0 32.7%
+-commutative32.7%
mul-1-neg32.7%
sub-neg32.7%
Simplified32.7%
Taylor expanded in x1 around inf 32.7%
Taylor expanded in x1 around 0 80.0%
if -16000 < x1 < -7.00000000000000028e-256Initial program 99.2%
Taylor expanded in x1 around 0 91.2%
if 9.8000000000000005e-260 < x1 < 1.3999999999999999Initial program 99.2%
Taylor expanded in x1 around 0 95.7%
Taylor expanded in x1 around 0 96.0%
if 4.9999999999999999e100 < x1 Initial program 8.9%
Taylor expanded in x1 around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
sub-neg8.9%
Simplified8.9%
Taylor expanded in x1 around inf 8.9%
Taylor expanded in x1 around 0 97.8%
Final simplification82.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (+ x1 (+ (* x1 (- (* 4.0 t_1) 2.0)) (* x2 -6.0)))))
(if (<= x1 -2.6e+81)
t_0
(if (<= x1 -4.7e-244)
t_2
(if (<= x1 5.8e-260)
t_0
(if (<= x1 1.4)
t_2
(+ x1 (+ 9.0 (+ x1 (+ (* x1 (* x1 x1)) (* 4.0 (* x1 t_1))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 + ((x1 * ((4.0 * t_1) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.6e+81) {
tmp = t_0;
} else if (x1 <= -4.7e-244) {
tmp = t_2;
} else if (x1 <= 5.8e-260) {
tmp = t_0;
} else if (x1 <= 1.4) {
tmp = t_2;
} else {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x1 * t_1)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = x1 + ((x1 * ((4.0d0 * t_1) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-2.6d+81)) then
tmp = t_0
else if (x1 <= (-4.7d-244)) then
tmp = t_2
else if (x1 <= 5.8d-260) then
tmp = t_0
else if (x1 <= 1.4d0) then
tmp = t_2
else
tmp = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + (4.0d0 * (x1 * t_1)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 + ((x1 * ((4.0 * t_1) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.6e+81) {
tmp = t_0;
} else if (x1 <= -4.7e-244) {
tmp = t_2;
} else if (x1 <= 5.8e-260) {
tmp = t_0;
} else if (x1 <= 1.4) {
tmp = t_2;
} else {
tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x1 * t_1)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = x1 + ((x1 * ((4.0 * t_1) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -2.6e+81: tmp = t_0 elif x1 <= -4.7e-244: tmp = t_2 elif x1 <= 5.8e-260: tmp = t_0 elif x1 <= 1.4: tmp = t_2 else: tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x1 * t_1))))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * t_1) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -2.6e+81) tmp = t_0; elseif (x1 <= -4.7e-244) tmp = t_2; elseif (x1 <= 5.8e-260) tmp = t_0; elseif (x1 <= 1.4) tmp = t_2; else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(4.0 * Float64(x1 * t_1)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = x1 + ((x1 * ((4.0 * t_1) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -2.6e+81) tmp = t_0; elseif (x1 <= -4.7e-244) tmp = t_2; elseif (x1 <= 5.8e-260) tmp = t_0; elseif (x1 <= 1.4) tmp = t_2; else tmp = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x1 * t_1))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * t$95$1), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+81], t$95$0, If[LessEqual[x1, -4.7e-244], t$95$2, If[LessEqual[x1, 5.8e-260], t$95$0, If[LessEqual[x1, 1.4], t$95$2, N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 + \left(x1 \cdot \left(4 \cdot t_1 - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.7 \cdot 10^{-244}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 5.8 \cdot 10^{-260}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.59999999999999992e81 or -4.6999999999999998e-244 < x1 < 5.7999999999999999e-260Initial program 52.1%
Taylor expanded in x1 around 0 36.2%
Taylor expanded in x1 around 0 37.7%
fma-def37.7%
*-commutative37.7%
Simplified37.7%
Taylor expanded in x2 around 0 56.1%
if -2.59999999999999992e81 < x1 < -4.6999999999999998e-244 or 5.7999999999999999e-260 < x1 < 1.3999999999999999Initial program 99.2%
Taylor expanded in x1 around 0 85.3%
Taylor expanded in x1 around 0 85.4%
if 1.3999999999999999 < x1 Initial program 38.6%
Taylor expanded in x1 around 0 16.4%
+-commutative16.4%
mul-1-neg16.4%
sub-neg16.4%
Simplified16.4%
Taylor expanded in x1 around inf 16.4%
Taylor expanded in x1 around 0 78.0%
Final simplification75.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6.5e+81) (and (not (<= x1 -5.8e-242)) (<= x1 9.8e-260))) (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))) (+ x1 (+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e+81) || (!(x1 <= -5.8e-242) && (x1 <= 9.8e-260))) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6.5d+81)) .or. (.not. (x1 <= (-5.8d-242))) .and. (x1 <= 9.8d-260)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e+81) || (!(x1 <= -5.8e-242) && (x1 <= 9.8e-260))) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.5e+81) or (not (x1 <= -5.8e-242) and (x1 <= 9.8e-260)): tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.5e+81) || (!(x1 <= -5.8e-242) && (x1 <= 9.8e-260))) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); else 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))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6.5e+81) || (~((x1 <= -5.8e-242)) && (x1 <= 9.8e-260))) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.5e+81], And[N[Not[LessEqual[x1, -5.8e-242]], $MachinePrecision], LessEqual[x1, 9.8e-260]]], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+81} \lor \neg \left(x1 \leq -5.8 \cdot 10^{-242}\right) \land x1 \leq 9.8 \cdot 10^{-260}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -6.4999999999999996e81 or -5.8000000000000002e-242 < x1 < 9.8000000000000005e-260Initial program 52.1%
Taylor expanded in x1 around 0 36.2%
Taylor expanded in x1 around 0 37.7%
fma-def37.7%
*-commutative37.7%
Simplified37.7%
Taylor expanded in x2 around 0 56.1%
if -6.4999999999999996e81 < x1 < -5.8000000000000002e-242 or 9.8000000000000005e-260 < x1 Initial program 77.8%
Taylor expanded in x1 around 0 60.4%
Taylor expanded in x1 around 0 69.9%
Final simplification66.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))))
(t_1 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -8e+79)
t_0
(if (<= x1 -7.8e-115)
(- x1 (* x1 (+ 2.0 (* t_1 -4.0))))
(if (<= x1 9.5e-22) t_0 (+ x1 (+ 9.0 (+ x1 (* 4.0 (* x1 t_1))))))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -8e+79) {
tmp = t_0;
} else if (x1 <= -7.8e-115) {
tmp = x1 - (x1 * (2.0 + (t_1 * -4.0)));
} else if (x1 <= 9.5e-22) {
tmp = t_0;
} else {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_1))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-8d+79)) then
tmp = t_0
else if (x1 <= (-7.8d-115)) then
tmp = x1 - (x1 * (2.0d0 + (t_1 * (-4.0d0))))
else if (x1 <= 9.5d-22) then
tmp = t_0
else
tmp = x1 + (9.0d0 + (x1 + (4.0d0 * (x1 * t_1))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -8e+79) {
tmp = t_0;
} else if (x1 <= -7.8e-115) {
tmp = x1 - (x1 * (2.0 + (t_1 * -4.0)));
} else if (x1 <= 9.5e-22) {
tmp = t_0;
} else {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_1))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) t_1 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -8e+79: tmp = t_0 elif x1 <= -7.8e-115: tmp = x1 - (x1 * (2.0 + (t_1 * -4.0))) elif x1 <= 9.5e-22: tmp = t_0 else: tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_1)))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -8e+79) tmp = t_0; elseif (x1 <= -7.8e-115) tmp = Float64(x1 - Float64(x1 * Float64(2.0 + Float64(t_1 * -4.0)))); elseif (x1 <= 9.5e-22) tmp = t_0; else tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(4.0 * Float64(x1 * t_1))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); t_1 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -8e+79) tmp = t_0; elseif (x1 <= -7.8e-115) tmp = x1 - (x1 * (2.0 + (t_1 * -4.0))); elseif (x1 <= 9.5e-22) tmp = t_0; else tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_1)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8e+79], t$95$0, If[LessEqual[x1, -7.8e-115], N[(x1 - N[(x1 * N[(2.0 + N[(t$95$1 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e-22], t$95$0, N[(x1 + N[(9.0 + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -8 \cdot 10^{+79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -7.8 \cdot 10^{-115}:\\
\;\;\;\;x1 - x1 \cdot \left(2 + t_1 \cdot -4\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x1 \cdot t_1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -7.99999999999999974e79 or -7.7999999999999997e-115 < x1 < 9.4999999999999994e-22Initial program 76.9%
Taylor expanded in x1 around 0 67.3%
Taylor expanded in x1 around 0 68.0%
fma-def68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in x2 around 0 70.6%
if -7.99999999999999974e79 < x1 < -7.7999999999999997e-115Initial program 99.2%
Taylor expanded in x1 around 0 69.6%
Taylor expanded in x1 around 0 69.1%
fma-def69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in x1 around -inf 65.1%
if 9.4999999999999994e-22 < x1 Initial program 40.4%
Taylor expanded in x1 around 0 16.7%
Taylor expanded in x1 around inf 44.3%
Final simplification62.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9.6e+78) (and (not (<= x1 -1.72e-25)) (<= x1 1.4e-22))) (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.6e+78) || (!(x1 <= -1.72e-25) && (x1 <= 1.4e-22))) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 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) :: tmp
if ((x1 <= (-9.6d+78)) .or. (.not. (x1 <= (-1.72d-25))) .and. (x1 <= 1.4d-22)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 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 tmp;
if ((x1 <= -9.6e+78) || (!(x1 <= -1.72e-25) && (x1 <= 1.4e-22))) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9.6e+78) or (not (x1 <= -1.72e-25) and (x1 <= 1.4e-22)): tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9.6e+78) || (!(x1 <= -1.72e-25) && (x1 <= 1.4e-22))) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 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) tmp = 0.0; if ((x1 <= -9.6e+78) || (~((x1 <= -1.72e-25)) && (x1 <= 1.4e-22))) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9.6e+78], And[N[Not[LessEqual[x1, -1.72e-25]], $MachinePrecision], LessEqual[x1, 1.4e-22]]], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $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}
\mathbf{if}\;x1 \leq -9.6 \cdot 10^{+78} \lor \neg \left(x1 \leq -1.72 \cdot 10^{-25}\right) \land x1 \leq 1.4 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\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 < -9.5999999999999994e78 or -1.71999999999999995e-25 < x1 < 1.39999999999999997e-22Initial program 79.1%
Taylor expanded in x1 around 0 70.5%
Taylor expanded in x1 around 0 71.2%
fma-def71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in x2 around 0 69.1%
if -9.5999999999999994e78 < x1 < -1.71999999999999995e-25 or 1.39999999999999997e-22 < x1 Initial program 58.2%
Taylor expanded in x1 around 0 28.0%
Taylor expanded in x1 around inf 44.4%
Final simplification59.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0))))))
(t_1 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -8.8e+80)
t_0
(if (<= x1 -5.3e-115)
(- x1 (* x1 (+ 2.0 (* t_1 -4.0))))
(if (<= x1 2.15e-19) t_0 (+ x1 (* x1 (+ 1.0 (* 4.0 t_1)))))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -8.8e+80) {
tmp = t_0;
} else if (x1 <= -5.3e-115) {
tmp = x1 - (x1 * (2.0 + (t_1 * -4.0)));
} else if (x1 <= 2.15e-19) {
tmp = t_0;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-8.8d+80)) then
tmp = t_0
else if (x1 <= (-5.3d-115)) then
tmp = x1 - (x1 * (2.0d0 + (t_1 * (-4.0d0))))
else if (x1 <= 2.15d-19) then
tmp = t_0
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
double t_1 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -8.8e+80) {
tmp = t_0;
} else if (x1 <= -5.3e-115) {
tmp = x1 - (x1 * (2.0 + (t_1 * -4.0)));
} else if (x1 <= 2.15e-19) {
tmp = t_0;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) t_1 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -8.8e+80: tmp = t_0 elif x1 <= -5.3e-115: tmp = x1 - (x1 * (2.0 + (t_1 * -4.0))) elif x1 <= 2.15e-19: tmp = t_0 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_1))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -8.8e+80) tmp = t_0; elseif (x1 <= -5.3e-115) tmp = Float64(x1 - Float64(x1 * Float64(2.0 + Float64(t_1 * -4.0)))); elseif (x1 <= 2.15e-19) tmp = t_0; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); t_1 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -8.8e+80) tmp = t_0; elseif (x1 <= -5.3e-115) tmp = x1 - (x1 * (2.0 + (t_1 * -4.0))); elseif (x1 <= 2.15e-19) tmp = t_0; else tmp = x1 + (x1 * (1.0 + (4.0 * t_1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.8e+80], t$95$0, If[LessEqual[x1, -5.3e-115], N[(x1 - N[(x1 * N[(2.0 + N[(t$95$1 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.15e-19], t$95$0, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -8.8 \cdot 10^{+80}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5.3 \cdot 10^{-115}:\\
\;\;\;\;x1 - x1 \cdot \left(2 + t_1 \cdot -4\right)\\
\mathbf{elif}\;x1 \leq 2.15 \cdot 10^{-19}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_1\right)\\
\end{array}
\end{array}
if x1 < -8.80000000000000011e80 or -5.3e-115 < x1 < 2.15e-19Initial program 76.9%
Taylor expanded in x1 around 0 67.3%
Taylor expanded in x1 around 0 68.0%
fma-def68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in x2 around 0 70.6%
if -8.80000000000000011e80 < x1 < -5.3e-115Initial program 99.2%
Taylor expanded in x1 around 0 69.6%
Taylor expanded in x1 around 0 69.1%
fma-def69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in x1 around -inf 65.1%
if 2.15e-19 < x1 Initial program 40.4%
Taylor expanded in x1 around 0 16.7%
Taylor expanded in x1 around inf 44.3%
Final simplification62.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.6e-106) (not (<= x1 1.1e-87))) (+ 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 <= -1.6e-106) || !(x1 <= 1.1e-87)) {
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 <= (-1.6d-106)) .or. (.not. (x1 <= 1.1d-87))) 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 <= -1.6e-106) || !(x1 <= 1.1e-87)) {
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 <= -1.6e-106) or not (x1 <= 1.1e-87): 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 <= -1.6e-106) || !(x1 <= 1.1e-87)) 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 <= -1.6e-106) || ~((x1 <= 1.1e-87))) 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, -1.6e-106], N[Not[LessEqual[x1, 1.1e-87]], $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 -1.6 \cdot 10^{-106} \lor \neg \left(x1 \leq 1.1 \cdot 10^{-87}\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 < -1.6e-106 or 1.09999999999999994e-87 < x1 Initial program 55.1%
Taylor expanded in x1 around 0 35.7%
Taylor expanded in x1 around inf 34.9%
if -1.6e-106 < x1 < 1.09999999999999994e-87Initial program 99.4%
Taylor expanded in x1 around 0 86.9%
Taylor expanded in x1 around 0 77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in x1 around 0 77.9%
*-commutative77.9%
Simplified77.9%
Final simplification50.4%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -6.5e-221) (* x2 -6.0) (if (<= x2 4.15e-215) (+ x1 (+ x1 (* x1 -3.0))) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -6.5e-221) {
tmp = x2 * -6.0;
} else if (x2 <= 4.15e-215) {
tmp = x1 + (x1 + (x1 * -3.0));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-6.5d-221)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 4.15d-215) then
tmp = x1 + (x1 + (x1 * (-3.0d0)))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -6.5e-221) {
tmp = x2 * -6.0;
} else if (x2 <= 4.15e-215) {
tmp = x1 + (x1 + (x1 * -3.0));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -6.5e-221: tmp = x2 * -6.0 elif x2 <= 4.15e-215: tmp = x1 + (x1 + (x1 * -3.0)) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -6.5e-221) tmp = Float64(x2 * -6.0); elseif (x2 <= 4.15e-215) tmp = Float64(x1 + Float64(x1 + Float64(x1 * -3.0))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -6.5e-221) tmp = x2 * -6.0; elseif (x2 <= 4.15e-215) tmp = x1 + (x1 + (x1 * -3.0)); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -6.5e-221], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 4.15e-215], N[(x1 + N[(x1 + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.5 \cdot 10^{-221}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 4.15 \cdot 10^{-215}:\\
\;\;\;\;x1 + \left(x1 + x1 \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -6.5e-221Initial program 72.8%
Taylor expanded in x1 around 0 52.1%
Taylor expanded in x1 around 0 33.5%
*-commutative33.5%
Simplified33.5%
Taylor expanded in x1 around 0 33.5%
*-commutative33.5%
Simplified33.5%
if -6.5e-221 < x2 < 4.1500000000000002e-215Initial program 80.4%
Taylor expanded in x1 around 0 57.1%
Taylor expanded in x1 around 0 56.0%
fma-def56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x2 around 0 46.0%
if 4.1500000000000002e-215 < x2 Initial program 65.7%
Taylor expanded in x1 around 0 55.1%
Taylor expanded in x1 around 0 39.0%
*-commutative39.0%
Simplified39.0%
Final simplification37.6%
(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.0%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x1 around 0 32.2%
*-commutative32.2%
Simplified32.2%
Final simplification32.2%
(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.0%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x1 around 0 32.2%
*-commutative32.2%
Simplified32.2%
Taylor expanded in x1 around 0 31.8%
*-commutative31.8%
Simplified31.8%
Final simplification31.8%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 71.0%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x1 around 0 32.2%
*-commutative32.2%
Simplified32.2%
Taylor expanded in x1 around inf 3.6%
Final simplification3.6%
herbie shell --seed 2024011
(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))))))