
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1)))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
Simplified99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 42.9%
Taylor expanded in x1 around inf 97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification98.9%
(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
(-
(/ (fma 3.0 (pow x1 2.0) (* 2.0 x2)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))
6.0)))))))))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((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 * ((fma(3.0, pow(x1, 2.0), (2.0 * x2)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))) - 6.0))))))));
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(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(Float64(fma(3.0, (x1 ^ 2.0), Float64(2.0 * x2)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0)))) - 6.0))))))))); else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(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[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_1 \cdot t\_3\\
t_5 := \left(\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 \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
fma-define99.3%
div-sub99.3%
*-commutative99.3%
*-commutative99.3%
fma-undefine99.3%
fma-undefine99.3%
associate-*r*99.4%
*-commutative99.4%
fma-define99.4%
pow299.4%
Applied egg-rr99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 42.9%
Taylor expanded in x1 around inf 97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* (* x1 2.0) t_3))
(t_5 (* t_1 t_3))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_7 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+ (+ x1 (+ (+ (* t_2 (+ (* t_4 (- t_3 3.0)) t_6)) t_5) t_0)) t_7))
INFINITY)
(+
x1
(+
t_7
(+
x1
(+
t_0
(+
t_5
(*
t_2
(+
t_6
(*
t_4
(-
(/
1.0
(/ (fma x1 x1 1.0) (fma 3.0 (pow x1 2.0) (- (* 2.0 x2) x1))))
3.0)))))))))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = t_1 * t_3;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((t_4 * (t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= ((double) INFINITY)) {
tmp = x1 + (t_7 + (x1 + (t_0 + (t_5 + (t_2 * (t_6 + (t_4 * ((1.0 / (fma(x1, x1, 1.0) / fma(3.0, pow(x1, 2.0), ((2.0 * x2) - x1)))) - 3.0))))))));
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(x1 * 2.0) * t_3) t_5 = Float64(t_1 * t_3) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_7 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(t_4 * Float64(t_3 - 3.0)) + t_6)) + t_5) + t_0)) + t_7)) <= Inf) tmp = Float64(x1 + Float64(t_7 + Float64(x1 + Float64(t_0 + Float64(t_5 + Float64(t_2 * Float64(t_6 + Float64(t_4 * Float64(Float64(1.0 / Float64(fma(x1, x1, 1.0) / fma(3.0, (x1 ^ 2.0), Float64(Float64(2.0 * x2) - x1)))) - 3.0))))))))); else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(t$95$4 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$7 + N[(x1 + N[(t$95$0 + N[(t$95$5 + N[(t$95$2 * N[(t$95$6 + N[(t$95$4 * N[(N[(1.0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \left(x1 \cdot 2\right) \cdot t\_3\\
t_5 := t\_1 \cdot t\_3\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_7 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(t\_4 \cdot \left(t\_3 - 3\right) + t\_6\right) + t\_5\right) + t\_0\right)\right) + t\_7\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_7 + \left(x1 + \left(t\_0 + \left(t\_5 + t\_2 \cdot \left(t\_6 + t\_4 \cdot \left(\frac{1}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{\mathsf{fma}\left(3, {x1}^{2}, 2 \cdot x2 - x1\right)}} - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
fma-define99.3%
*-commutative99.3%
fma-define99.3%
clear-num99.3%
inv-pow99.3%
*-commutative99.3%
fma-define99.3%
associate--l+99.3%
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 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 42.9%
Taylor expanded in x1 around inf 97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (Math.pow(x1, 4.0) * (6.0 + (3.0 / x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (math.pow(x1, 4.0) * (6.0 + (3.0 / x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 ^ 4.0) * (6.0 + (3.0 / x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 42.9%
Taylor expanded in x1 around inf 97.2%
associate-*r/97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5e+102) (not (<= x1 7e+70)))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 7e+70)) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 7d+70))) then
tmp = x1 + ((x1 ** 4.0d0) * (6.0d0 + (3.0d0 / x1)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 7e+70)) {
tmp = x1 + (Math.pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5e+102) or not (x1 <= 7e+70): tmp = x1 + (math.pow(x1, 4.0) * (6.0 + (3.0 / x1))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5e+102) || !(x1 <= 7e+70)) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5e+102) || ~((x1 <= 7e+70))) tmp = x1 + ((x1 ^ 4.0) * (6.0 + (3.0 / x1))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 7e+70]], $MachinePrecision]], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 7 \cdot 10^{+70}\right):\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102 or 7.00000000000000005e70 < x1 Initial program 24.4%
Taylor expanded in x1 around 0 21.1%
Taylor expanded in x1 around inf 53.3%
Taylor expanded in x1 around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if -5e102 < x1 < 7.00000000000000005e70Initial program 98.1%
Taylor expanded in x1 around inf 96.6%
Final simplification97.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -8.5e+66) (not (<= x1 1.12e+70)))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* (* x1 2.0) t_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 <= -8.5e+66) || !(x1 <= 1.12e+70)) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_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 <= (-8.5d+66)) .or. (.not. (x1 <= 1.12d+70))) then
tmp = x1 + ((x1 ** 4.0d0) * (6.0d0 + (3.0d0 / x1)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_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 <= -8.5e+66) || !(x1 <= 1.12e+70)) {
tmp = x1 + (Math.pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_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 <= -8.5e+66) or not (x1 <= 1.12e+70): tmp = x1 + (math.pow(x1, 4.0) * (6.0 + (3.0 / x1))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_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 <= -8.5e+66) || !(x1 <= 1.12e+70)) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); 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 <= -8.5e+66) || ~((x1 <= 1.12e+70))) tmp = x1 + ((x1 ^ 4.0) * (6.0 + (3.0 / x1))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_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, -8.5e+66], N[Not[LessEqual[x1, 1.12e+70]], $MachinePrecision]], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\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 -8.5 \cdot 10^{+66} \lor \neg \left(x1 \leq 1.12 \cdot 10^{+70}\right):\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -8.5000000000000004e66 or 1.11999999999999993e70 < x1 Initial program 31.3%
Taylor expanded in x1 around 0 28.3%
Taylor expanded in x1 around inf 56.6%
Taylor expanded in x1 around inf 98.0%
associate-*r/98.0%
metadata-eval98.0%
Simplified98.0%
if -8.5000000000000004e66 < x1 < 1.11999999999999993e70Initial program 98.0%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around inf 95.0%
Final simplification96.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -9e+66) (not (<= x1 1.25e+70)))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ 3.0 x1))))
(+
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 <= -9e+66) || !(x1 <= 1.25e+70)) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} 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 <= (-9d+66)) .or. (.not. (x1 <= 1.25d+70))) then
tmp = x1 + ((x1 ** 4.0d0) * (6.0d0 + (3.0d0 / x1)))
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 <= -9e+66) || !(x1 <= 1.25e+70)) {
tmp = x1 + (Math.pow(x1, 4.0) * (6.0 + (3.0 / x1)));
} 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 <= -9e+66) or not (x1 <= 1.25e+70): tmp = x1 + (math.pow(x1, 4.0) * (6.0 + (3.0 / x1))) 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 <= -9e+66) || !(x1 <= 1.25e+70)) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(3.0 / x1)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_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 <= -9e+66) || ~((x1 <= 1.25e+70))) tmp = x1 + ((x1 ^ 4.0) * (6.0 + (3.0 / x1))); 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, -9e+66], N[Not[LessEqual[x1, 1.25e+70]], $MachinePrecision]], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$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 -9 \cdot 10^{+66} \lor \neg \left(x1 \leq 1.25 \cdot 10^{+70}\right):\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{3}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_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 < -8.9999999999999997e66 or 1.2500000000000001e70 < x1 Initial program 31.3%
Taylor expanded in x1 around 0 28.3%
Taylor expanded in x1 around inf 56.6%
Taylor expanded in x1 around inf 98.0%
associate-*r/98.0%
metadata-eval98.0%
Simplified98.0%
if -8.9999999999999997e66 < x1 < 1.2500000000000001e70Initial program 98.0%
Taylor expanded in x1 around inf 95.0%
Final simplification96.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* 2.0 x2)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 4.0 (* x2 t_1)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- (+ t_3 (* 2.0 x2)) x1) t_5)))
(if (<= x1 -1.05e+218)
t_2
(if (<= x1 -5.6e+102)
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
t_4
(*
x1
(-
(+
(* 2.0 (+ (* x2 -2.0) t_0))
(+
(* 3.0 (- 3.0 (* x2 -2.0)))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_4
(*
2.0
(+
(+
1.0
(+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_1)))
(* 2.0 (* x2 t_0)))))
3.0))))))
6.0)))
2.0))))
(if (<= x1 1e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_5))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_3)
(*
t_5
(+ (* (* (* x1 2.0) t_6) (- t_6 3.0)) (* (* x1 x1) 6.0))))))))
t_2)))))
double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = 4.0 * (x2 * t_1);
double t_5 = (x1 * x1) + 1.0;
double t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5;
double tmp;
if (x1 <= -1.05e+218) {
tmp = t_2;
} else if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_4 + (x1 * (((2.0 * ((x2 * -2.0) + t_0)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_1))) + (2.0 * (x2 * t_0))))) - 3.0)))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_5 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = 3.0d0 - (2.0d0 * x2)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_3 = x1 * (x1 * 3.0d0)
t_4 = 4.0d0 * (x2 * t_1)
t_5 = (x1 * x1) + 1.0d0
t_6 = ((t_3 + (2.0d0 * x2)) - x1) / t_5
if (x1 <= (-1.05d+218)) then
tmp = t_2
else if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((t_4 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) + t_0)) + ((3.0d0 * (3.0d0 - (x2 * (-2.0d0)))) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_4 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_1))) + (2.0d0 * (x2 * t_0))))) - 3.0d0)))))) - 6.0d0))) - 2.0d0)))
else if (x1 <= 1d+153) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_5)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_3) + (t_5 * ((((x1 * 2.0d0) * t_6) * (t_6 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 - (2.0 * x2);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = 4.0 * (x2 * t_1);
double t_5 = (x1 * x1) + 1.0;
double t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5;
double tmp;
if (x1 <= -1.05e+218) {
tmp = t_2;
} else if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_4 + (x1 * (((2.0 * ((x2 * -2.0) + t_0)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_1))) + (2.0 * (x2 * t_0))))) - 3.0)))))) - 6.0))) - 2.0)));
} else if (x1 <= 1e+153) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_5 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (2.0 * x2) t_1 = (2.0 * x2) - 3.0 t_2 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_3 = x1 * (x1 * 3.0) t_4 = 4.0 * (x2 * t_1) t_5 = (x1 * x1) + 1.0 t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5 tmp = 0 if x1 <= -1.05e+218: tmp = t_2 elif x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((t_4 + (x1 * (((2.0 * ((x2 * -2.0) + t_0)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_1))) + (2.0 * (x2 * t_0))))) - 3.0)))))) - 6.0))) - 2.0))) elif x1 <= 1e+153: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_5 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(2.0 * x2)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(4.0 * Float64(x2 * t_1)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_5) tmp = 0.0 if (x1 <= -1.05e+218) tmp = t_2; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_4 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + t_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(t_4 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_1))) + Float64(2.0 * Float64(x2 * t_0))))) - 3.0)))))) - 6.0))) - 2.0)))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_5)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_3) + Float64(t_5 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(t_6 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (2.0 * x2); t_1 = (2.0 * x2) - 3.0; t_2 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_3 = x1 * (x1 * 3.0); t_4 = 4.0 * (x2 * t_1); t_5 = (x1 * x1) + 1.0; t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5; tmp = 0.0; if (x1 <= -1.05e+218) tmp = t_2; elseif (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((t_4 + (x1 * (((2.0 * ((x2 * -2.0) + t_0)) + ((3.0 * (3.0 - (x2 * -2.0))) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_1))) + (2.0 * (x2 * t_0))))) - 3.0)))))) - 6.0))) - 2.0))); elseif (x1 <= 1e+153) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_5 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]}, If[LessEqual[x1, -1.05e+218], t$95$2, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$4 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + t$95$0), $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[(t$95$4 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $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$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$3), $MachinePrecision] + N[(t$95$5 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(t$95$6 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - 2 \cdot x2\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 4 \cdot \left(x2 \cdot t\_1\right)\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_5}\\
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{+218}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(t\_4 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 + t\_0\right) + \left(3 \cdot \left(3 - x2 \cdot -2\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_1\right)\right) + 2 \cdot \left(x2 \cdot t\_0\right)\right)\right) - 3\right)\right)\right)\right)\right) - 6\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_5} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_3 + t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(t\_6 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -1.0499999999999999e218 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1.0499999999999999e218 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 93.3%
if -5.60000000000000037e102 < x1 < 1e153Initial program 98.3%
Taylor expanded in x1 around inf 94.8%
Taylor expanded in x1 around inf 94.8%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (* 4.0 (* x2 t_2)))
(t_4 (* x1 (* x1 3.0)))
(t_5 (* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_0)))
(t_6 (/ (- (+ t_4 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -4.5e+153)
t_1
(if (<= x1 -5.6e+102)
(+
x1
(+
t_5
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* t_2 -2.0)
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_3
(* 2.0 (+ (* 3.0 t_2) (* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 1e+153)
(+
x1
(+
t_5
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_4)
(*
t_0
(+ (* (* (* x1 2.0) t_6) (- t_6 3.0)) (* (* x1 x1) 6.0))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = (2.0 * x2) - 3.0;
double t_3 = 4.0 * (x2 * t_2);
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0);
double t_6 = ((t_4 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((t_2 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((3.0 * t_2) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = 4.0d0 * (x2 * t_2)
t_4 = x1 * (x1 * 3.0d0)
t_5 = 3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_0)
t_6 = ((t_4 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-4.5d+153)) then
tmp = t_1
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((t_2 * (-2.0d0)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * ((3.0d0 * t_2) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_4) + (t_0 * ((((x1 * 2.0d0) * t_6) * (t_6 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = (2.0 * x2) - 3.0;
double t_3 = 4.0 * (x2 * t_2);
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0);
double t_6 = ((t_4 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((t_2 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((3.0 * t_2) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_2 = (2.0 * x2) - 3.0 t_3 = 4.0 * (x2 * t_2) t_4 = x1 * (x1 * 3.0) t_5 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0) t_6 = ((t_4 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -4.5e+153: tmp = t_1 elif x1 <= -5.6e+102: tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((t_2 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((3.0 * t_2) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= 1e+153: tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(4.0 * Float64(x2 * t_2)) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_0)) t_6 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(t_2 * -2.0) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(Float64(3.0 * t_2) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_4) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(t_6 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_2 = (2.0 * x2) - 3.0; t_3 = 4.0 * (x2 * t_2); t_4 = x1 * (x1 * 3.0); t_5 = 3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0); t_6 = ((t_4 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5.6e+102) tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((t_2 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((3.0 * t_2) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= 1e+153) tmp = x1 + (t_5 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x2 * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$1, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(t$95$2 * -2.0), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$5 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(t$95$6 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_2 := 2 \cdot x2 - 3\\
t_3 := 4 \cdot \left(x2 \cdot t\_2\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := 3 \cdot \frac{\left(t\_4 - 2 \cdot x2\right) - x1}{t\_0}\\
t_6 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(t\_2 \cdot -2 + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(3 \cdot t\_2 + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_4 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(t\_6 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 83.3%
if -5.60000000000000037e102 < x1 < 1e153Initial program 98.3%
Taylor expanded in x1 around inf 94.8%
Taylor expanded in x1 around inf 94.8%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_3 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_4 (- (* 2.0 x2) 3.0))
(t_5 (* 4.0 (* x2 t_4))))
(if (<= x1 -4.5e+153)
t_3
(if (<= x1 -4.2e+102)
(+
x1
(+
t_2
(+
x1
(*
x1
(+
t_5
(*
x1
(-
(+
(* t_4 -2.0)
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_5
(* 2.0 (+ (* 3.0 t_4) (* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 1e+153)
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
(* t_4 (* (* x1 2.0) (* 2.0 x2))))))))))
t_3)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_4 = (2.0 * x2) - 3.0;
double t_5 = 4.0 * (x2 * t_4);
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_3;
} else if (x1 <= -4.2e+102) {
tmp = x1 + (t_2 + (x1 + (x1 * (t_5 + (x1 * (((t_4 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((3.0 * t_4) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (t_4 * ((x1 * 2.0) * (2.0 * x2)))))))));
} else {
tmp = t_3;
}
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 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_3 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_4 = (2.0d0 * x2) - 3.0d0
t_5 = 4.0d0 * (x2 * t_4)
if (x1 <= (-4.5d+153)) then
tmp = t_3
else if (x1 <= (-4.2d+102)) then
tmp = x1 + (t_2 + (x1 + (x1 * (t_5 + (x1 * (((t_4 * (-2.0d0)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_5 + (2.0d0 * ((3.0d0 * t_4) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + (t_4 * ((x1 * 2.0d0) * (2.0d0 * x2)))))))))
else
tmp = t_3
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 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_4 = (2.0 * x2) - 3.0;
double t_5 = 4.0 * (x2 * t_4);
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_3;
} else if (x1 <= -4.2e+102) {
tmp = x1 + (t_2 + (x1 + (x1 * (t_5 + (x1 * (((t_4 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((3.0 * t_4) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (t_4 * ((x1 * 2.0) * (2.0 * x2)))))))));
} else {
tmp = t_3;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_3 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_4 = (2.0 * x2) - 3.0 t_5 = 4.0 * (x2 * t_4) tmp = 0 if x1 <= -4.5e+153: tmp = t_3 elif x1 <= -4.2e+102: tmp = x1 + (t_2 + (x1 + (x1 * (t_5 + (x1 * (((t_4 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((3.0 * t_4) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= 1e+153: tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (t_4 * ((x1 * 2.0) * (2.0 * x2))))))))) else: tmp = t_3 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(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_3 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_4 = Float64(Float64(2.0 * x2) - 3.0) t_5 = Float64(4.0 * Float64(x2 * t_4)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_3; elseif (x1 <= -4.2e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(x1 * Float64(t_5 + Float64(x1 * Float64(Float64(Float64(t_4 * -2.0) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_5 + Float64(2.0 * Float64(Float64(3.0 * t_4) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + Float64(t_4 * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))))))))); else tmp = t_3; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_3 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_4 = (2.0 * x2) - 3.0; t_5 = 4.0 * (x2 * t_4); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_3; elseif (x1 <= -4.2e+102) tmp = x1 + (t_2 + (x1 + (x1 * (t_5 + (x1 * (((t_4 * -2.0) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((3.0 * t_4) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= 1e+153) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (t_4 * ((x1 * 2.0) * (2.0 * x2))))))))); else tmp = t_3; 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[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * N[(x2 * t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$3, If[LessEqual[x1, -4.2e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(x1 * N[(t$95$5 + N[(x1 * N[(N[(N[(t$95$4 * -2.0), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(2.0 * N[(N[(3.0 * t$95$4), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_4 := 2 \cdot x2 - 3\\
t_5 := 4 \cdot \left(x2 \cdot t\_4\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(t\_5 + x1 \cdot \left(\left(t\_4 \cdot -2 + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_5 + 2 \cdot \left(3 \cdot t\_4 + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right) + t\_4 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 64.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -4.20000000000000003e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 83.3%
if -4.20000000000000003e102 < x1 < 1e153Initial program 98.3%
Taylor expanded in x1 around 0 89.9%
Taylor expanded in x1 around 0 90.8%
Taylor expanded in x1 around inf 90.8%
Final simplification92.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (or (<= x1 -2.1e+101) (not (<= x1 1e+153)))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
(* (- (* 2.0 x2) 3.0) (* (* x1 2.0) (* 2.0 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
if ((x1 <= (-2.1d+101)) .or. (.not. (x1 <= 1d+153))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + (((2.0d0 * x2) - 3.0d0) * ((x1 * 2.0d0) * (2.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 tmp;
if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if (x1 <= -2.1e+101) or not (x1 <= 1e+153): tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.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(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + Float64(Float64(Float64(2.0 * x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if ((x1 <= -2.1e+101) || ~((x1 <= 1e+153))) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.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]}, If[Or[LessEqual[x1, -2.1e+101], N[Not[LessEqual[x1, 1e+153]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $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\\
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+101} \lor \neg \left(x1 \leq 10^{+153}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right) + \left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.1e101 or 1e153 < x1 Initial program 1.4%
Taylor expanded in x1 around 0 1.4%
Taylor expanded in x1 around 0 59.8%
Taylor expanded in x2 around 0 90.6%
*-commutative90.6%
Simplified90.6%
if -2.1e101 < x1 < 1e153Initial program 98.3%
Taylor expanded in x1 around 0 90.4%
Taylor expanded in x1 around 0 91.3%
Taylor expanded in x1 around inf 91.3%
Final simplification91.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (or (<= x1 -2.1e+101) (not (<= x1 1e+153)))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(*
t_1
(+
(* (* x1 x1) 6.0)
(* (- (* 2.0 x2) 3.0) (* (* x1 2.0) (* 2.0 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (((x1 * x1) * 6.0) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
if ((x1 <= (-2.1d+101)) .or. (.not. (x1 <= 1d+153))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) + (t_1 * (((x1 * x1) * 6.0d0) + (((2.0d0 * x2) - 3.0d0) * ((x1 * 2.0d0) * (2.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 tmp;
if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (((x1 * x1) * 6.0) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2)))))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if (x1 <= -2.1e+101) or not (x1 <= 1e+153): tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (((x1 * x1) * 6.0) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.0 * x2))))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if ((x1 <= -2.1e+101) || !(x1 <= 1e+153)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.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 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(2.0 * x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(2.0 * x2)))))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if ((x1 <= -2.1e+101) || ~((x1 <= 1e+153))) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (((x1 * x1) * 6.0) + (((2.0 * x2) - 3.0) * ((x1 * 2.0) * (2.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]}, If[Or[LessEqual[x1, -2.1e+101], N[Not[LessEqual[x1, 1e+153]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(2.0 * x2), $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\\
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+101} \lor \neg \left(x1 \leq 10^{+153}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.1e101 or 1e153 < x1 Initial program 1.4%
Taylor expanded in x1 around 0 1.4%
Taylor expanded in x1 around 0 59.8%
Taylor expanded in x2 around 0 90.6%
*-commutative90.6%
Simplified90.6%
if -2.1e101 < x1 < 1e153Initial program 98.3%
Taylor expanded in x1 around 0 90.4%
Taylor expanded in x1 around 0 91.3%
Taylor expanded in x1 around inf 91.1%
Final simplification91.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -2.05e+87)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -6.2e-235)
t_0
(if (<= x1 1.4e-256)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 3.9e+39)
t_0
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0)))))
2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -2.05e+87) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -6.2e-235) {
tmp = t_0;
} else if (x1 <= 1.4e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.9e+39) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-2.05d+87)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= (-6.2d-235)) then
tmp = t_0
else if (x1 <= 1.4d-256) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 3.9d+39) then
tmp = t_0
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -2.05e+87) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -6.2e-235) {
tmp = t_0;
} else if (x1 <= 1.4e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.9e+39) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -2.05e+87: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= -6.2e-235: tmp = t_0 elif x1 <= 1.4e-256: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 3.9e+39: tmp = t_0 else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -2.05e+87) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= -6.2e-235) tmp = t_0; elseif (x1 <= 1.4e-256) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 3.9e+39) tmp = t_0; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -2.05e+87) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= -6.2e-235) tmp = t_0; elseif (x1 <= 1.4e-256) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 3.9e+39) tmp = t_0; else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = 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]}, If[LessEqual[x1, -2.05e+87], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6.2e-235], t$95$0, If[LessEqual[x1, 1.4e-256], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+39], t$95$0, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+87}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-235}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{-256}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+39}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.05e87Initial program 11.9%
Taylor expanded in x1 around 0 11.9%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x2 around 0 75.5%
*-commutative75.5%
Simplified75.5%
if -2.05e87 < x1 < -6.2e-235 or 1.40000000000000012e-256 < x1 < 3.9000000000000001e39Initial program 97.6%
Taylor expanded in x1 around 0 77.1%
Taylor expanded in x1 around 0 77.0%
if -6.2e-235 < x1 < 1.40000000000000012e-256Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around 0 99.3%
if 3.9000000000000001e39 < x1 Initial program 50.7%
Taylor expanded in x1 around 0 44.6%
Taylor expanded in x1 around inf 87.6%
Taylor expanded in x1 around 0 74.4%
Final simplification78.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -7.2e+166)
(+ x1 (+ (* x2 -6.0) t_0))
(if (<= x1 1.45e-139)
(+
x1
(+
t_0
(* x2 (- (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))) 6.0))))
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))))
2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -7.2e+166) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else if (x1 <= 1.45e-139) {
tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0)))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-7.2d+166)) then
tmp = x1 + ((x2 * (-6.0d0)) + t_0)
else if (x1 <= 1.45d-139) then
tmp = x1 + (t_0 + (x2 * (((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0))) - 6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0))))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -7.2e+166) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else if (x1 <= 1.45e-139) {
tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0)))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -7.2e+166: tmp = x1 + ((x2 * -6.0) + t_0) elif x1 <= 1.45e-139: tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0)))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -7.2e+166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + t_0)); elseif (x1 <= 1.45e-139) tmp = Float64(x1 + Float64(t_0 + Float64(x2 * Float64(Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0))) - 6.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0)))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -7.2e+166) tmp = x1 + ((x2 * -6.0) + t_0); elseif (x1 <= 1.45e-139) tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0)))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.2e+166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.45e-139], N[(x1 + N[(t$95$0 + N[(x2 * N[(N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{+166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + t\_0\right)\\
\mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-139}:\\
\;\;\;\;x1 + \left(t\_0 + x2 \cdot \left(\left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right) - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -7.1999999999999994e166Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -7.1999999999999994e166 < x1 < 1.4499999999999999e-139Initial program 92.0%
Taylor expanded in x1 around 0 88.3%
Taylor expanded in x1 around 0 71.2%
Taylor expanded in x2 around inf 74.2%
Taylor expanded in x2 around 0 83.7%
if 1.4499999999999999e-139 < x1 Initial program 69.8%
Taylor expanded in x1 around 0 40.8%
Taylor expanded in x1 around 0 75.5%
Final simplification82.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
(if (<= x1 -1.5e+88)
t_1
(if (<= x1 -1.08e-237)
t_0
(if (<= x1 1.4e-256)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.5e+153) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double tmp;
if (x1 <= -1.5e+88) {
tmp = t_1;
} else if (x1 <= -1.08e-237) {
tmp = t_0;
} else if (x1 <= 1.4e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
if (x1 <= (-1.5d+88)) then
tmp = t_1
else if (x1 <= (-1.08d-237)) then
tmp = t_0
else if (x1 <= 1.4d-256) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double tmp;
if (x1 <= -1.5e+88) {
tmp = t_1;
} else if (x1 <= -1.08e-237) {
tmp = t_0;
} else if (x1 <= 1.4e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) tmp = 0 if x1 <= -1.5e+88: tmp = t_1 elif x1 <= -1.08e-237: tmp = t_0 elif x1 <= 1.4e-256: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.5e+153: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) tmp = 0.0 if (x1 <= -1.5e+88) tmp = t_1; elseif (x1 <= -1.08e-237) tmp = t_0; elseif (x1 <= 1.4e-256) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); tmp = 0.0; if (x1 <= -1.5e+88) tmp = t_1; elseif (x1 <= -1.08e-237) tmp = t_0; elseif (x1 <= 1.4e-256) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.5e+88], t$95$1, If[LessEqual[x1, -1.08e-237], t$95$0, If[LessEqual[x1, 1.4e-256], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.5 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -1.08 \cdot 10^{-237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{-256}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.50000000000000003e88 or 4.5000000000000001e153 < x1 Initial program 6.8%
Taylor expanded in x1 around 0 6.8%
Taylor expanded in x1 around 0 56.8%
Taylor expanded in x2 around 0 85.9%
*-commutative85.9%
Simplified85.9%
if -1.50000000000000003e88 < x1 < -1.07999999999999996e-237 or 1.40000000000000012e-256 < x1 < 4.5000000000000001e153Initial program 98.0%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x1 around 0 68.8%
if -1.07999999999999996e-237 < x1 < 1.40000000000000012e-256Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x1 around inf 99.3%
Taylor expanded in x1 around 0 99.3%
Final simplification76.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -7.2e+166)
(+ x1 (+ (* x2 -6.0) t_0))
(if (<= x1 3.9e+39)
(+
x1
(+
t_0
(* x2 (- (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0))) 6.0))))
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -7.2e+166) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else if (x1 <= 3.9e+39) {
tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) - 2.0d0)
if (x1 <= (-7.2d+166)) then
tmp = x1 + ((x2 * (-6.0d0)) + t_0)
else if (x1 <= 3.9d+39) then
tmp = x1 + (t_0 + (x2 * (((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0))) - 6.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) - 2.0);
double tmp;
if (x1 <= -7.2e+166) {
tmp = x1 + ((x2 * -6.0) + t_0);
} else if (x1 <= 3.9e+39) {
tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) - 2.0) tmp = 0 if x1 <= -7.2e+166: tmp = x1 + ((x2 * -6.0) + t_0) elif x1 <= 3.9e+39: tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)) tmp = 0.0 if (x1 <= -7.2e+166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + t_0)); elseif (x1 <= 3.9e+39) tmp = Float64(x1 + Float64(t_0 + Float64(x2 * Float64(Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0))) - 6.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) - 2.0); tmp = 0.0; if (x1 <= -7.2e+166) tmp = x1 + ((x2 * -6.0) + t_0); elseif (x1 <= 3.9e+39) tmp = x1 + (t_0 + (x2 * (((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))) - 6.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.2e+166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e+39], N[(x1 + N[(t$95$0 + N[(x2 * N[(N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 - 2\right)\\
\mathbf{if}\;x1 \leq -7.2 \cdot 10^{+166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + t\_0\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+39}:\\
\;\;\;\;x1 + \left(t\_0 + x2 \cdot \left(\left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right) - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -7.1999999999999994e166Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -7.1999999999999994e166 < x1 < 3.9000000000000001e39Initial program 93.8%
Taylor expanded in x1 around 0 89.5%
Taylor expanded in x1 around 0 72.0%
Taylor expanded in x2 around inf 74.3%
Taylor expanded in x2 around 0 81.4%
if 3.9000000000000001e39 < x1 Initial program 50.7%
Taylor expanded in x1 around 0 44.6%
Taylor expanded in x1 around inf 87.6%
Taylor expanded in x1 around 0 74.4%
Final simplification81.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x2 -1.42e+166)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(if (<= x2 1e-230)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 3.0 (* x1 (- 3.0 (* x2 -2.0)))) 2.0)))))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.42e+166) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else if (x2 <= 1e-230) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((3.0 * (x1 * (3.0 - (x2 * -2.0)))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-1.42d+166)) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else if (x2 <= 1d-230) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.42e+166) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else if (x2 <= 1e-230) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((3.0 * (x1 * (3.0 - (x2 * -2.0)))) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.42e+166: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) elif x2 <= 1e-230: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((3.0 * (x1 * (3.0 - (x2 * -2.0)))) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.42e+166) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); elseif (x2 <= 1e-230) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.42e+166) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); elseif (x2 <= 1e-230) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((3.0 * (x1 * (3.0 - (x2 * -2.0)))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.42e+166], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 1e-230], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.42 \cdot 10^{+166}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{elif}\;x2 \leq 10^{-230}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1.41999999999999995e166Initial program 71.8%
Taylor expanded in x1 around 0 45.0%
Taylor expanded in x1 around inf 66.9%
if -1.41999999999999995e166 < x2 < 1.00000000000000005e-230Initial program 75.0%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x1 around 0 62.2%
Taylor expanded in x2 around 0 67.4%
*-commutative67.4%
Simplified67.4%
if 1.00000000000000005e-230 < x2 Initial program 69.5%
Taylor expanded in x1 around 0 64.3%
Taylor expanded in x1 around inf 66.1%
Taylor expanded in x1 around 0 70.9%
Final simplification68.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.4e+166) (not (<= x2 3e+117))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.4e+166) || !(x2 <= 3e+117)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.4d+166)) .or. (.not. (x2 <= 3d+117))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.4e+166) || !(x2 <= 3e+117)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.4e+166) or not (x2 <= 3e+117): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.4e+166) || !(x2 <= 3e+117)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.4e+166) || ~((x2 <= 3e+117))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.4e+166], N[Not[LessEqual[x2, 3e+117]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.4 \cdot 10^{+166} \lor \neg \left(x2 \leq 3 \cdot 10^{+117}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -1.39999999999999998e166 or 3e117 < x2 Initial program 68.4%
Taylor expanded in x1 around 0 47.7%
Taylor expanded in x1 around inf 64.2%
if -1.39999999999999998e166 < x2 < 3e117Initial program 73.7%
Taylor expanded in x1 around 0 70.9%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 70.1%
*-commutative70.1%
Simplified70.1%
Final simplification68.4%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.4) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.4) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1.4d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x2 * ((x1 / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.4) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.4: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x2 * ((x1 / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.4) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.4) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x2 * ((x1 / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.4], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.4:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < 1.3999999999999999Initial program 77.8%
Taylor expanded in x1 around 0 74.8%
Taylor expanded in x1 around inf 59.3%
Taylor expanded in x1 around 0 53.0%
if 1.3999999999999999 < x1 Initial program 58.9%
Taylor expanded in x1 around 0 20.8%
Taylor expanded in x1 around 0 5.1%
*-commutative5.1%
Simplified5.1%
Taylor expanded in x2 around inf 21.2%
Final simplification43.6%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
def code(x1, x2): return x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)))
function code(x1, x2) return Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) end
function tmp = code(x1, x2) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end
code[x1_, x2_] := N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)
\end{array}
Initial program 72.2%
Taylor expanded in x1 around 0 67.9%
Taylor expanded in x1 around 0 64.7%
Taylor expanded in x2 around 0 61.9%
*-commutative61.9%
Simplified61.9%
Final simplification61.9%
(FPCore (x1 x2) :precision binary64 (* x2 (- (/ x1 x2) 6.0)))
double code(double x1, double x2) {
return x2 * ((x1 / x2) - 6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * ((x1 / x2) - 6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * ((x1 / x2) - 6.0);
}
def code(x1, x2): return x2 * ((x1 / x2) - 6.0)
function code(x1, x2) return Float64(x2 * Float64(Float64(x1 / x2) - 6.0)) end
function tmp = code(x1, x2) tmp = x2 * ((x1 / x2) - 6.0); end
code[x1_, x2_] := N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(\frac{x1}{x2} - 6\right)
\end{array}
Initial program 72.2%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 26.3%
*-commutative26.3%
Simplified26.3%
Taylor expanded in x2 around inf 31.1%
Final simplification31.1%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 72.2%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 26.3%
*-commutative26.3%
Simplified26.3%
Final simplification26.3%
(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.2%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 26.3%
*-commutative26.3%
Simplified26.3%
Taylor expanded in x1 around 0 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification26.2%
(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.2%
Taylor expanded in x1 around 0 50.0%
Taylor expanded in x1 around 0 26.3%
*-commutative26.3%
Simplified26.3%
Taylor expanded in x1 around inf 3.5%
Final simplification3.5%
herbie shell --seed 2024055
(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))))))