
(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 (* x1 (* x1 3.0)))
(t_1 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<= x1 -2e+154)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(+
(+ x1 (* (pow x1 4.0) 6.0))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 5.1e+140)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_1 4.0 -6.0))
(* t_1 (* (+ t_1 -3.0) (* x1 2.0))))
(fma t_0 t_1 (pow x1 3.0))))))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -2e+154) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((x1 + (pow(x1, 4.0) * 6.0)) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))));
} else if (x1 <= 5.1e+140) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_1, 4.0, -6.0)), (t_1 * ((t_1 + -3.0) * (x1 * 2.0)))), fma(t_0, t_1, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -2e+154) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * 6.0)) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))))); elseif (x1 <= 5.1e+140) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_1, 4.0, -6.0)), Float64(t_1 * Float64(Float64(t_1 + -3.0) * Float64(x1 * 2.0)))), fma(t_0, t_1, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+154], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.1e+140], N[(x1 + N[(3.0 * N[(N[(t$95$0 - 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$1 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(t$95$1 + -3.0), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$1 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $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 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\\
\mathbf{elif}\;x1 \leq 5.1 \cdot 10^{+140}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \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_1, 4, -6\right), t_1 \cdot \left(\left(t_1 + -3\right) \cdot \left(x1 \cdot 2\right)\right)\right), \mathsf{fma}\left(t_0, t_1, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -2.00000000000000007e154 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -9.4999999999999995e105 < x1 < 5.1e140Initial program 98.8%
Simplified99.1%
if 5.1e140 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 81.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x2 around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (fma x1 (* x1 3.0) (- (+ x2 x2) x1)) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 9.0)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -5e+153)
(+ x1 t_3)
(if (<= x1 -1.35e-101)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
t_3
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_0 (+ -3.0 t_0))) (* x1 (fma t_0 4.0 -6.0)))))))))
(if (<= x1 5.1e+140)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(*
(* x1 x1)
(-
(*
4.0
(-
(/ (fma (* x1 3.0) x1 (+ x2 x2)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))
6.0))))
(* t_1 t_4))
(* x1 (* x1 x1))))))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), ((x2 + x2) - x1)) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 9.0);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -5e+153) {
tmp = x1 + t_3;
} else if (x1 <= -1.35e-101) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (t_3 + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_0 * (-3.0 + t_0))) + (x1 * fma(t_0, 4.0, -6.0))))))));
} else if (x1 <= 5.1e+140) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (((t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (x2 + x2)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(x2 + 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(x1 * Float64(x1 * 9.0)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (x1 <= -5e+153) tmp = Float64(x1 + t_3); elseif (x1 <= -1.35e-101) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(t_3 + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_0 * Float64(-3.0 + t_0))) + Float64(x1 * fma(t_0, 4.0, -6.0))))))))); elseif (x1 <= 5.1e+140) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0)))) - 6.0)))) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(x2 + x2), $MachinePrecision] - x1), $MachinePrecision]), $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[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5e+153], N[(x1 + t$95$3), $MachinePrecision], If[LessEqual[x1, -1.35e-101], N[(x1 + N[(3.0 * N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$0 * N[(-3.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.1e+140], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + 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] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, \left(x2 + x2\right) - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 9\right)\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;x1 + t_3\\
\mathbf{elif}\;x1 \leq -1.35 \cdot 10^{-101}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, t_3 + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_0 \cdot \left(-3 + t_0\right)\right) + x1 \cdot \mathsf{fma}\left(t_0, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5.1 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\frac{\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) + t_1 \cdot t_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.00000000000000018e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -5.00000000000000018e153 < x1 < -1.3500000000000001e-101Initial program 78.8%
Simplified97.9%
Taylor expanded in x1 around inf 97.9%
*-commutative97.9%
Simplified97.9%
if -1.3500000000000001e-101 < x1 < 5.1e140Initial program 99.4%
fma-def99.4%
div-sub99.4%
fma-def99.4%
count-299.4%
Applied egg-rr99.4%
if 5.1e140 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 81.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x2 around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.2%
(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 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -2e+154)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+ x1 (+ (+ x1 (* (pow x1 4.0) 6.0)) t_2))
(if (<= x1 5.1e+140)
(+
x1
(+
t_2
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(*
(* x1 x1)
(-
(*
4.0
(-
(/ (fma (* x1 3.0) x1 (+ x2 x2)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))
6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2)))))))))))))
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 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -2e+154) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((x1 + (pow(x1, 4.0) * 6.0)) + t_2);
} else if (x1 <= 5.1e+140) {
tmp = x1 + (t_2 + (x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (x2 + x2)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -2e+154) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * 6.0)) + t_2)); elseif (x1 <= 5.1e+140) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0)))) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(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[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -2e+154], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.1e+140], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(N[(t$95$1 * 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[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + 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] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $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 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + t_2\right)\\
\mathbf{elif}\;x1 \leq 5.1 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(\left(t_1 \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(4 \cdot \left(\frac{\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -2.00000000000000007e154 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -9.4999999999999995e105 < x1 < 5.1e140Initial program 98.8%
fma-def98.8%
div-sub98.8%
fma-def98.8%
count-298.8%
Applied egg-rr98.8%
if 5.1e140 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 81.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x2 around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (/ (- t_2 x1) t_0))
(t_4 (/ (- x1 t_2) t_0))
(t_5
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(-
x1
(-
(+
(* t_1 t_4)
(*
t_0
(+
(* (* (* x1 2.0) t_3) (+ 3.0 t_4))
(* (* x1 x1) (- 6.0 (* 4.0 t_3))))))
(* x1 (* x1 x1))))))))
(if (<= t_5 INFINITY) t_5 (+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_0;
double t_4 = (x1 - t_2) / t_0;
double t_5 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_1 * t_4) + (t_0 * ((((x1 * 2.0) * t_3) * (3.0 + t_4)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
double tmp;
if (t_5 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (t_2 - x1) / t_0;
double t_4 = (x1 - t_2) / t_0;
double t_5 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_1 * t_4) + (t_0 * ((((x1 * 2.0) * t_3) * (3.0 + t_4)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
double tmp;
if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) t_3 = (t_2 - x1) / t_0 t_4 = (x1 - t_2) / t_0 t_5 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_1 * t_4) + (t_0 * ((((x1 * 2.0) * t_3) * (3.0 + t_4)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1))))) tmp = 0 if t_5 <= math.inf: tmp = t_5 else: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(Float64(t_2 - x1) / t_0) t_4 = Float64(Float64(x1 - t_2) / t_0) t_5 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 - Float64(Float64(Float64(t_1 * t_4) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_4)) + Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * t_3)))))) - Float64(x1 * Float64(x1 * x1)))))) tmp = 0.0 if (t_5 <= Inf) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); t_3 = (t_2 - x1) / t_0; t_4 = (x1 - t_2) / t_0; t_5 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 - (((t_1 * t_4) + (t_0 * ((((x1 * 2.0) * t_3) * (3.0 + t_4)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1))))); tmp = 0.0; if (t_5 <= Inf) tmp = t_5; else tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, Infinity], t$95$5, N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t_1 + 2 \cdot x2\\
t_3 := \frac{t_2 - x1}{t_0}\\
t_4 := \frac{x1 - t_2}{t_0}\\
t_5 := x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 - \left(\left(t_1 \cdot t_4 + t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(3 + t_4\right) + \left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t_3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{if}\;t_5 \leq \infty:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 1.3%
Taylor expanded in x1 around 0 53.4%
Taylor expanded in x2 around 0 63.6%
*-commutative63.6%
unpow263.6%
Simplified63.6%
Taylor expanded in x1 around inf 87.1%
*-commutative87.1%
unpow287.1%
associate-*r*87.1%
Simplified87.1%
Final simplification95.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- t_1 x1) t_2))
(t_4 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_5 (/ (- x1 t_1) t_2)))
(if (<= x1 -2e+154)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+ x1 (+ (+ x1 (* (pow x1 4.0) 6.0)) t_4))
(if (<= x1 5.1e+140)
(+
x1
(+
t_4
(-
x1
(-
(+
(* t_0 t_5)
(*
t_2
(+
(* (* (* x1 2.0) t_3) (+ 3.0 t_5))
(* (* x1 x1) (- 6.0 (* 4.0 t_3))))))
(* x1 (* x1 x1))))))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_5 = (x1 - t_1) / t_2;
double tmp;
if (x1 <= -2e+154) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((x1 + (pow(x1, 4.0) * 6.0)) + t_4);
} else if (x1 <= 5.1e+140) {
tmp = x1 + (t_4 + (x1 - (((t_0 * t_5) + (t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_5)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = t_0 + (2.0d0 * x2)
t_2 = (x1 * x1) + 1.0d0
t_3 = (t_1 - x1) / t_2
t_4 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)
t_5 = (x1 - t_1) / t_2
if (x1 <= (-2d+154)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((x1 + ((x1 ** 4.0d0) * 6.0d0)) + t_4)
else if (x1 <= 5.1d+140) then
tmp = x1 + (t_4 + (x1 - (((t_0 * t_5) + (t_2 * ((((x1 * 2.0d0) * t_3) * (3.0d0 + t_5)) + ((x1 * x1) * (6.0d0 - (4.0d0 * t_3)))))) - (x1 * (x1 * x1)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * 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 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - x1) / t_2;
double t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_5 = (x1 - t_1) / t_2;
double tmp;
if (x1 <= -2e+154) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((x1 + (Math.pow(x1, 4.0) * 6.0)) + t_4);
} else if (x1 <= 5.1e+140) {
tmp = x1 + (t_4 + (x1 - (((t_0 * t_5) + (t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_5)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = (x1 * x1) + 1.0 t_3 = (t_1 - x1) / t_2 t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2) t_5 = (x1 - t_1) / t_2 tmp = 0 if x1 <= -2e+154: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((x1 + (math.pow(x1, 4.0) * 6.0)) + t_4) elif x1 <= 5.1e+140: tmp = x1 + (t_4 + (x1 - (((t_0 * t_5) + (t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_5)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1))))) else: tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(t_1 - x1) / t_2) t_4 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_5 = Float64(Float64(x1 - t_1) / t_2) tmp = 0.0 if (x1 <= -2e+154) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(x1 + Float64((x1 ^ 4.0) * 6.0)) + t_4)); elseif (x1 <= 5.1e+140) tmp = Float64(x1 + Float64(t_4 + Float64(x1 - Float64(Float64(Float64(t_0 * t_5) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5)) + Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * t_3)))))) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = (x1 * x1) + 1.0; t_3 = (t_1 - x1) / t_2; t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2); t_5 = (x1 - t_1) / t_2; tmp = 0.0; if (x1 <= -2e+154) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((x1 + ((x1 ^ 4.0) * 6.0)) + t_4); elseif (x1 <= 5.1e+140) tmp = x1 + (t_4 + (x1 - (((t_0 * t_5) + (t_2 * ((((x1 * 2.0) * t_3) * (3.0 + t_5)) + ((x1 * x1) * (6.0 - (4.0 * t_3)))))) - (x1 * (x1 * x1))))); else tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -2e+154], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.1e+140], N[(x1 + N[(t$95$4 + N[(x1 - N[(N[(N[(t$95$0 * t$95$5), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $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 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - x1}{t_2}\\
t_4 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2}\\
t_5 := \frac{x1 - t_1}{t_2}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \left(\left(x1 + {x1}^{4} \cdot 6\right) + t_4\right)\\
\mathbf{elif}\;x1 \leq 5.1 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 - \left(\left(t_0 \cdot t_5 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(3 + t_5\right) + \left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot t_3\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -2.00000000000000007e154 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -9.4999999999999995e105 < x1 < 5.1e140Initial program 98.8%
if 5.1e140 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 81.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x2 around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- 3.0 (/ 1.0 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_1)))
(t_5 (+ x2 (+ 3.0 x2)))
(t_6 (* (* x1 x1) t_5))
(t_7 (/ (- (+ t_3 (* 2.0 x2)) x1) t_1))
(t_8 (* (* x1 x1) (- (* 4.0 t_7) 6.0))))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_6 t_6)))
(- (* x2 -6.0) (* t_3 t_5))))
(if (<= x1 -2050000.0)
(+
x1
(+
t_4
(+
x1
(+
t_0
(+
(* t_1 (+ t_8 (* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))
(* 3.0 t_3))))))
(if (<= x1 -2.6e-239)
(-
x1
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0)))
(if (<= x1 9.6e-176)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(if (or (<= x1 75.0) (not (<= x1 5.1e+140)))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(+
x1
(+
t_4
(+
x1
(+
t_0
(+
(* t_1 (+ t_8 (* (- t_7 3.0) (* (* x1 2.0) t_2))))
(* t_3 t_2))))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (1.0 / x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1);
double t_5 = x2 + (3.0 + x2);
double t_6 = (x1 * x1) * t_5;
double t_7 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_8 = (x1 * x1) * ((4.0 * t_7) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_6 * t_6))) / ((x2 * -6.0) - (t_3 * t_5)));
} else if (x1 <= -2050000.0) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3)))));
} else if (x1 <= -2.6e-239) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 9.6e-176) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 75.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * t_2)))) + (t_3 * t_2)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 - (1.0d0 / x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = 3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_1)
t_5 = x2 + (3.0d0 + x2)
t_6 = (x1 * x1) * t_5
t_7 = ((t_3 + (2.0d0 * x2)) - x1) / t_1
t_8 = (x1 * x1) * ((4.0d0 * t_7) - 6.0d0)
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_6 * t_6))) / ((x2 * (-6.0d0)) - (t_3 * t_5)))
else if (x1 <= (-2050000.0d0)) then
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))))) + (3.0d0 * t_3)))))
else if (x1 <= (-2.6d-239)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
else if (x1 <= 9.6d-176) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else if ((x1 <= 75.0d0) .or. (.not. (x1 <= 5.1d+140))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * t_2)))) + (t_3 * t_2)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 - (1.0 / x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1);
double t_5 = x2 + (3.0 + x2);
double t_6 = (x1 * x1) * t_5;
double t_7 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_8 = (x1 * x1) * ((4.0 * t_7) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_6 * t_6))) / ((x2 * -6.0) - (t_3 * t_5)));
} else if (x1 <= -2050000.0) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3)))));
} else if (x1 <= -2.6e-239) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 9.6e-176) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 75.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * t_2)))) + (t_3 * t_2)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 - (1.0 / x1) t_3 = x1 * (x1 * 3.0) t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1) t_5 = x2 + (3.0 + x2) t_6 = (x1 * x1) * t_5 t_7 = ((t_3 + (2.0 * x2)) - x1) / t_1 t_8 = (x1 * x1) * ((4.0 * t_7) - 6.0) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_6 * t_6))) / ((x2 * -6.0) - (t_3 * t_5))) elif x1 <= -2050000.0: tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3))))) elif x1 <= -2.6e-239: tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)) elif x1 <= 9.6e-176: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) elif (x1 <= 75.0) or not (x1 <= 5.1e+140): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * t_2)))) + (t_3 * t_2))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 - Float64(1.0 / x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_1)) t_5 = Float64(x2 + Float64(3.0 + x2)) t_6 = Float64(Float64(x1 * x1) * t_5) t_7 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_1) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_7) - 6.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_6 * t_6))) / Float64(Float64(x2 * -6.0) - Float64(t_3 * t_5)))); elseif (x1 <= -2050000.0) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(t_8 + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))))) + Float64(3.0 * t_3)))))); elseif (x1 <= -2.6e-239) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))); elseif (x1 <= 9.6e-176) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); elseif ((x1 <= 75.0) || !(x1 <= 5.1e+140)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(t_8 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * t_2)))) + Float64(t_3 * t_2)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 - (1.0 / x1); t_3 = x1 * (x1 * 3.0); t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1); t_5 = x2 + (3.0 + x2); t_6 = (x1 * x1) * t_5; t_7 = ((t_3 + (2.0 * x2)) - x1) / t_1; t_8 = (x1 * x1) * ((4.0 * t_7) - 6.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_6 * t_6))) / ((x2 * -6.0) - (t_3 * t_5))); elseif (x1 <= -2050000.0) tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3))))); elseif (x1 <= -2.6e-239) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); elseif (x1 <= 9.6e-176) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); elseif ((x1 <= 75.0) || ~((x1 <= 5.1e+140))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = x1 + (t_4 + (x1 + (t_0 + ((t_1 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * t_2)))) + (t_3 * t_2))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$7), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$6 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$3 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2050000.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(t$95$8 + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.6e-239], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.6e-176], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, 75.0], N[Not[LessEqual[x1, 5.1e+140]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(t$95$8 + N[(N[(t$95$7 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 - \frac{1}{x1}\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_1}\\
t_5 := x2 + \left(3 + x2\right)\\
t_6 := \left(x1 \cdot x1\right) \cdot t_5\\
t_7 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_1}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_7 - 6\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_6 \cdot t_6\right)}{x2 \cdot -6 - t_3 \cdot t_5}\\
\mathbf{elif}\;x1 \leq -2050000:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_0 + \left(t_1 \cdot \left(t_8 + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + 3 \cdot t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.6 \cdot 10^{-239}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 9.6 \cdot 10^{-176}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 75 \lor \neg \left(x1 \leq 5.1 \cdot 10^{+140}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(t_0 + \left(t_1 \cdot \left(t_8 + \left(t_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t_2\right)\right) + t_3 \cdot t_2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -2.05e6Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -2.05e6 < x1 < -2.60000000000000003e-239Initial program 97.7%
Taylor expanded in x1 around 0 88.1%
Taylor expanded in x1 around 0 88.4%
if -2.60000000000000003e-239 < x1 < 9.60000000000000024e-176Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 9.60000000000000024e-176 < x1 < 75 or 5.1e140 < x1 Initial program 51.9%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
unpow296.3%
Simplified96.3%
Taylor expanded in x2 around inf 96.3%
unpow296.3%
Simplified96.3%
if 75 < x1 < 5.1e140Initial program 99.2%
Taylor expanded in x1 around inf 87.3%
Taylor expanded in x1 around inf 87.3%
Final simplification93.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x2 (+ 3.0 x2)))
(t_1 (* (* x1 x1) t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- x1 t_4) t_2)))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_1 t_1)))
(- (* x2 -6.0) (* t_3 t_0))))
(if (<= x1 5.1e+140)
(-
x1
(-
(* 3.0 (/ (+ x1 (- (* 2.0 x2) t_3)) t_2))
(-
x1
(-
(+
(* t_3 t_5)
(*
t_2
(-
(* (* (* x1 2.0) (/ (- t_4 x1) t_2)) (+ 3.0 t_5))
(* 6.0 (* x1 x1)))))
(* x1 (* x1 x1))))))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (x1 - t_4) / t_2;
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= 5.1e+140) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_3)) / t_2)) - (x1 - (((t_3 * t_5) + (t_2 * ((((x1 * 2.0) * ((t_4 - x1) / t_2)) * (3.0 + t_5)) - (6.0 * (x1 * x1))))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x2 + (3.0d0 + x2)
t_1 = (x1 * x1) * t_0
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (x1 - t_4) / t_2
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_1 * t_1))) / ((x2 * (-6.0d0)) - (t_3 * t_0)))
else if (x1 <= 5.1d+140) then
tmp = x1 - ((3.0d0 * ((x1 + ((2.0d0 * x2) - t_3)) / t_2)) - (x1 - (((t_3 * t_5) + (t_2 * ((((x1 * 2.0d0) * ((t_4 - x1) / t_2)) * (3.0d0 + t_5)) - (6.0d0 * (x1 * x1))))) - (x1 * (x1 * x1)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (x1 - t_4) / t_2;
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= 5.1e+140) {
tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_3)) / t_2)) - (x1 - (((t_3 * t_5) + (t_2 * ((((x1 * 2.0) * ((t_4 - x1) / t_2)) * (3.0 + t_5)) - (6.0 * (x1 * x1))))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x2 + (3.0 + x2) t_1 = (x1 * x1) * t_0 t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (x1 - t_4) / t_2 tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))) elif x1 <= 5.1e+140: tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_3)) / t_2)) - (x1 - (((t_3 * t_5) + (t_2 * ((((x1 * 2.0) * ((t_4 - x1) / t_2)) * (3.0 + t_5)) - (6.0 * (x1 * x1))))) - (x1 * (x1 * x1))))) else: tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) return tmp
function code(x1, x2) t_0 = Float64(x2 + Float64(3.0 + x2)) t_1 = Float64(Float64(x1 * x1) * t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(Float64(x1 - t_4) / t_2) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_1 * t_1))) / Float64(Float64(x2 * -6.0) - Float64(t_3 * t_0)))); elseif (x1 <= 5.1e+140) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(x1 + Float64(Float64(2.0 * x2) - t_3)) / t_2)) - Float64(x1 - Float64(Float64(Float64(t_3 * t_5) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_4 - x1) / t_2)) * Float64(3.0 + t_5)) - Float64(6.0 * Float64(x1 * x1))))) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 + (3.0 + x2); t_1 = (x1 * x1) * t_0; t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (x1 - t_4) / t_2; tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))); elseif (x1 <= 5.1e+140) tmp = x1 - ((3.0 * ((x1 + ((2.0 * x2) - t_3)) / t_2)) - (x1 - (((t_3 * t_5) + (t_2 * ((((x1 * 2.0) * ((t_4 - x1) / t_2)) * (3.0 + t_5)) - (6.0 * (x1 * x1))))) - (x1 * (x1 * x1))))); else tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.1e+140], N[(x1 - N[(N[(3.0 * N[(N[(x1 + N[(N[(2.0 * x2), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 - N[(N[(N[(t$95$3 * t$95$5), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision] - N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 + \left(3 + x2\right)\\
t_1 := \left(x1 \cdot x1\right) \cdot t_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t_3 + 2 \cdot x2\\
t_5 := \frac{x1 - t_4}{t_2}\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_1 \cdot t_1\right)}{x2 \cdot -6 - t_3 \cdot t_0}\\
\mathbf{elif}\;x1 \leq 5.1 \cdot 10^{+140}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{x1 + \left(2 \cdot x2 - t_3\right)}{t_2} - \left(x1 - \left(\left(t_3 \cdot t_5 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{t_4 - x1}{t_2}\right) \cdot \left(3 + t_5\right) - 6 \cdot \left(x1 \cdot x1\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < 5.1e140Initial program 98.8%
Taylor expanded in x1 around inf 97.1%
if 5.1e140 < x1 Initial program 3.1%
Taylor expanded in x1 around 0 3.1%
Taylor expanded in x1 around 0 81.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in x2 around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification96.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 t_2))
(t_4 (+ x2 (+ 3.0 x2)))
(t_5 (* (* x1 x1) t_4))
(t_6 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
(t_7 (* (* x1 x1) (- (* 4.0 t_6) 6.0))))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_5 t_5)))
(- (* x2 -6.0) (* t_2 t_4))))
(if (<= x1 -650000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1))
(+
x1
(+
t_0
(+
(* t_1 (+ t_7 (* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))
t_3)))))
(if (<= x1 -3.6e-241)
(-
x1
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0)))
(if (<= x1 4.2e-177)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(if (or (<= x1 72.0) (not (<= x1 5.1e+140)))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(+
x1
(+
(+
x1
(+
t_0
(+
t_3
(*
t_1
(+
t_7
(* (- t_6 3.0) (* (* x1 2.0) (- 3.0 (/ 1.0 x1)))))))))
(* 3.0 (- (* x2 -2.0) x1))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = x2 + (3.0 + x2);
double t_5 = (x1 * x1) * t_4;
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4)));
} else if (x1 <= -650000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3))));
} else if (x1 <= -3.6e-241) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 4.2e-177) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 72.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * t_2
t_4 = x2 + (3.0d0 + x2)
t_5 = (x1 * x1) * t_4
t_6 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
t_7 = (x1 * x1) * ((4.0d0 * t_6) - 6.0d0)
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_5 * t_5))) / ((x2 * (-6.0d0)) - (t_2 * t_4)))
else if (x1 <= (-650000.0d0)) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))))) + t_3))))
else if (x1 <= (-3.6d-241)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
else if (x1 <= 4.2d-177) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else if ((x1 <= 72.0d0) .or. (.not. (x1 <= 5.1d+140))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 - (1.0d0 / x1))))))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = x2 + (3.0 + x2);
double t_5 = (x1 * x1) * t_4;
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4)));
} else if (x1 <= -650000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3))));
} else if (x1 <= -3.6e-241) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 4.2e-177) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 72.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * t_2 t_4 = x2 + (3.0 + x2) t_5 = (x1 * x1) * t_4 t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1 t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4))) elif x1 <= -650000.0: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3)))) elif x1 <= -3.6e-241: tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)) elif x1 <= 4.2e-177: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) elif (x1 <= 72.0) or not (x1 <= 5.1e+140): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * t_2) t_4 = Float64(x2 + Float64(3.0 + x2)) t_5 = Float64(Float64(x1 * x1) * t_4) t_6 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_6) - 6.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_5 * t_5))) / Float64(Float64(x2 * -6.0) - Float64(t_2 * t_4)))); elseif (x1 <= -650000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(t_7 + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))))) + t_3))))); elseif (x1 <= -3.6e-241) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))); elseif (x1 <= 4.2e-177) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); elseif ((x1 <= 72.0) || !(x1 <= 5.1e+140)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_3 + Float64(t_1 * Float64(t_7 + Float64(Float64(t_6 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 - Float64(1.0 / x1))))))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * t_2; t_4 = x2 + (3.0 + x2); t_5 = (x1 * x1) * t_4; t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1; t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4))); elseif (x1 <= -650000.0) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3)))); elseif (x1 <= -3.6e-241) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); elseif (x1 <= 4.2e-177) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); elseif ((x1 <= 72.0) || ~((x1 <= 5.1e+140))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$6), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$5 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -650000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(t$95$7 + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.6e-241], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e-177], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, 72.0], N[Not[LessEqual[x1, 5.1e+140]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$3 + N[(t$95$1 * N[(t$95$7 + N[(N[(t$95$6 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot t_2\\
t_4 := x2 + \left(3 + x2\right)\\
t_5 := \left(x1 \cdot x1\right) \cdot t_4\\
t_6 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_6 - 6\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_5 \cdot t_5\right)}{x2 \cdot -6 - t_2 \cdot t_4}\\
\mathbf{elif}\;x1 \leq -650000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(t_0 + \left(t_1 \cdot \left(t_7 + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.6 \cdot 10^{-241}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{-177}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 72 \lor \neg \left(x1 \leq 5.1 \cdot 10^{+140}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_3 + t_1 \cdot \left(t_7 + \left(t_6 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -6.5e5Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -6.5e5 < x1 < -3.5999999999999999e-241Initial program 97.7%
Taylor expanded in x1 around 0 88.1%
Taylor expanded in x1 around 0 88.4%
if -3.5999999999999999e-241 < x1 < 4.20000000000000002e-177Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 4.20000000000000002e-177 < x1 < 72 or 5.1e140 < x1 Initial program 51.9%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
unpow296.3%
Simplified96.3%
Taylor expanded in x2 around inf 96.3%
unpow296.3%
Simplified96.3%
if 72 < x1 < 5.1e140Initial program 99.2%
Taylor expanded in x1 around inf 87.3%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around 0 87.3%
Final simplification93.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 t_2))
(t_4 (+ x2 (+ 3.0 x2)))
(t_5 (* (* x1 x1) t_4))
(t_6 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
(t_7 (* (* x1 x1) (- (* 4.0 t_6) 6.0))))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_5 t_5)))
(- (* x2 -6.0) (* t_2 t_4))))
(if (<= x1 -900000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1))
(+
x1
(+
t_0
(+
(* t_1 (+ t_7 (* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))
t_3)))))
(if (<= x1 -9.5e-240)
(-
x1
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0)))
(if (<= x1 8.6e-178)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(if (or (<= x1 140.0) (not (<= x1 5.1e+140)))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(+
x1
(+
(+
x1
(+
t_0
(+
t_3
(*
t_1
(+
t_7
(* (- t_6 3.0) (* (* x1 2.0) (- 3.0 (/ 1.0 x1)))))))))
(* 3.0 (* x2 -2.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = x2 + (3.0 + x2);
double t_5 = (x1 * x1) * t_4;
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4)));
} else if (x1 <= -900000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3))));
} else if (x1 <= -9.5e-240) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 8.6e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 140.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * t_2
t_4 = x2 + (3.0d0 + x2)
t_5 = (x1 * x1) * t_4
t_6 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
t_7 = (x1 * x1) * ((4.0d0 * t_6) - 6.0d0)
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_5 * t_5))) / ((x2 * (-6.0d0)) - (t_2 * t_4)))
else if (x1 <= (-900000.0d0)) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))))) + t_3))))
else if (x1 <= (-9.5d-240)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
else if (x1 <= 8.6d-178) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else if ((x1 <= 140.0d0) .or. (.not. (x1 <= 5.1d+140))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 - (1.0d0 / x1))))))))) + (3.0d0 * (x2 * (-2.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = x2 + (3.0 + x2);
double t_5 = (x1 * x1) * t_4;
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4)));
} else if (x1 <= -900000.0) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3))));
} else if (x1 <= -9.5e-240) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 8.6e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 140.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * t_2 t_4 = x2 + (3.0 + x2) t_5 = (x1 * x1) * t_4 t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1 t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4))) elif x1 <= -900000.0: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3)))) elif x1 <= -9.5e-240: tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)) elif x1 <= 8.6e-178: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) elif (x1 <= 140.0) or not (x1 <= 5.1e+140): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * t_2) t_4 = Float64(x2 + Float64(3.0 + x2)) t_5 = Float64(Float64(x1 * x1) * t_4) t_6 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_6) - 6.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_5 * t_5))) / Float64(Float64(x2 * -6.0) - Float64(t_2 * t_4)))); elseif (x1 <= -900000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * Float64(t_7 + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))))) + t_3))))); elseif (x1 <= -9.5e-240) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))); elseif (x1 <= 8.6e-178) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); elseif ((x1 <= 140.0) || !(x1 <= 5.1e+140)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_3 + Float64(t_1 * Float64(t_7 + Float64(Float64(t_6 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 - Float64(1.0 / x1))))))))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * t_2; t_4 = x2 + (3.0 + x2); t_5 = (x1 * x1) * t_4; t_6 = ((t_2 + (2.0 * x2)) - x1) / t_1; t_7 = (x1 * x1) * ((4.0 * t_6) - 6.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_5 * t_5))) / ((x2 * -6.0) - (t_2 * t_4))); elseif (x1 <= -900000.0) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_0 + ((t_1 * (t_7 + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + t_3)))); elseif (x1 <= -9.5e-240) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); elseif (x1 <= 8.6e-178) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); elseif ((x1 <= 140.0) || ~((x1 <= 5.1e+140))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = x1 + ((x1 + (t_0 + (t_3 + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$6), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$5 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$2 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -900000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * N[(t$95$7 + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e-240], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.6e-178], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, 140.0], N[Not[LessEqual[x1, 5.1e+140]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$3 + N[(t$95$1 * N[(t$95$7 + N[(N[(t$95$6 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot t_2\\
t_4 := x2 + \left(3 + x2\right)\\
t_5 := \left(x1 \cdot x1\right) \cdot t_4\\
t_6 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_6 - 6\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_5 \cdot t_5\right)}{x2 \cdot -6 - t_2 \cdot t_4}\\
\mathbf{elif}\;x1 \leq -900000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(t_0 + \left(t_1 \cdot \left(t_7 + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + t_3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{-240}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 8.6 \cdot 10^{-178}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 140 \lor \neg \left(x1 \leq 5.1 \cdot 10^{+140}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_3 + t_1 \cdot \left(t_7 + \left(t_6 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -9e5Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -9e5 < x1 < -9.5000000000000005e-240Initial program 97.7%
Taylor expanded in x1 around 0 88.1%
Taylor expanded in x1 around 0 88.4%
if -9.5000000000000005e-240 < x1 < 8.6e-178Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 8.6e-178 < x1 < 140 or 5.1e140 < x1 Initial program 51.9%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
unpow296.3%
Simplified96.3%
Taylor expanded in x2 around inf 96.3%
unpow296.3%
Simplified96.3%
if 140 < x1 < 5.1e140Initial program 99.2%
Taylor expanded in x1 around inf 87.3%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around 0 86.8%
*-commutative27.3%
Simplified86.8%
Final simplification93.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x2 (+ 3.0 x2)))
(t_1 (* (* x1 x1) t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 3.0)))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ t_3 (* 2.0 x2)) x1) t_2)) 6.0))
(* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))
(* 3.0 t_3))))))))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_1 t_1)))
(- (* x2 -6.0) (* t_3 t_0))))
(if (<= x1 -600000.0)
t_4
(if (<= x1 -1.3e-242)
(-
x1
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0)))
(if (<= x1 2.1e-177)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(if (or (<= x1 520.0) (not (<= x1 5.1e+140)))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
t_4))))))))
double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((4.0 * (((t_3 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3)))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= -600000.0) {
tmp = t_4;
} else if (x1 <= -1.3e-242) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 2.1e-177) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 520.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x2 + (3.0d0 + x2)
t_1 = (x1 * x1) * t_0
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * 3.0d0)
t_4 = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((4.0d0 * (((t_3 + (2.0d0 * x2)) - x1) / t_2)) - 6.0d0)) + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))))) + (3.0d0 * t_3)))))
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_1 * t_1))) / ((x2 * (-6.0d0)) - (t_3 * t_0)))
else if (x1 <= (-600000.0d0)) then
tmp = t_4
else if (x1 <= (-1.3d-242)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
else if (x1 <= 2.1d-177) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else if ((x1 <= 520.0d0) .or. (.not. (x1 <= 5.1d+140))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((4.0 * (((t_3 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3)))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= -600000.0) {
tmp = t_4;
} else if (x1 <= -1.3e-242) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 2.1e-177) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 520.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x2 + (3.0 + x2) t_1 = (x1 * x1) * t_0 t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * 3.0) t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((4.0 * (((t_3 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3))))) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))) elif x1 <= -600000.0: tmp = t_4 elif x1 <= -1.3e-242: tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)) elif x1 <= 2.1e-177: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) elif (x1 <= 520.0) or not (x1 <= 5.1e+140): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x2 + Float64(3.0 + x2)) t_1 = Float64(Float64(x1 * x1) * t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_2)) - 6.0)) + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))))) + Float64(3.0 * t_3)))))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_1 * t_1))) / Float64(Float64(x2 * -6.0) - Float64(t_3 * t_0)))); elseif (x1 <= -600000.0) tmp = t_4; elseif (x1 <= -1.3e-242) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))); elseif (x1 <= 2.1e-177) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); elseif ((x1 <= 520.0) || !(x1 <= 5.1e+140)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 + (3.0 + x2); t_1 = (x1 * x1) * t_0; t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * 3.0); t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((x1 * x1) * ((4.0 * (((t_3 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (3.0 * t_3))))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))); elseif (x1 <= -600000.0) tmp = t_4; elseif (x1 <= -1.3e-242) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); elseif (x1 <= 2.1e-177) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); elseif ((x1 <= 520.0) || ~((x1 <= 5.1e+140))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -600000.0], t$95$4, If[LessEqual[x1, -1.3e-242], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.1e-177], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, 520.0], N[Not[LessEqual[x1, 5.1e+140]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 + \left(3 + x2\right)\\
t_1 := \left(x1 \cdot x1\right) \cdot t_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2} - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + 3 \cdot t_3\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_1 \cdot t_1\right)}{x2 \cdot -6 - t_3 \cdot t_0}\\
\mathbf{elif}\;x1 \leq -600000:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-242}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{-177}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 520 \lor \neg \left(x1 \leq 5.1 \cdot 10^{+140}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -6e5 or 520 < x1 < 5.1e140Initial program 99.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.0%
Taylor expanded in x1 around inf 91.9%
if -6e5 < x1 < -1.30000000000000009e-242Initial program 97.7%
Taylor expanded in x1 around 0 88.1%
Taylor expanded in x1 around 0 88.4%
if -1.30000000000000009e-242 < x1 < 2.10000000000000001e-177Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 2.10000000000000001e-177 < x1 < 520 or 5.1e140 < x1 Initial program 51.9%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
unpow296.3%
Simplified96.3%
Taylor expanded in x2 around inf 96.3%
unpow296.3%
Simplified96.3%
Final simplification93.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x2 (+ 3.0 x2)))
(t_1 (* (* x1 x1) t_0))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* x1 (* x1 3.0)))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_3)
(*
t_2
(+
(* 6.0 (* x1 x1))
(*
(- (/ (- (+ t_3 (* 2.0 x2)) x1) t_2) 3.0)
(* (* x1 2.0) (- 3.0 (/ 1.0 x1)))))))))))))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_1 t_1)))
(- (* x2 -6.0) (* t_3 t_0))))
(if (<= x1 -2000000.0)
t_4
(if (<= x1 -3.4e-239)
(-
x1
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) (* x2 -6.0)))
(if (<= x1 2.5e-178)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(if (or (<= x1 112.0) (not (<= x1 5.1e+140)))
(+
x1
(+
(* x2 -6.0)
(-
(* 9.0 (* x1 x1))
(* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
t_4))))))))
double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_2 * ((6.0 * (x1 * x1)) + (((((t_3 + (2.0 * x2)) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= -2000000.0) {
tmp = t_4;
} else if (x1 <= -3.4e-239) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 2.5e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 112.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x2 + (3.0d0 + x2)
t_1 = (x1 * x1) * t_0
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 * (x1 * 3.0d0)
t_4 = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_3) + (t_2 * ((6.0d0 * (x1 * x1)) + (((((t_3 + (2.0d0 * x2)) - x1) / t_2) - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 - (1.0d0 / x1))))))))))
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_1 * t_1))) / ((x2 * (-6.0d0)) - (t_3 * t_0)))
else if (x1 <= (-2000000.0d0)) then
tmp = t_4
else if (x1 <= (-3.4d-239)) then
tmp = x1 - ((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - (x2 * (-6.0d0)))
else if (x1 <= 2.5d-178) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else if ((x1 <= 112.0d0) .or. (.not. (x1 <= 5.1d+140))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 + (3.0 + x2);
double t_1 = (x1 * x1) * t_0;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_2 * ((6.0 * (x1 * x1)) + (((((t_3 + (2.0 * x2)) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1))))))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0)));
} else if (x1 <= -2000000.0) {
tmp = t_4;
} else if (x1 <= -3.4e-239) {
tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0));
} else if (x1 <= 2.5e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else if ((x1 <= 112.0) || !(x1 <= 5.1e+140)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x2 + (3.0 + x2) t_1 = (x1 * x1) * t_0 t_2 = (x1 * x1) + 1.0 t_3 = x1 * (x1 * 3.0) t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_2 * ((6.0 * (x1 * x1)) + (((((t_3 + (2.0 * x2)) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1)))))))))) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))) elif x1 <= -2000000.0: tmp = t_4 elif x1 <= -3.4e-239: tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)) elif x1 <= 2.5e-178: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) elif (x1 <= 112.0) or not (x1 <= 5.1e+140): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x2 + Float64(3.0 + x2)) t_1 = Float64(Float64(x1 * x1) * t_0) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_3) + Float64(t_2 * Float64(Float64(6.0 * Float64(x1 * x1)) + Float64(Float64(Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 - Float64(1.0 / x1))))))))))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_1 * t_1))) / Float64(Float64(x2 * -6.0) - Float64(t_3 * t_0)))); elseif (x1 <= -2000000.0) tmp = t_4; elseif (x1 <= -3.4e-239) tmp = Float64(x1 - Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - Float64(x2 * -6.0))); elseif (x1 <= 2.5e-178) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); elseif ((x1 <= 112.0) || !(x1 <= 5.1e+140)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 + (3.0 + x2); t_1 = (x1 * x1) * t_0; t_2 = (x1 * x1) + 1.0; t_3 = x1 * (x1 * 3.0); t_4 = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_2 * ((6.0 * (x1 * x1)) + (((((t_3 + (2.0 * x2)) - x1) / t_2) - 3.0) * ((x1 * 2.0) * (3.0 - (1.0 / x1)))))))))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_1 * t_1))) / ((x2 * -6.0) - (t_3 * t_0))); elseif (x1 <= -2000000.0) tmp = t_4; elseif (x1 <= -3.4e-239) tmp = x1 - ((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - (x2 * -6.0)); elseif (x1 <= 2.5e-178) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); elseif ((x1 <= 112.0) || ~((x1 <= 5.1e+140))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(6.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 - N[(1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2000000.0], t$95$4, If[LessEqual[x1, -3.4e-239], N[(x1 - N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.5e-178], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, 112.0], N[Not[LessEqual[x1, 5.1e+140]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 + \left(3 + x2\right)\\
t_1 := \left(x1 \cdot x1\right) \cdot t_0\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_3 + t_2 \cdot \left(6 \cdot \left(x1 \cdot x1\right) + \left(\frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_2} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 - \frac{1}{x1}\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_1 \cdot t_1\right)}{x2 \cdot -6 - t_3 \cdot t_0}\\
\mathbf{elif}\;x1 \leq -2000000:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq -3.4 \cdot 10^{-239}:\\
\;\;\;\;x1 - \left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 2.5 \cdot 10^{-178}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 112 \lor \neg \left(x1 \leq 5.1 \cdot 10^{+140}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -2e6 or 112 < x1 < 5.1e140Initial program 99.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.0%
Taylor expanded in x1 around inf 78.6%
if -2e6 < x1 < -3.4e-239Initial program 97.7%
Taylor expanded in x1 around 0 88.1%
Taylor expanded in x1 around 0 88.4%
if -3.4e-239 < x1 < 2.49999999999999988e-178Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 2.49999999999999988e-178 < x1 < 112 or 5.1e140 < x1 Initial program 51.9%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 96.3%
*-commutative96.3%
unpow296.3%
Simplified96.3%
Taylor expanded in x2 around inf 96.3%
unpow296.3%
Simplified96.3%
Final simplification90.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 9.0 (* x1 x1)))
(t_1 (+ x2 (+ 3.0 x2)))
(t_2 (* (* x1 x1) t_1)))
(if (<= x1 -4.5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -9.5e+105)
(+
x1
(/
(- (* (* x2 x2) 36.0) (* 9.0 (* t_2 t_2)))
(- (* x2 -6.0) (* (* x1 (* x1 3.0)) t_1))))
(if (<= x1 -2.9e-239)
(+
x1
(+ (* x2 -6.0) (- t_0 (* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(if (<= x1 3.8e-178)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(-
x1
(-
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) t_0)
(* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = 9.0 * (x1 * x1);
double t_1 = x2 + (3.0 + x2);
double t_2 = (x1 * x1) * t_1;
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_2 * t_2))) / ((x2 * -6.0) - ((x1 * (x1 * 3.0)) * t_1)));
} else if (x1 <= -2.9e-239) {
tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else if (x1 <= 3.8e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -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 = 9.0d0 * (x1 * x1)
t_1 = x2 + (3.0d0 + x2)
t_2 = (x1 * x1) * t_1
if (x1 <= (-4.5d+153)) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else if (x1 <= (-9.5d+105)) then
tmp = x1 + ((((x2 * x2) * 36.0d0) - (9.0d0 * (t_2 * t_2))) / ((x2 * (-6.0d0)) - ((x1 * (x1 * 3.0d0)) * t_1)))
else if (x1 <= (-2.9d-239)) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else if (x1 <= 3.8d-178) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else
tmp = x1 - (((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - t_0) - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 9.0 * (x1 * x1);
double t_1 = x2 + (3.0 + x2);
double t_2 = (x1 * x1) * t_1;
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -9.5e+105) {
tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_2 * t_2))) / ((x2 * -6.0) - ((x1 * (x1 * 3.0)) * t_1)));
} else if (x1 <= -2.9e-239) {
tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else if (x1 <= 3.8e-178) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = 9.0 * (x1 * x1) t_1 = x2 + (3.0 + x2) t_2 = (x1 * x1) * t_1 tmp = 0 if x1 <= -4.5e+153: tmp = x1 + (x1 * (x1 * 9.0)) elif x1 <= -9.5e+105: tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_2 * t_2))) / ((x2 * -6.0) - ((x1 * (x1 * 3.0)) * t_1))) elif x1 <= -2.9e-239: tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) elif x1 <= 3.8e-178: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) else: tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(9.0 * Float64(x1 * x1)) t_1 = Float64(x2 + Float64(3.0 + x2)) t_2 = Float64(Float64(x1 * x1) * t_1) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -9.5e+105) tmp = Float64(x1 + Float64(Float64(Float64(Float64(x2 * x2) * 36.0) - Float64(9.0 * Float64(t_2 * t_2))) / Float64(Float64(x2 * -6.0) - Float64(Float64(x1 * Float64(x1 * 3.0)) * t_1)))); elseif (x1 <= -2.9e-239) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); elseif (x1 <= 3.8e-178) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); else tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - t_0) - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 9.0 * (x1 * x1); t_1 = x2 + (3.0 + x2); t_2 = (x1 * x1) * t_1; tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + (x1 * (x1 * 9.0)); elseif (x1 <= -9.5e+105) tmp = x1 + ((((x2 * x2) * 36.0) - (9.0 * (t_2 * t_2))) / ((x2 * -6.0) - ((x1 * (x1 * 3.0)) * t_1))); elseif (x1 <= -2.9e-239) tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); elseif (x1 <= 3.8e-178) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); else tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 + N[(3.0 + x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e+105], N[(x1 + N[(N[(N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision] - N[(9.0 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x2 * -6.0), $MachinePrecision] - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.9e-239], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e-178], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 9 \cdot \left(x1 \cdot x1\right)\\
t_1 := x2 + \left(3 + x2\right)\\
t_2 := \left(x1 \cdot x1\right) \cdot t_1\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{+105}:\\
\;\;\;\;x1 + \frac{\left(x2 \cdot x2\right) \cdot 36 - 9 \cdot \left(t_2 \cdot t_2\right)}{x2 \cdot -6 - \left(x1 \cdot \left(x1 \cdot 3\right)\right) \cdot t_1}\\
\mathbf{elif}\;x1 \leq -2.9 \cdot 10^{-239}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t_0 - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{-178}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_0\right) - x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 42.9%
Taylor expanded in x1 around inf 57.1%
associate-*r*57.1%
*-commutative57.1%
cancel-sign-sub-inv57.1%
unpow257.1%
+-commutative57.1%
distribute-lft-neg-in57.1%
*-commutative57.1%
distribute-lft-neg-in57.1%
metadata-eval57.1%
count-257.1%
Simplified57.1%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -9.4999999999999995e105Initial program 0.0%
Taylor expanded in x1 around 0 0.2%
Taylor expanded in x1 around 0 5.7%
Taylor expanded in x1 around inf 23.9%
associate-*r*23.9%
*-commutative23.9%
cancel-sign-sub-inv23.9%
unpow223.9%
+-commutative23.9%
distribute-lft-neg-in23.9%
*-commutative23.9%
distribute-lft-neg-in23.9%
metadata-eval23.9%
count-223.9%
Simplified23.9%
flip-+63.6%
*-commutative63.6%
*-commutative63.6%
associate-*l*63.6%
associate-+l+63.6%
associate-*l*63.6%
associate-+l+63.6%
*-commutative63.6%
Applied egg-rr63.6%
swap-sqr63.6%
metadata-eval63.6%
swap-sqr63.6%
metadata-eval63.6%
associate-*l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*l*63.6%
*-commutative63.6%
Simplified63.6%
if -9.4999999999999995e105 < x1 < -2.9000000000000002e-239Initial program 98.1%
Taylor expanded in x1 around 0 72.6%
Taylor expanded in x1 around 0 73.6%
Taylor expanded in x2 around 0 73.6%
*-commutative73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in x2 around inf 73.6%
unpow273.6%
Simplified73.6%
if -2.9000000000000002e-239 < x1 < 3.80000000000000015e-178Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 3.80000000000000015e-178 < x1 Initial program 65.4%
Taylor expanded in x1 around 0 42.3%
Taylor expanded in x1 around 0 66.7%
Taylor expanded in x2 around 0 76.8%
*-commutative76.8%
unpow276.8%
Simplified76.8%
Final simplification82.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 9.0 (* x1 x1))))
(if (<= x1 -8.2e+114)
(+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0)))
(if (<= x1 -5.2e-239)
(+ x1 (+ (* x2 -6.0) (- t_0 (* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(if (<= x1 1.6e-174)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(-
x1
(-
(- (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2)))))) t_0)
(* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = 9.0 * (x1 * x1);
double tmp;
if (x1 <= -8.2e+114) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if (x1 <= -5.2e-239) {
tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else if (x1 <= 1.6e-174) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -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) :: tmp
t_0 = 9.0d0 * (x1 * x1)
if (x1 <= (-8.2d+114)) then
tmp = x1 + ((x1 * (x1 * 9.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= (-5.2d-239)) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else if (x1 <= 1.6d-174) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else
tmp = x1 - (((x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))) - t_0) - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 9.0 * (x1 * x1);
double tmp;
if (x1 <= -8.2e+114) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if (x1 <= -5.2e-239) {
tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else if (x1 <= 1.6e-174) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = 9.0 * (x1 * x1) tmp = 0 if x1 <= -8.2e+114: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) elif x1 <= -5.2e-239: tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) elif x1 <= 1.6e-174: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) else: tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(9.0 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -8.2e+114) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); elseif (x1 <= -5.2e-239) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); elseif (x1 <= 1.6e-174) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); else tmp = Float64(x1 - Float64(Float64(Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))) - t_0) - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 9.0 * (x1 * x1); tmp = 0.0; if (x1 <= -8.2e+114) tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); elseif (x1 <= -5.2e-239) tmp = x1 + ((x2 * -6.0) + (t_0 - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); elseif (x1 <= 1.6e-174) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); else tmp = x1 - (((x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))) - t_0) - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.2e+114], N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.2e-239], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.6e-174], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(N[(N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 9 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -8.2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq -5.2 \cdot 10^{-239}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t_0 - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-174}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - \left(\left(x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - t_0\right) - x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -8.2000000000000001e114Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 34.6%
Taylor expanded in x2 around 0 39.0%
*-commutative39.0%
unpow239.0%
Simplified39.0%
Taylor expanded in x1 around inf 79.7%
*-commutative79.7%
unpow279.7%
associate-*r*79.7%
Simplified79.7%
if -8.2000000000000001e114 < x1 < -5.20000000000000005e-239Initial program 96.8%
Taylor expanded in x1 around 0 71.7%
Taylor expanded in x1 around 0 72.7%
Taylor expanded in x2 around 0 72.7%
*-commutative72.7%
unpow272.7%
Simplified72.7%
Taylor expanded in x2 around inf 72.7%
unpow272.7%
Simplified72.7%
if -5.20000000000000005e-239 < x1 < 1.6e-174Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
if 1.6e-174 < x1 Initial program 65.4%
Taylor expanded in x1 around 0 42.3%
Taylor expanded in x1 around 0 66.7%
Taylor expanded in x2 around 0 76.8%
*-commutative76.8%
unpow276.8%
Simplified76.8%
Final simplification79.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.3e+110)
(+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0)))
(if (or (<= x1 -8.5e-240) (not (<= x1 1.15e-174)))
(+
x1
(+
(* x2 -6.0)
(- (* 9.0 (* x1 x1)) (* x1 (- 2.0 (* 4.0 (* 2.0 (* x2 x2))))))))
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.3e+110) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x1 <= -8.5e-240) || !(x1 <= 1.15e-174)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.3d+110)) then
tmp = x1 + ((x1 * (x1 * 9.0d0)) + (x2 * (-6.0d0)))
else if ((x1 <= (-8.5d-240)) .or. (.not. (x1 <= 1.15d-174))) then
tmp = x1 + ((x2 * (-6.0d0)) + ((9.0d0 * (x1 * x1)) - (x1 * (2.0d0 - (4.0d0 * (2.0d0 * (x2 * x2)))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.3e+110) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x1 <= -8.5e-240) || !(x1 <= 1.15e-174)) {
tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.3e+110: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) elif (x1 <= -8.5e-240) or not (x1 <= 1.15e-174): tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))) else: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.3e+110) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); elseif ((x1 <= -8.5e-240) || !(x1 <= 1.15e-174)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(9.0 * Float64(x1 * x1)) - Float64(x1 * Float64(2.0 - Float64(4.0 * Float64(2.0 * Float64(x2 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.3e+110) tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); elseif ((x1 <= -8.5e-240) || ~((x1 <= 1.15e-174))) tmp = x1 + ((x2 * -6.0) + ((9.0 * (x1 * x1)) - (x1 * (2.0 - (4.0 * (2.0 * (x2 * x2))))))); else tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.3e+110], N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -8.5e-240], N[Not[LessEqual[x1, 1.15e-174]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(2.0 - N[(4.0 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.3 \cdot 10^{+110}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-240} \lor \neg \left(x1 \leq 1.15 \cdot 10^{-174}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(9 \cdot \left(x1 \cdot x1\right) - x1 \cdot \left(2 - 4 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3e110Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 34.6%
Taylor expanded in x2 around 0 39.0%
*-commutative39.0%
unpow239.0%
Simplified39.0%
Taylor expanded in x1 around inf 79.7%
*-commutative79.7%
unpow279.7%
associate-*r*79.7%
Simplified79.7%
if -2.3e110 < x1 < -8.5e-240 or 1.1499999999999999e-174 < x1 Initial program 79.8%
Taylor expanded in x1 around 0 55.8%
Taylor expanded in x1 around 0 69.5%
Taylor expanded in x2 around 0 74.9%
*-commutative74.9%
unpow274.9%
Simplified74.9%
Taylor expanded in x2 around inf 74.9%
unpow274.9%
Simplified74.9%
if -8.5e-240 < x1 < 1.1499999999999999e-174Initial program 99.6%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x2 around 0 72.9%
*-commutative72.9%
unpow272.9%
Simplified72.9%
Taylor expanded in x2 around inf 71.0%
*-commutative71.0%
unpow271.0%
associate-*l*97.8%
*-commutative97.8%
Simplified97.8%
Final simplification79.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* (* x2 8.0) (* x1 x2)))))
(if (<= x2 -4.4e+170)
t_0
(if (<= x2 6.2e+72)
(+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0)))
(if (or (<= x2 1.8e+228) (not (<= x2 3.8e+246)))
t_0
(+ (* x1 2.0) (* x2 (- (* x1 -12.0) 6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x2 <= -4.4e+170) {
tmp = t_0;
} else if (x2 <= 6.2e+72) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x2 <= 1.8e+228) || !(x2 <= 3.8e+246)) {
tmp = t_0;
} else {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 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) :: tmp
t_0 = x1 + ((x2 * 8.0d0) * (x1 * x2))
if (x2 <= (-4.4d+170)) then
tmp = t_0
else if (x2 <= 6.2d+72) then
tmp = x1 + ((x1 * (x1 * 9.0d0)) + (x2 * (-6.0d0)))
else if ((x2 <= 1.8d+228) .or. (.not. (x2 <= 3.8d+246))) then
tmp = t_0
else
tmp = (x1 * 2.0d0) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x2 <= -4.4e+170) {
tmp = t_0;
} else if (x2 <= 6.2e+72) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x2 <= 1.8e+228) || !(x2 <= 3.8e+246)) {
tmp = t_0;
} else {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * 8.0) * (x1 * x2)) tmp = 0 if x2 <= -4.4e+170: tmp = t_0 elif x2 <= 6.2e+72: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) elif (x2 <= 1.8e+228) or not (x2 <= 3.8e+246): tmp = t_0 else: tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * 8.0) * Float64(x1 * x2))) tmp = 0.0 if (x2 <= -4.4e+170) tmp = t_0; elseif (x2 <= 6.2e+72) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); elseif ((x2 <= 1.8e+228) || !(x2 <= 3.8e+246)) tmp = t_0; else tmp = Float64(Float64(x1 * 2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * 8.0) * (x1 * x2)); tmp = 0.0; if (x2 <= -4.4e+170) tmp = t_0; elseif (x2 <= 6.2e+72) tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); elseif ((x2 <= 1.8e+228) || ~((x2 <= 3.8e+246))) tmp = t_0; else tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * 8.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -4.4e+170], t$95$0, If[LessEqual[x2, 6.2e+72], N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x2, 1.8e+228], N[Not[LessEqual[x2, 3.8e+246]], $MachinePrecision]], t$95$0, N[(N[(x1 * 2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot 8\right) \cdot \left(x1 \cdot x2\right)\\
\mathbf{if}\;x2 \leq -4.4 \cdot 10^{+170}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq 6.2 \cdot 10^{+72}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x2 \leq 1.8 \cdot 10^{+228} \lor \neg \left(x2 \leq 3.8 \cdot 10^{+246}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\end{array}
\end{array}
if x2 < -4.39999999999999978e170 or 6.19999999999999977e72 < x2 < 1.8e228 or 3.79999999999999976e246 < x2 Initial program 73.5%
Taylor expanded in x1 around 0 51.8%
Taylor expanded in x2 around inf 59.8%
*-commutative59.8%
associate-*r*59.8%
unpow259.8%
associate-*r*59.8%
associate-*r*70.8%
*-commutative70.8%
Simplified70.8%
if -4.39999999999999978e170 < x2 < 6.19999999999999977e72Initial program 68.9%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x2 around 0 72.6%
*-commutative72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in x1 around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-*r*57.4%
Simplified57.4%
if 1.8e228 < x2 < 3.79999999999999976e246Initial program 28.3%
Taylor expanded in x1 around 0 1.0%
Taylor expanded in x1 around 0 15.3%
*-commutative15.3%
Simplified15.3%
Taylor expanded in x2 around 0 77.0%
Final simplification61.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* (* x2 8.0) (* x1 x2)))))
(if (<= x2 -1.12e+170)
t_0
(if (<= x2 5.1e+72)
(+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0)))
(if (or (<= x2 2.65e+221) (not (<= x2 7e+247)))
t_0
(- x1 (* x2 (+ 6.0 (* (* x1 x1) -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x2 <= -1.12e+170) {
tmp = t_0;
} else if (x2 <= 5.1e+72) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x2 <= 2.65e+221) || !(x2 <= 7e+247)) {
tmp = t_0;
} else {
tmp = x1 - (x2 * (6.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) :: tmp
t_0 = x1 + ((x2 * 8.0d0) * (x1 * x2))
if (x2 <= (-1.12d+170)) then
tmp = t_0
else if (x2 <= 5.1d+72) then
tmp = x1 + ((x1 * (x1 * 9.0d0)) + (x2 * (-6.0d0)))
else if ((x2 <= 2.65d+221) .or. (.not. (x2 <= 7d+247))) then
tmp = t_0
else
tmp = x1 - (x2 * (6.0d0 + ((x1 * x1) * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x2 <= -1.12e+170) {
tmp = t_0;
} else if (x2 <= 5.1e+72) {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
} else if ((x2 <= 2.65e+221) || !(x2 <= 7e+247)) {
tmp = t_0;
} else {
tmp = x1 - (x2 * (6.0 + ((x1 * x1) * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * 8.0) * (x1 * x2)) tmp = 0 if x2 <= -1.12e+170: tmp = t_0 elif x2 <= 5.1e+72: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) elif (x2 <= 2.65e+221) or not (x2 <= 7e+247): tmp = t_0 else: tmp = x1 - (x2 * (6.0 + ((x1 * x1) * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * 8.0) * Float64(x1 * x2))) tmp = 0.0 if (x2 <= -1.12e+170) tmp = t_0; elseif (x2 <= 5.1e+72) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); elseif ((x2 <= 2.65e+221) || !(x2 <= 7e+247)) tmp = t_0; else tmp = Float64(x1 - Float64(x2 * Float64(6.0 + Float64(Float64(x1 * x1) * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * 8.0) * (x1 * x2)); tmp = 0.0; if (x2 <= -1.12e+170) tmp = t_0; elseif (x2 <= 5.1e+72) tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); elseif ((x2 <= 2.65e+221) || ~((x2 <= 7e+247))) tmp = t_0; else tmp = x1 - (x2 * (6.0 + ((x1 * x1) * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * 8.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.12e+170], t$95$0, If[LessEqual[x2, 5.1e+72], N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x2, 2.65e+221], N[Not[LessEqual[x2, 7e+247]], $MachinePrecision]], t$95$0, N[(x1 - N[(x2 * N[(6.0 + N[(N[(x1 * x1), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot 8\right) \cdot \left(x1 \cdot x2\right)\\
\mathbf{if}\;x2 \leq -1.12 \cdot 10^{+170}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq 5.1 \cdot 10^{+72}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x2 \leq 2.65 \cdot 10^{+221} \lor \neg \left(x2 \leq 7 \cdot 10^{+247}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x1 - x2 \cdot \left(6 + \left(x1 \cdot x1\right) \cdot -6\right)\\
\end{array}
\end{array}
if x2 < -1.1200000000000001e170 or 5.09999999999999977e72 < x2 < 2.6499999999999998e221 or 7.0000000000000004e247 < x2 Initial program 74.6%
Taylor expanded in x1 around 0 52.5%
Taylor expanded in x2 around inf 59.2%
*-commutative59.2%
associate-*r*59.2%
unpow259.2%
associate-*r*59.2%
associate-*r*70.4%
*-commutative70.4%
Simplified70.4%
if -1.1200000000000001e170 < x2 < 5.09999999999999977e72Initial program 68.9%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x2 around 0 72.6%
*-commutative72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in x1 around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-*r*57.4%
Simplified57.4%
if 2.6499999999999998e221 < x2 < 7.0000000000000004e247Initial program 24.8%
Taylor expanded in x1 around 0 0.9%
Taylor expanded in x1 around 0 25.9%
Taylor expanded in x1 around inf 92.4%
associate-*r*92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
unpow292.4%
+-commutative92.4%
distribute-lft-neg-in92.4%
*-commutative92.4%
distribute-lft-neg-in92.4%
metadata-eval92.4%
count-292.4%
Simplified92.4%
Taylor expanded in x2 around -inf 92.4%
mul-1-neg92.4%
*-commutative92.4%
unpow292.4%
Simplified92.4%
Final simplification62.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* x1 9.0)))) (t_1 (+ x1 (* 8.0 (* x1 (* x2 x2))))))
(if (<= x1 -4.8e+108)
t_0
(if (<= x1 -4.2e-159)
t_1
(if (<= x1 1.05e-90) (* x2 -6.0) (if (<= x1 4.5e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x1 * (x2 * x2)));
double tmp;
if (x1 <= -4.8e+108) {
tmp = t_0;
} else if (x1 <= -4.2e-159) {
tmp = t_1;
} else if (x1 <= 1.05e-90) {
tmp = x2 * -6.0;
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = 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) :: tmp
t_0 = x1 + (x1 * (x1 * 9.0d0))
t_1 = x1 + (8.0d0 * (x1 * (x2 * x2)))
if (x1 <= (-4.8d+108)) then
tmp = t_0
else if (x1 <= (-4.2d-159)) then
tmp = t_1
else if (x1 <= 1.05d-90) then
tmp = x2 * (-6.0d0)
else if (x1 <= 4.5d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x1 * (x2 * x2)));
double tmp;
if (x1 <= -4.8e+108) {
tmp = t_0;
} else if (x1 <= -4.2e-159) {
tmp = t_1;
} else if (x1 <= 1.05e-90) {
tmp = x2 * -6.0;
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (x1 * 9.0)) t_1 = x1 + (8.0 * (x1 * (x2 * x2))) tmp = 0 if x1 <= -4.8e+108: tmp = t_0 elif x1 <= -4.2e-159: tmp = t_1 elif x1 <= 1.05e-90: tmp = x2 * -6.0 elif x1 <= 4.5e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))) t_1 = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))) tmp = 0.0 if (x1 <= -4.8e+108) tmp = t_0; elseif (x1 <= -4.2e-159) tmp = t_1; elseif (x1 <= 1.05e-90) tmp = Float64(x2 * -6.0); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (x1 * 9.0)); t_1 = x1 + (8.0 * (x1 * (x2 * x2))); tmp = 0.0; if (x1 <= -4.8e+108) tmp = t_0; elseif (x1 <= -4.2e-159) tmp = t_1; elseif (x1 <= 1.05e-90) tmp = x2 * -6.0; elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+108], t$95$0, If[LessEqual[x1, -4.2e-159], t$95$1, If[LessEqual[x1, 1.05e-90], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.05 \cdot 10^{-90}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -4.80000000000000037e108 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x1 around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
cancel-sign-sub-inv61.9%
unpow261.9%
+-commutative61.9%
distribute-lft-neg-in61.9%
*-commutative61.9%
distribute-lft-neg-in61.9%
metadata-eval61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
associate-*r*86.9%
Simplified86.9%
if -4.80000000000000037e108 < x1 < -4.1999999999999998e-159 or 1.05e-90 < x1 < 4.5000000000000001e153Initial program 98.4%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around inf 34.1%
*-commutative34.1%
unpow234.1%
Simplified34.1%
if -4.1999999999999998e-159 < x1 < 1.05e-90Initial program 99.4%
Taylor expanded in x1 around 0 78.2%
Taylor expanded in x1 around 0 66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in x1 around 0 67.4%
*-commutative67.4%
Simplified67.4%
Final simplification60.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* x1 9.0)))) (t_1 (+ x1 (* (* x2 8.0) (* x1 x2)))))
(if (<= x1 -6e+108)
t_0
(if (<= x1 -4.2e-159)
t_1
(if (<= x1 1.25e-90) (* x2 -6.0) (if (<= x1 4.5e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x1 <= -6e+108) {
tmp = t_0;
} else if (x1 <= -4.2e-159) {
tmp = t_1;
} else if (x1 <= 1.25e-90) {
tmp = x2 * -6.0;
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = 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) :: tmp
t_0 = x1 + (x1 * (x1 * 9.0d0))
t_1 = x1 + ((x2 * 8.0d0) * (x1 * x2))
if (x1 <= (-6d+108)) then
tmp = t_0
else if (x1 <= (-4.2d-159)) then
tmp = t_1
else if (x1 <= 1.25d-90) then
tmp = x2 * (-6.0d0)
else if (x1 <= 4.5d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + ((x2 * 8.0) * (x1 * x2));
double tmp;
if (x1 <= -6e+108) {
tmp = t_0;
} else if (x1 <= -4.2e-159) {
tmp = t_1;
} else if (x1 <= 1.25e-90) {
tmp = x2 * -6.0;
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (x1 * 9.0)) t_1 = x1 + ((x2 * 8.0) * (x1 * x2)) tmp = 0 if x1 <= -6e+108: tmp = t_0 elif x1 <= -4.2e-159: tmp = t_1 elif x1 <= 1.25e-90: tmp = x2 * -6.0 elif x1 <= 4.5e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))) t_1 = Float64(x1 + Float64(Float64(x2 * 8.0) * Float64(x1 * x2))) tmp = 0.0 if (x1 <= -6e+108) tmp = t_0; elseif (x1 <= -4.2e-159) tmp = t_1; elseif (x1 <= 1.25e-90) tmp = Float64(x2 * -6.0); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (x1 * 9.0)); t_1 = x1 + ((x2 * 8.0) * (x1 * x2)); tmp = 0.0; if (x1 <= -6e+108) tmp = t_0; elseif (x1 <= -4.2e-159) tmp = t_1; elseif (x1 <= 1.25e-90) tmp = x2 * -6.0; elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * 8.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6e+108], t$95$0, If[LessEqual[x1, -4.2e-159], t$95$1, If[LessEqual[x1, 1.25e-90], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 + \left(x2 \cdot 8\right) \cdot \left(x1 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{-90}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -5.99999999999999968e108 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x1 around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
cancel-sign-sub-inv61.9%
unpow261.9%
+-commutative61.9%
distribute-lft-neg-in61.9%
*-commutative61.9%
distribute-lft-neg-in61.9%
metadata-eval61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
associate-*r*86.9%
Simplified86.9%
if -5.99999999999999968e108 < x1 < -4.1999999999999998e-159 or 1.25000000000000005e-90 < x1 < 4.5000000000000001e153Initial program 98.4%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around inf 34.1%
*-commutative34.1%
associate-*r*34.1%
unpow234.1%
associate-*r*34.1%
associate-*r*36.0%
*-commutative36.0%
Simplified36.0%
if -4.1999999999999998e-159 < x1 < 1.25000000000000005e-90Initial program 99.4%
Taylor expanded in x1 around 0 78.2%
Taylor expanded in x1 around 0 66.9%
*-commutative66.9%
Simplified66.9%
Taylor expanded in x1 around 0 67.4%
*-commutative67.4%
Simplified67.4%
Final simplification61.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.68e+149) (not (<= x2 1.55e+63))) (+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2))))) (+ x1 (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.68e+149) || !(x2 <= 1.55e+63)) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} 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.68d+149)) .or. (.not. (x2 <= 1.55d+63))) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
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.68e+149) || !(x2 <= 1.55e+63)) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) + -2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.68e+149) or not (x2 <= 1.55e+63): tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) + -2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.68e+149) || !(x2 <= 1.55e+63)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); 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.68e+149) || ~((x2 <= 1.55e+63))) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); 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.68e+149], N[Not[LessEqual[x2, 1.55e+63]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $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.68 \cdot 10^{+149} \lor \neg \left(x2 \leq 1.55 \cdot 10^{+63}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\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.67999999999999999e149 or 1.55e63 < x2 Initial program 70.1%
Taylor expanded in x1 around 0 45.8%
Taylor expanded in x1 around 0 50.6%
Taylor expanded in x2 around 0 57.7%
*-commutative57.7%
unpow257.7%
Simplified57.7%
Taylor expanded in x2 around inf 58.9%
*-commutative58.9%
unpow258.9%
associate-*l*80.3%
*-commutative80.3%
Simplified80.3%
if -1.67999999999999999e149 < x2 < 1.55e63Initial program 68.6%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x1 around 0 70.4%
Taylor expanded in x2 around 0 73.4%
*-commutative73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x2 around 0 76.1%
+-commutative76.1%
*-commutative76.1%
unpow276.1%
associate-*r*76.1%
*-commutative76.1%
distribute-lft-out76.1%
Simplified76.1%
Final simplification77.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 9.0))))
(if (<= x1 -6e+108)
(+ x1 (+ t_0 (* x2 -6.0)))
(if (<= x1 4.5e+153)
(+ x1 (+ (* x2 -6.0) (* 8.0 (* x2 (* x1 x2)))))
(+ x1 t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double tmp;
if (x1 <= -6e+108) {
tmp = x1 + (t_0 + (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 + t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * (x1 * 9.0d0)
if (x1 <= (-6d+108)) then
tmp = x1 + (t_0 + (x2 * (-6.0d0)))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((x2 * (-6.0d0)) + (8.0d0 * (x2 * (x1 * x2))))
else
tmp = x1 + t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double tmp;
if (x1 <= -6e+108) {
tmp = x1 + (t_0 + (x2 * -6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2))));
} else {
tmp = x1 + t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 9.0) tmp = 0 if x1 <= -6e+108: tmp = x1 + (t_0 + (x2 * -6.0)) elif x1 <= 4.5e+153: tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))) else: tmp = x1 + t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 9.0)) tmp = 0.0 if (x1 <= -6e+108) tmp = Float64(x1 + Float64(t_0 + Float64(x2 * -6.0))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(8.0 * Float64(x2 * Float64(x1 * x2))))); else tmp = Float64(x1 + t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 9.0); tmp = 0.0; if (x1 <= -6e+108) tmp = x1 + (t_0 + (x2 * -6.0)); elseif (x1 <= 4.5e+153) tmp = x1 + ((x2 * -6.0) + (8.0 * (x2 * (x1 * x2)))); else tmp = x1 + t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6e+108], N[(x1 + N[(t$95$0 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+108}:\\
\;\;\;\;x1 + \left(t_0 + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + t_0\\
\end{array}
\end{array}
if x1 < -5.99999999999999968e108Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 34.0%
Taylor expanded in x2 around 0 38.3%
*-commutative38.3%
unpow238.3%
Simplified38.3%
Taylor expanded in x1 around inf 78.1%
*-commutative78.1%
unpow278.1%
associate-*r*78.1%
Simplified78.1%
if -5.99999999999999968e108 < x1 < 4.5000000000000001e153Initial program 98.8%
Taylor expanded in x1 around 0 69.8%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 70.5%
*-commutative70.5%
unpow270.5%
Simplified70.5%
Taylor expanded in x2 around inf 52.1%
*-commutative52.1%
unpow252.1%
associate-*l*62.2%
*-commutative62.2%
Simplified62.2%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 80.6%
Taylor expanded in x1 around inf 80.6%
associate-*r*80.6%
*-commutative80.6%
cancel-sign-sub-inv80.6%
unpow280.6%
+-commutative80.6%
distribute-lft-neg-in80.6%
*-commutative80.6%
distribute-lft-neg-in80.6%
metadata-eval80.6%
count-280.6%
Simplified80.6%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification69.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -5e+170) (not (<= x2 6.2e+72))) (+ x1 (* (* x2 8.0) (* x1 x2))) (+ x1 (+ (* x1 (* x1 9.0)) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+170) || !(x2 <= 6.2e+72)) {
tmp = x1 + ((x2 * 8.0) * (x1 * x2));
} else {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-5d+170)) .or. (.not. (x2 <= 6.2d+72))) then
tmp = x1 + ((x2 * 8.0d0) * (x1 * x2))
else
tmp = x1 + ((x1 * (x1 * 9.0d0)) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -5e+170) || !(x2 <= 6.2e+72)) {
tmp = x1 + ((x2 * 8.0) * (x1 * x2));
} else {
tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -5e+170) or not (x2 <= 6.2e+72): tmp = x1 + ((x2 * 8.0) * (x1 * x2)) else: tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -5e+170) || !(x2 <= 6.2e+72)) tmp = Float64(x1 + Float64(Float64(x2 * 8.0) * Float64(x1 * x2))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(x1 * 9.0)) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -5e+170) || ~((x2 <= 6.2e+72))) tmp = x1 + ((x2 * 8.0) * (x1 * x2)); else tmp = x1 + ((x1 * (x1 * 9.0)) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -5e+170], N[Not[LessEqual[x2, 6.2e+72]], $MachinePrecision]], N[(x1 + N[(N[(x2 * 8.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5 \cdot 10^{+170} \lor \neg \left(x2 \leq 6.2 \cdot 10^{+72}\right):\\
\;\;\;\;x1 + \left(x2 \cdot 8\right) \cdot \left(x1 \cdot x2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot 9\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x2 < -4.99999999999999977e170 or 6.19999999999999977e72 < x2 Initial program 69.5%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x2 around inf 55.8%
*-commutative55.8%
associate-*r*55.8%
unpow255.8%
associate-*r*55.8%
associate-*r*65.9%
*-commutative65.9%
Simplified65.9%
if -4.99999999999999977e170 < x2 < 6.19999999999999977e72Initial program 68.9%
Taylor expanded in x1 around 0 49.5%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x2 around 0 72.6%
*-commutative72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in x1 around inf 57.4%
*-commutative57.4%
unpow257.4%
associate-*r*57.4%
Simplified57.4%
Final simplification60.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9.4e-17) (not (<= x1 0.0019))) (+ x1 (* x1 (* x1 9.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.4e-17) || !(x1 <= 0.0019)) {
tmp = x1 + (x1 * (x1 * 9.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-9.4d-17)) .or. (.not. (x1 <= 0.0019d0))) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.4e-17) || !(x1 <= 0.0019)) {
tmp = x1 + (x1 * (x1 * 9.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9.4e-17) or not (x1 <= 0.0019): tmp = x1 + (x1 * (x1 * 9.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9.4e-17) || !(x1 <= 0.0019)) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -9.4e-17) || ~((x1 <= 0.0019))) tmp = x1 + (x1 * (x1 * 9.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9.4e-17], N[Not[LessEqual[x1, 0.0019]], $MachinePrecision]], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.4 \cdot 10^{-17} \lor \neg \left(x1 \leq 0.0019\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -9.3999999999999999e-17 or 0.0019 < x1 Initial program 39.1%
Taylor expanded in x1 around 0 12.4%
Taylor expanded in x1 around 0 42.5%
Taylor expanded in x1 around inf 44.7%
associate-*r*44.7%
*-commutative44.7%
cancel-sign-sub-inv44.7%
unpow244.7%
+-commutative44.7%
distribute-lft-neg-in44.7%
*-commutative44.7%
distribute-lft-neg-in44.7%
metadata-eval44.7%
count-244.7%
Simplified44.7%
Taylor expanded in x2 around 0 54.8%
*-commutative54.8%
unpow254.8%
associate-*r*54.8%
Simplified54.8%
if -9.3999999999999999e-17 < x1 < 0.0019Initial program 98.7%
Taylor expanded in x1 around 0 84.7%
Taylor expanded in x1 around 0 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in x1 around 0 50.7%
*-commutative50.7%
Simplified50.7%
Final simplification52.7%
(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 69.1%
Taylor expanded in x1 around 0 48.8%
Taylor expanded in x1 around 0 26.7%
*-commutative26.7%
Simplified26.7%
Taylor expanded in x1 around 0 26.7%
*-commutative26.7%
Simplified26.7%
Final simplification26.7%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 69.1%
Taylor expanded in x1 around 0 48.8%
Taylor expanded in x1 around 0 26.7%
*-commutative26.7%
Simplified26.7%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2023279
(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))))))