
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* 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
(/ (- (* 3.0 (* x1 x1)) (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)))
(+
(*
3.0
(/
(* (pow x1 2.0) (- (* 3.0 (pow x1 2.0)) x1))
(+ 1.0 (pow x1 2.0))))
(pow x1 3.0))))))
(* 6.0 (pow x1 4.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 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, (((3.0 * (x1 * x1)) - 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))), ((3.0 * ((pow(x1, 2.0) * ((3.0 * pow(x1, 2.0)) - x1)) / (1.0 + pow(x1, 2.0)))) + pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.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) 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(Float64(3.0 * Float64(x1 * x1)) - 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))), Float64(Float64(3.0 * Float64(Float64((x1 ^ 2.0) * Float64(Float64(3.0 * (x1 ^ 2.0)) - x1)) / Float64(1.0 + (x1 ^ 2.0)))) + (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.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]}, 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[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - 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[(N[(3.0 * N[(N[(N[Power[x1, 2.0], $MachinePrecision] * N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.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}\\
\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{3 \cdot \left(x1 \cdot x1\right) - \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), 3 \cdot \frac{{x1}^{2} \cdot \left(3 \cdot {x1}^{2} - x1\right)}{1 + {x1}^{2}} + {x1}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
Taylor expanded in x2 around 0 99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified5.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 49.3%
mul-1-neg49.3%
distribute-rgt-neg-in49.3%
mul-1-neg49.3%
unsub-neg49.3%
*-commutative49.3%
associate-/l*49.3%
Simplified49.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* t_1 t_3))
(t_5 (* (* (* x1 2.0) t_3) (- t_3 3.0)))
(t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0)))) t_4) t_0))
t_6))
INFINITY)
(+
x1
(+
t_6
(+
x1
(+
t_0
(+
t_4
(*
t_2
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(/
1.0
(/ (fma x1 x1 1.0) (- (fma 3.0 (pow x1 2.0) (* 2.0 x2)) x1))))
6.0)))))))))
(* 6.0 (pow x1 4.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 * 2.0) * t_3) * (t_3 - 3.0);
double t_6 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_4 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * (1.0 / (fma(x1, x1, 1.0) / (fma(3.0, pow(x1, 2.0), (2.0 * x2)) - x1)))) - 6.0))))))));
} else {
tmp = 6.0 * pow(x1, 4.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(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) t_6 = 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(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(1.0 / Float64(fma(x1, x1, 1.0) / Float64(fma(3.0, (x1 ^ 2.0), Float64(2.0 * x2)) - x1)))) - 6.0))))))))); else tmp = Float64(6.0 * (x1 ^ 4.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[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = 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[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(1.0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.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 := t\_1 \cdot t\_3\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right)\\
t_6 := 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\_5 + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_4\right) + t\_0\right)\right) + t\_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_0 + \left(t\_4 + t\_2 \cdot \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{1}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right) - x1}} - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
fma-define99.4%
*-commutative99.4%
fma-define99.4%
clear-num99.4%
inv-pow99.4%
*-commutative99.4%
fma-define99.4%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
unpow-199.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified5.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 49.3%
mul-1-neg49.3%
distribute-rgt-neg-in49.3%
mul-1-neg49.3%
unsub-neg49.3%
*-commutative49.3%
associate-/l*49.3%
Simplified49.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double 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 = 6.0 * pow(x1, 4.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 = 6.0 * Math.pow(x1, 4.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 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 = 6.0 * math.pow(x1, 4.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) 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(6.0 * (x1 ^ 4.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; 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 = 6.0 * (x1 ^ 4.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, 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[(6.0 * N[Power[x1, 4.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}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified5.8%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 49.3%
mul-1-neg49.3%
distribute-rgt-neg-in49.3%
mul-1-neg49.3%
unsub-neg49.3%
*-commutative49.3%
associate-/l*49.3%
Simplified49.3%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -1.4e+58)
(* 6.0 (pow x1 4.0))
(if (<= x1 3.25e+49)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(*
(pow x1 2.0)
(+ (* x1 (- (* x1 6.0) 3.0)) (* x2 (+ 8.0 (* 3.0 (/ -1.0 x2))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.4e+58) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 3.25e+49) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = pow(x1, 2.0) * ((x1 * ((x1 * 6.0) - 3.0)) + (x2 * (8.0 + (3.0 * (-1.0 / x2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-1.4d+58)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= 3.25d+49) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = (x1 ** 2.0d0) * ((x1 * ((x1 * 6.0d0) - 3.0d0)) + (x2 * (8.0d0 + (3.0d0 * ((-1.0d0) / x2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.4e+58) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= 3.25e+49) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = Math.pow(x1, 2.0) * ((x1 * ((x1 * 6.0) - 3.0)) + (x2 * (8.0 + (3.0 * (-1.0 / x2)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -1.4e+58: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= 3.25e+49: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = math.pow(x1, 2.0) * ((x1 * ((x1 * 6.0) - 3.0)) + (x2 * (8.0 + (3.0 * (-1.0 / x2))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -1.4e+58) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 3.25e+49) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64((x1 ^ 2.0) * Float64(Float64(x1 * Float64(Float64(x1 * 6.0) - 3.0)) + Float64(x2 * Float64(8.0 + Float64(3.0 * Float64(-1.0 / x2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -1.4e+58) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= 3.25e+49) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = (x1 ^ 2.0) * ((x1 * ((x1 * 6.0) - 3.0)) + (x2 * (8.0 + (3.0 * (-1.0 / x2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1.4e+58], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.25e+49], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 2.0], $MachinePrecision] * N[(N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(8.0 + N[(3.0 * N[(-1.0 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+58}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 3.25 \cdot 10^{+49}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x1}^{2} \cdot \left(x1 \cdot \left(x1 \cdot 6 - 3\right) + x2 \cdot \left(8 + 3 \cdot \frac{-1}{x2}\right)\right)\\
\end{array}
\end{array}
if x1 < -1.3999999999999999e58Initial program 13.6%
Simplified22.7%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 59.2%
mul-1-neg59.2%
distribute-rgt-neg-in59.2%
mul-1-neg59.2%
unsub-neg59.2%
*-commutative59.2%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -1.3999999999999999e58 < x1 < 3.25000000000000025e49Initial program 99.3%
fma-define99.3%
*-commutative99.3%
fma-define99.3%
clear-num99.3%
inv-pow99.3%
*-commutative99.3%
fma-define99.3%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
unpow-199.4%
Simplified99.4%
Taylor expanded in x1 around inf 94.3%
if 3.25000000000000025e49 < x1 Initial program 43.5%
Simplified43.5%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 60.6%
mul-1-neg60.6%
distribute-rgt-neg-in60.6%
mul-1-neg60.6%
unsub-neg60.6%
*-commutative60.6%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in x1 around 0 99.9%
Final simplification96.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -1.4e+58) (not (<= x1 4.4e+49)))
(* 6.0 (pow x1 4.0))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.4e+58) || !(x1 <= 4.4e+49)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-1.4d+58)) .or. (.not. (x1 <= 4.4d+49))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.4e+58) || !(x1 <= 4.4e+49)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1.4e+58) or not (x1 <= 4.4e+49): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1.4e+58) || !(x1 <= 4.4e+49)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1.4e+58) || ~((x1 <= 4.4e+49))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1.4e+58], N[Not[LessEqual[x1, 4.4e+49]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+58} \lor \neg \left(x1 \leq 4.4 \cdot 10^{+49}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.3999999999999999e58 or 4.4000000000000001e49 < x1 Initial program 30.2%
Simplified34.2%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around -inf 60.0%
mul-1-neg60.0%
distribute-rgt-neg-in60.0%
mul-1-neg60.0%
unsub-neg60.0%
*-commutative60.0%
associate-/l*60.0%
Simplified60.0%
Taylor expanded in x1 around inf 98.9%
*-commutative98.9%
Simplified98.9%
if -1.3999999999999999e58 < x1 < 4.4000000000000001e49Initial program 99.3%
fma-define99.3%
*-commutative99.3%
fma-define99.3%
clear-num99.3%
inv-pow99.3%
*-commutative99.3%
fma-define99.3%
associate-*r*99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
unpow-199.4%
Simplified99.4%
Taylor expanded in x1 around inf 94.3%
Final simplification96.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -2.45e+57) (not (<= x1 1.3e+39)))
(* 6.0 (pow x1 4.0))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -2.45e+57) || !(x1 <= 1.3e+39)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-2.45d+57)) .or. (.not. (x1 <= 1.3d+39))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (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 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -2.45e+57) || !(x1 <= 1.3e+39)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -2.45e+57) or not (x1 <= 1.3e+39): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -2.45e+57) || !(x1 <= 1.3e+39)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.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 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -2.45e+57) || ~((x1 <= 1.3e+39))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.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 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -2.45e+57], N[Not[LessEqual[x1, 1.3e+39]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+57} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+39}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.45e57 or 1.3e39 < x1 Initial program 32.9%
Simplified36.8%
Taylor expanded in x1 around -inf 99.1%
Taylor expanded in x2 around -inf 59.7%
mul-1-neg59.7%
distribute-rgt-neg-in59.7%
mul-1-neg59.7%
unsub-neg59.7%
*-commutative59.7%
associate-/l*59.7%
Simplified59.7%
Taylor expanded in x1 around inf 97.1%
*-commutative97.1%
Simplified97.1%
if -2.45e57 < x1 < 1.3e39Initial program 99.3%
Taylor expanded in x1 around 0 93.7%
+-commutative93.7%
mul-1-neg93.7%
unsub-neg93.7%
Simplified93.7%
Taylor expanded in x1 around 0 80.2%
Final simplification87.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_5 (* t_2 t_3)))
(if (<= x1 -6.5e+85)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 -0.7)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
t_5
(*
t_0
(+ t_4 (* (- t_3 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(if (<= x1 26000.0)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* 3.0 (- 3.0 (* x2 -2.0)))
(+ (* x2 6.0) (+ (* x1 -19.0) (* x2 8.0)))))
6.0)))
2.0))))
(if (<= x1 1e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (+ t_1 (+ t_5 (* t_0 (+ (* x1 2.0) t_4)))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = t_2 * t_3;
double tmp;
if (x1 <= -6.5e+85) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= -0.7) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 26000.0) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_4))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_5 = t_2 * t_3
if (x1 <= (-6.5d+85)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= (-0.7d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + (t_5 + (t_0 * (t_4 + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else if (x1 <= 26000.0d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + ((x1 * (-19.0d0)) + (x2 * 8.0d0))))) - 6.0d0))) - 2.0d0)))
else if (x1 <= 1d+153) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0d0) + t_4))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = t_2 * t_3;
double tmp;
if (x1 <= -6.5e+85) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= -0.7) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 26000.0) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_4))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_5 = t_2 * t_3 tmp = 0 if x1 <= -6.5e+85: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= -0.7: tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) elif x1 <= 26000.0: tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) elif x1 <= 1e+153: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_4)))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_5 = Float64(t_2 * t_3) tmp = 0.0 if (x1 <= -6.5e+85) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= -0.7) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(t_4 + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); elseif (x1 <= 26000.0) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x1 * -19.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(x1 * 2.0) + t_4))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_5 = t_2 * t_3; tmp = 0.0; if (x1 <= -6.5e+85) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= -0.7) tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * (t_4 + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); elseif (x1 <= 26000.0) tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0))); elseif (x1 <= 1e+153) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_4)))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * t$95$3), $MachinePrecision]}, If[LessEqual[x1, -6.5e+85], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.7], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(t$95$4 + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 26000.0], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x1 * -19.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_5 := t\_2 \cdot t\_3\\
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+85}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq -0.7:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(t\_4 + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 26000:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + \left(x1 \cdot -19 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(x1 \cdot 2 + t\_4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -6.4999999999999994e85Initial program 7.3%
Simplified17.1%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x2 around 0 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in x2 around inf 97.7%
if -6.4999999999999994e85 < x1 < -0.69999999999999996Initial program 98.8%
Taylor expanded in x1 around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
Simplified80.8%
Taylor expanded in x1 around inf 80.8%
if -0.69999999999999996 < x1 < 26000Initial program 99.4%
Simplified85.8%
Taylor expanded in x1 around 0 71.2%
Taylor expanded in x2 around 0 85.0%
*-commutative85.0%
Simplified85.0%
if 26000 < x1 < 1e153Initial program 99.5%
Taylor expanded in x1 around 0 83.8%
+-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Taylor expanded in x1 around inf 86.9%
*-commutative86.9%
Simplified86.9%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification88.7%
(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
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(* t_1 (+ (* x1 2.0) (* (* x1 x1) (- (* t_2 4.0) 6.0)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(if (<= x1 -3700000000.0)
t_3
(if (<= x1 5500.0)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* 3.0 (- 3.0 (* x2 -2.0)))
(+ (* x2 6.0) (+ (* x1 -19.0) (* x2 8.0)))))
6.0)))
2.0))))
(if (<= x1 1e+153)
t_3
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.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 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * ((t_2 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= -3700000000.0) {
tmp = t_3;
} else if (x1 <= 5500.0) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else if (x1 <= (-3700000000.0d0)) then
tmp = t_3
else if (x1 <= 5500.0d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + ((x1 * (-19.0d0)) + (x2 * 8.0d0))))) - 6.0d0))) - 2.0d0)))
else if (x1 <= 1d+153) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * ((t_2 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= -3700000000.0) {
tmp = t_3;
} else if (x1 <= 5500.0) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) elif x1 <= -3700000000.0: tmp = t_3 elif x1 <= 5500.0: tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0))) elif x1 <= 1e+153: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); elseif (x1 <= -3700000000.0) tmp = t_3; elseif (x1 <= 5500.0) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x1 * -19.0) + Float64(x2 * 8.0))))) - 6.0))) - 2.0)))); elseif (x1 <= 1e+153) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.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 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((x1 * 2.0) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); elseif (x1 <= -3700000000.0) tmp = t_3; elseif (x1 <= 5500.0) tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x1 * -19.0) + (x2 * 8.0))))) - 6.0))) - 2.0))); elseif (x1 <= 1e+153) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3700000000.0], t$95$3, If[LessEqual[x1, 5500.0], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x1 * -19.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{elif}\;x1 \leq -3700000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 5500:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + \left(x1 \cdot -19 + x2 \cdot 8\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Simplified10.5%
Taylor expanded in x1 around 0 65.8%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x2 around 0 100.0%
if -5.60000000000000037e102 < x1 < -3.7e9 or 5500 < x1 < 1e153Initial program 99.3%
Taylor expanded in x1 around 0 84.7%
+-commutative84.7%
mul-1-neg84.7%
unsub-neg84.7%
Simplified84.7%
Taylor expanded in x1 around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -3.7e9 < x1 < 5500Initial program 99.4%
Simplified86.2%
Taylor expanded in x1 around 0 69.3%
Taylor expanded in x2 around 0 83.5%
*-commutative83.5%
Simplified83.5%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification88.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_5 (* t_2 t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(if (<= x1 -6.5e+85)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 8600000000000.0)
(+
x1
(+
t_3
(+
x1
(+
t_1
(+ t_5 (* t_0 (+ t_6 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))))))
(if (<= x1 1e+153)
(+ x1 (+ t_3 (+ x1 (+ t_1 (+ t_5 (* t_0 (+ (* x1 2.0) t_6)))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -6.5e+85) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 8600000000000.0) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_4 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_5 = t_2 * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
if (x1 <= (-6.5d+85)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 8600000000000.0d0) then
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0d0) + t_6))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_5 = t_2 * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -6.5e+85) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 8600000000000.0) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_5 = t_2 * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) tmp = 0 if x1 <= -6.5e+85: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 8600000000000.0: tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))) elif x1 <= 1e+153: tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6)))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) 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 <= -6.5e+85) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 8600000000000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(t_6 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(x1 * 2.0) + t_6))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_4 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_5 = t_2 * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -6.5e+85) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 8600000000000.0) tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))); elseif (x1 <= 1e+153) tmp = x1 + (t_3 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6)))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $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, -6.5e+85], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8600000000000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(t$95$6 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
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 -6.5 \cdot 10^{+85}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 8600000000000:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(t\_6 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(x1 \cdot 2 + t\_6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -6.4999999999999994e85Initial program 7.3%
Simplified17.1%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x2 around 0 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in x2 around inf 97.7%
if -6.4999999999999994e85 < x1 < 8.6e12Initial program 99.3%
Taylor expanded in x1 around 0 95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
Taylor expanded in x1 around 0 81.5%
if 8.6e12 < x1 < 1e153Initial program 99.5%
Taylor expanded in x1 around 0 83.8%
+-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Taylor expanded in x1 around inf 86.9%
*-commutative86.9%
Simplified86.9%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification87.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4e+76)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 4.5e+150)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+
(* 3.0 (- 3.0 (* x2 -2.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(* x1 (- (- (* x2 (+ (* x2 8.0) 24.0)) 16.0) 3.0))))))
6.0)))
2.0))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+76) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * (((x2 * ((x2 * 8.0) + 24.0)) - 16.0) - 3.0)))))) - 6.0))) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4d+76)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 4.5d+150) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * (((x2 * ((x2 * 8.0d0) + 24.0d0)) - 16.0d0) - 3.0d0)))))) - 6.0d0))) - 2.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4e+76) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * (((x2 * ((x2 * 8.0) + 24.0)) - 16.0) - 3.0)))))) - 6.0))) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4e+76: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 4.5e+150: tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * (((x2 * ((x2 * 8.0) + 24.0)) - 16.0) - 3.0)))))) - 6.0))) - 2.0))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4e+76) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 4.5e+150) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(Float64(x2 * Float64(Float64(x2 * 8.0) + 24.0)) - 16.0) - 3.0)))))) - 6.0))) - 2.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4e+76) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 4.5e+150) tmp = x1 + ((x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * (((x2 * ((x2 * 8.0) + 24.0)) - 16.0) - 3.0)))))) - 6.0))) - 2.0))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4e+76], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+150], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] + 24.0), $MachinePrecision]), $MachinePrecision] - 16.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4 \cdot 10^{+76}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(x2 \cdot \left(x2 \cdot 8 + 24\right) - 16\right) - 3\right)\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -4.0000000000000002e76Initial program 11.6%
Simplified20.9%
Taylor expanded in x1 around 0 61.1%
Taylor expanded in x2 around 0 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x2 around inf 93.5%
if -4.0000000000000002e76 < x1 < 4.5e150Initial program 99.4%
Simplified88.8%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x2 around 0 68.0%
Taylor expanded in x2 around 0 68.6%
if 4.5e150 < x1 Initial program 3.1%
Simplified3.1%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 97.3%
Final simplification76.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.4e+58)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 4.5e+150)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.4e+58) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.4d+58)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 4.5d+150) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.4e+58) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.4e+58: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 4.5e+150: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.4e+58) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 4.5e+150) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.4e+58) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 4.5e+150) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.4e+58], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+150], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.4 \cdot 10^{+58}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+150}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1.3999999999999999e58Initial program 13.6%
Simplified22.7%
Taylor expanded in x1 around 0 59.9%
Taylor expanded in x2 around 0 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x2 around inf 91.5%
if -1.3999999999999999e58 < x1 < 4.5e150Initial program 99.4%
Simplified99.4%
Taylor expanded in x1 around 0 66.2%
if 4.5e150 < x1 Initial program 3.1%
Simplified3.1%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 97.3%
Final simplification74.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.18e+58)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 4.5e+150)
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.18e+58) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.18d+58)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 4.5d+150) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.18e+58) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 4.5e+150) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.18e+58: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 4.5e+150: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.18e+58) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 4.5e+150) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.18e+58) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 4.5e+150) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.18e+58], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+150], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.18 \cdot 10^{+58}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+150}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1.18000000000000003e58Initial program 13.6%
Simplified22.7%
Taylor expanded in x1 around 0 59.9%
Taylor expanded in x2 around 0 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x2 around inf 91.5%
if -1.18000000000000003e58 < x1 < 4.5e150Initial program 99.4%
Simplified99.4%
Taylor expanded in x1 around 0 66.2%
if 4.5e150 < x1 Initial program 3.1%
Simplified3.1%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 97.3%
Final simplification74.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.36e+58)
(+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(if (<= x1 4.5e+150)
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.36e+58) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 4.5e+150) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.36d+58)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else if (x1 <= 4.5d+150) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.36e+58) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 4.5e+150) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.36e+58: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) elif x1 <= 4.5e+150: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.36e+58) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); elseif (x1 <= 4.5e+150) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.36e+58) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); elseif (x1 <= 4.5e+150) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.36e+58], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+150], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.36 \cdot 10^{+58}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+150}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1.35999999999999997e58Initial program 13.6%
Simplified22.7%
Taylor expanded in x1 around 0 59.9%
Taylor expanded in x2 around 0 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x2 around 0 87.5%
if -1.35999999999999997e58 < x1 < 4.5e150Initial program 99.4%
Simplified99.4%
Taylor expanded in x1 around 0 66.2%
if 4.5e150 < x1 Initial program 3.1%
Simplified3.1%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 97.3%
Final simplification73.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -4.8e+54) (not (<= x1 1.35))) (* 8.0 (* x2 (* x1 x1))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) {
tmp = 8.0 * (x2 * (x1 * x1));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-4.8d+54)) .or. (.not. (x1 <= 1.35d0))) then
tmp = 8.0d0 * (x2 * (x1 * x1))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) {
tmp = 8.0 * (x2 * (x1 * x1));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.8e+54) or not (x1 <= 1.35): tmp = 8.0 * (x2 * (x1 * x1)) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) tmp = Float64(8.0 * Float64(x2 * Float64(x1 * x1))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.8e+54) || ~((x1 <= 1.35))) tmp = 8.0 * (x2 * (x1 * x1)); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.8e+54], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(8.0 * N[(x2 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+54} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;8 \cdot \left(x2 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -4.79999999999999997e54 or 1.3500000000000001 < x1 Initial program 38.8%
Simplified41.5%
Taylor expanded in x1 around -inf 95.0%
Taylor expanded in x2 around inf 35.2%
pow235.2%
Applied egg-rr35.2%
if -4.79999999999999997e54 < x1 < 1.3500000000000001Initial program 99.3%
Simplified86.7%
Taylor expanded in x1 around 0 63.6%
Taylor expanded in x2 around 0 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in x1 around 0 64.9%
*-commutative64.9%
Simplified64.9%
Final simplification51.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -4.8e+54) (not (<= x1 1.35))) (* 8.0 (* x2 (* x1 x1))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) {
tmp = 8.0 * (x2 * (x1 * x1));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-4.8d+54)) .or. (.not. (x1 <= 1.35d0))) then
tmp = 8.0d0 * (x2 * (x1 * x1))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) {
tmp = 8.0 * (x2 * (x1 * x1));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.8e+54) or not (x1 <= 1.35): tmp = 8.0 * (x2 * (x1 * x1)) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.8e+54) || !(x1 <= 1.35)) tmp = Float64(8.0 * Float64(x2 * Float64(x1 * x1))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.8e+54) || ~((x1 <= 1.35))) tmp = 8.0 * (x2 * (x1 * x1)); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.8e+54], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(8.0 * N[(x2 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+54} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;8 \cdot \left(x2 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -4.79999999999999997e54 or 1.3500000000000001 < x1 Initial program 38.8%
Simplified41.5%
Taylor expanded in x1 around -inf 95.0%
Taylor expanded in x2 around inf 35.2%
pow235.2%
Applied egg-rr35.2%
if -4.79999999999999997e54 < x1 < 1.3500000000000001Initial program 99.3%
Simplified86.7%
Taylor expanded in x1 around 0 63.6%
Taylor expanded in x2 around 0 66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in x1 around 0 64.9%
*-commutative64.9%
neg-mul-164.9%
unsub-neg64.9%
Simplified64.9%
Final simplification51.8%
(FPCore (x1 x2) :precision binary64 (if (<= x2 1.7e+104) (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))) (* 8.0 (* x2 (* x1 x1)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= 1.7e+104) {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
} else {
tmp = 8.0 * (x2 * (x1 * x1));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= 1.7d+104) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
else
tmp = 8.0d0 * (x2 * (x1 * x1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= 1.7e+104) {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
} else {
tmp = 8.0 * (x2 * (x1 * x1));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= 1.7e+104: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) else: tmp = 8.0 * (x2 * (x1 * x1)) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= 1.7e+104) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); else tmp = Float64(8.0 * Float64(x2 * Float64(x1 * x1))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= 1.7e+104) tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); else tmp = 8.0 * (x2 * (x1 * x1)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, 1.7e+104], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(8.0 * N[(x2 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq 1.7 \cdot 10^{+104}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;8 \cdot \left(x2 \cdot \left(x1 \cdot x1\right)\right)\\
\end{array}
\end{array}
if x2 < 1.6999999999999998e104Initial program 73.2%
Simplified70.8%
Taylor expanded in x1 around 0 54.3%
Taylor expanded in x2 around 0 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in x1 around 0 70.6%
if 1.6999999999999998e104 < x2 Initial program 70.1%
Simplified48.7%
Taylor expanded in x1 around -inf 45.4%
Taylor expanded in x2 around inf 42.1%
pow242.1%
Applied egg-rr42.1%
Final simplification65.3%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 72.6%
Simplified66.7%
Taylor expanded in x1 around 0 45.9%
Taylor expanded in x2 around 0 52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in x1 around 0 37.6%
*-commutative37.6%
neg-mul-137.6%
unsub-neg37.6%
Simplified37.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 72.6%
Simplified66.7%
Taylor expanded in x1 around 0 45.9%
Taylor expanded in x2 around 0 52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in x2 around inf 27.0%
*-commutative27.0%
Simplified27.0%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 72.6%
Simplified72.6%
Taylor expanded in x1 around 0 26.8%
*-commutative26.8%
Simplified26.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 72.6%
Simplified66.7%
Taylor expanded in x1 around 0 45.9%
Taylor expanded in x2 around 0 52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in x2 around inf 27.0%
*-commutative27.0%
Simplified27.0%
Taylor expanded in x1 around inf 3.2%
herbie shell --seed 2024188
(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))))))