
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0)))))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (/ (- t_1 (fma x2 -2.0 x1)) (fma x1 x1 1.0)))
(t_3 (/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0)))
(t_4 (/ (- (fma x1 (* x1 3.0) (* x2 2.0)) x1) (fma x1 x1 1.0))))
(if (<= x1 -2e+154)
t_0
(if (<= x1 -5e+19)
(+
x1
(fma
3.0
t_3
(+
(* x1 (* (* x1 3.0) t_2))
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_2 (+ t_2 -3.0))) (* x1 (fma t_2 4.0 -6.0)))))))))
(if (<= x1 2e+152)
(+
x1
(fma
3.0
t_3
(+
x1
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_4 4.0 -6.0))
(* (* x1 (* 2.0 t_4)) (+ -3.0 t_4)))
(fma t_1 t_4 (pow x1 3.0))))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
double t_1 = 3.0 * (x1 * x1);
double t_2 = (t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0);
double t_3 = (t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0);
double t_4 = (fma(x1, (x1 * 3.0), (x2 * 2.0)) - x1) / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -2e+154) {
tmp = t_0;
} else if (x1 <= -5e+19) {
tmp = x1 + fma(3.0, t_3, ((x1 * ((x1 * 3.0) * t_2)) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_2 * (t_2 + -3.0))) + (x1 * fma(t_2, 4.0, -6.0))))))));
} else if (x1 <= 2e+152) {
tmp = x1 + fma(3.0, t_3, (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_4)) * (-3.0 + t_4))), fma(t_1, t_4, pow(x1, 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(Float64(t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0)) t_3 = Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)) t_4 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(x2 * 2.0)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -2e+154) tmp = t_0; elseif (x1 <= -5e+19) tmp = Float64(x1 + fma(3.0, t_3, Float64(Float64(x1 * Float64(Float64(x1 * 3.0) * t_2)) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_2 * Float64(t_2 + -3.0))) + Float64(x1 * fma(t_2, 4.0, -6.0))))))))); elseif (x1 <= 2e+152) tmp = Float64(x1 + fma(3.0, t_3, Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_4)) * Float64(-3.0 + t_4))), fma(t_1, t_4, (x1 ^ 3.0)))))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 - N[(x2 * -2.0 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+154], t$95$0, If[LessEqual[x1, -5e+19], N[(x1 + N[(3.0 * t$95$3 + N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$2 * N[(t$95$2 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+152], N[(x1 + N[(3.0 * t$95$3 + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(-3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := \frac{t_1 - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, x2 \cdot 2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t_3, x1 \cdot \left(\left(x1 \cdot 3\right) \cdot t_2\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_2 \cdot \left(t_2 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t_2, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, t_3, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t_4\right)\right) \cdot \left(-3 + t_4\right)\right), \mathsf{fma}\left(t_1, t_4, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154 or 2.0000000000000001e152 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x1 around inf 100.0%
if -2.00000000000000007e154 < x1 < -5e19Initial program 48.1%
Simplified99.5%
if -5e19 < x1 < 2.0000000000000001e152Initial program 99.4%
Simplified99.7%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0)))))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- t_1 (fma x2 -2.0 x1)) (fma x1 x1 1.0)))
(t_4 (* x1 (* x1 3.0)))
(t_5 (/ (- (+ (* x2 2.0) t_4) x1) t_2)))
(if (<= x1 -2e+154)
t_0
(if (<= x1 -700000000000.0)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
(* x1 (* (* x1 3.0) t_3))
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_3 (+ t_3 -3.0))) (* x1 (fma t_3 4.0 -6.0)))))))))
(if (<= x1 2e+152)
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_5 (* x1 2.0)) (- t_5 3.0))
(* (* x1 x1) (- (* 4.0 t_5) 6.0))))
(* t_4 t_5))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_4 (* x2 2.0)) x1) t_2))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
double t_1 = 3.0 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0);
double t_4 = x1 * (x1 * 3.0);
double t_5 = (((x2 * 2.0) + t_4) - x1) / t_2;
double tmp;
if (x1 <= -2e+154) {
tmp = t_0;
} else if (x1 <= -700000000000.0) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), ((x1 * ((x1 * 3.0) * t_3)) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_3 * (t_3 + -3.0))) + (x1 * fma(t_3, 4.0, -6.0))))))));
} else if (x1 <= 2e+152) {
tmp = x1 + ((x1 + (((t_2 * (((t_5 * (x1 * 2.0)) * (t_5 - 3.0)) + ((x1 * x1) * ((4.0 * t_5) - 6.0)))) + (t_4 * t_5)) + (x1 * (x1 * x1)))) + (3.0 * (((t_4 - (x2 * 2.0)) - x1) / t_2)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(t_1 - fma(x2, -2.0, x1)) / fma(x1, x1, 1.0)) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_4) - x1) / t_2) tmp = 0.0 if (x1 <= -2e+154) tmp = t_0; elseif (x1 <= -700000000000.0) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(Float64(x1 * Float64(Float64(x1 * 3.0) * t_3)) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_3 * Float64(t_3 + -3.0))) + Float64(x1 * fma(t_3, 4.0, -6.0))))))))); elseif (x1 <= 2e+152) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_5 * Float64(x1 * 2.0)) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_5) - 6.0)))) + Float64(t_4 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(x2 * 2.0)) - x1) / t_2)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[(x2 * -2.0 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$4), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -2e+154], t$95$0, If[LessEqual[x1, -700000000000.0], 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[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$3 * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+152], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$4 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{t_1 - \mathsf{fma}\left(x2, -2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(x2 \cdot 2 + t_4\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -700000000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_1 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 \cdot \left(\left(x1 \cdot 3\right) \cdot t_3\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_3 \cdot \left(t_3 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_5 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_5 - 6\right)\right) + t_4 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_4 - x2 \cdot 2\right) - x1}{t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154 or 2.0000000000000001e152 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x1 around inf 100.0%
if -2.00000000000000007e154 < x1 < -7e11Initial program 50.7%
Simplified99.4%
if -7e11 < x1 < 2.0000000000000001e152Initial program 99.4%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((-6.0 * x2) + (9.0 * Math.pow(x1, 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((-6.0 * x2) + (9.0 * math.pow(x1, 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((-6.0 * x2) + (9.0 * (x1 ^ 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around 0 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x1 around inf 79.8%
Final simplification92.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0)))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ (* x2 2.0) t_1) x1) t_2))
(t_4 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_2))))
(if (<= x1 -2e+154)
t_0
(if (<= x1 -5e+102)
(+ x1 (+ t_4 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 2e+152)
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
t_4))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (((x2 * 2.0) + t_1) - x1) / t_2;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double tmp;
if (x1 <= -2e+154) {
tmp = t_0;
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 2e+152) {
tmp = x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4);
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 + (((-6.0d0) * x2) + (9.0d0 * (x1 ** 2.0d0)))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = (((x2 * 2.0d0) + t_1) - x1) / t_2
t_4 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_2)
if (x1 <= (-2d+154)) then
tmp = t_0
else if (x1 <= (-5d+102)) then
tmp = x1 + (t_4 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 2d+152) then
tmp = x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_3) - 6.0d0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((-6.0 * x2) + (9.0 * Math.pow(x1, 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (((x2 * 2.0) + t_1) - x1) / t_2;
double t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double tmp;
if (x1 <= -2e+154) {
tmp = t_0;
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 2e+152) {
tmp = x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4);
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((-6.0 * x2) + (9.0 * math.pow(x1, 2.0))) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = (((x2 * 2.0) + t_1) - x1) / t_2 t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2) tmp = 0 if x1 <= -2e+154: tmp = t_0 elif x1 <= -5e+102: tmp = x1 + (t_4 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 2e+152: tmp = x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_2) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_2)) tmp = 0.0 if (x1 <= -2e+154) tmp = t_0; elseif (x1 <= -5e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 2e+152) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + t_4)); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((-6.0 * x2) + (9.0 * (x1 ^ 2.0))); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = (((x2 * 2.0) + t_1) - x1) / t_2; t_4 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2); tmp = 0.0; if (x1 <= -2e+154) tmp = t_0; elseif (x1 <= -5e+102) tmp = x1 + (t_4 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 2e+152) tmp = x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + t_4); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+154], t$95$0, If[LessEqual[x1, -5e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+152], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_2}\\
t_4 := 3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + t_1 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_4\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -2.00000000000000007e154 or 2.0000000000000001e152 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x1 around inf 100.0%
if -2.00000000000000007e154 < x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < 2.0000000000000001e152Initial program 99.3%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (or (<= x1 -5.5e+102) (not (<= x1 2e+152)))
(+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 2e+152)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if ((x1 <= (-5.5d+102)) .or. (.not. (x1 <= 2d+152))) then
tmp = x1 + (((-6.0d0) * x2) + (9.0d0 * (x1 ** 2.0d0)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)))) + (3.0d0 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -5.5e+102) || !(x1 <= 2e+152)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * Math.pow(x1, 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if (x1 <= -5.5e+102) or not (x1 <= 2e+152): tmp = x1 + ((-6.0 * x2) + (9.0 * math.pow(x1, 2.0))) else: tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.5e+102) || !(x1 <= 2e+152)) tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(3.0 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.5e+102) || ~((x1 <= 2e+152))) tmp = x1 + ((-6.0 * x2) + (9.0 * (x1 ^ 2.0))); else tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (3.0 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.5e+102], N[Not[LessEqual[x1, 2e+152]], $MachinePrecision]], N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102} \lor \neg \left(x1 \leq 2 \cdot 10^{+152}\right):\\
\;\;\;\;x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102 or 2.0000000000000001e152 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around 0 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x1 around inf 79.8%
if -5.49999999999999981e102 < x1 < 2.0000000000000001e152Initial program 99.3%
Taylor expanded in x1 around inf 96.7%
Final simplification91.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (or (<= x1 -6e+102) (not (<= x1 4.5e+153)))
(+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0))))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (- t_2 3.0) (* (- (* x2 2.0) x1) (* x1 2.0))))))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -6e+102) || !(x1 <= 4.5e+153)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if ((x1 <= (-6d+102)) .or. (.not. (x1 <= 4.5d+153))) then
tmp = x1 + (((-6.0d0) * x2) + (9.0d0 * (x1 ** 2.0d0)))
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + ((t_2 - 3.0d0) * (((x2 * 2.0d0) - x1) * (x1 * 2.0d0)))))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -6e+102) || !(x1 <= 4.5e+153)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * Math.pow(x1, 2.0)));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if (x1 <= -6e+102) or not (x1 <= 4.5e+153): tmp = x1 + ((-6.0 * x2) + (9.0 * math.pow(x1, 2.0))) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if ((x1 <= -6e+102) || !(x1 <= 4.5e+153)) tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)))))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if ((x1 <= -6e+102) || ~((x1 <= 4.5e+153))) tmp = x1 + ((-6.0 * x2) + (9.0 * (x1 ^ 2.0))); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -6e+102], N[Not[LessEqual[x1, 4.5e+153]], $MachinePrecision]], N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $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 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+102} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.9999999999999996e102 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around 0 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x1 around inf 79.8%
if -5.9999999999999996e102 < x1 < 4.5000000000000001e153Initial program 99.3%
Taylor expanded in x1 around 0 93.0%
+-commutative93.0%
mul-1-neg93.0%
sub-neg93.0%
Simplified93.0%
Taylor expanded in x1 around inf 91.8%
Taylor expanded in x1 around 0 93.0%
mul-1-neg93.0%
unsub-neg93.0%
*-commutative93.0%
Simplified93.0%
Final simplification88.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (or (<= x1 -6.2e+102) (not (<= x1 2e+152)))
(+ x1 (+ (* -6.0 x2) (* 9.0 (pow x1 2.0))))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* t_2 (* x1 2.0)) (- t_2 3.0)) (* (* x1 x1) 6.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -6.2e+102) || !(x1 <= 2e+152)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * pow(x1, 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if ((x1 <= (-6.2d+102)) .or. (.not. (x1 <= 2d+152))) then
tmp = x1 + (((-6.0d0) * x2) + (9.0d0 * (x1 ** 2.0d0)))
else
tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if ((x1 <= -6.2e+102) || !(x1 <= 2e+152)) {
tmp = x1 + ((-6.0 * x2) + (9.0 * Math.pow(x1, 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if (x1 <= -6.2e+102) or not (x1 <= 2e+152): tmp = x1 + ((-6.0 * x2) + (9.0 * math.pow(x1, 2.0))) else: tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if ((x1 <= -6.2e+102) || !(x1 <= 2e+152)) tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(9.0 * (x1 ^ 2.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if ((x1 <= -6.2e+102) || ~((x1 <= 2e+152))) tmp = x1 + ((-6.0 * x2) + (9.0 * (x1 ^ 2.0))); else tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -6.2e+102], N[Not[LessEqual[x1, 2e+152]], $MachinePrecision]], N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(9.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+102} \lor \neg \left(x1 \leq 2 \cdot 10^{+152}\right):\\
\;\;\;\;x1 + \left(-6 \cdot x2 + 9 \cdot {x1}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -6.19999999999999973e102 or 2.0000000000000001e152 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around 0 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x1 around inf 79.8%
if -6.19999999999999973e102 < x1 < 2.0000000000000001e152Initial program 99.3%
Taylor expanded in x1 around inf 94.7%
Final simplification89.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ (* x2 2.0) t_1) x1) t_0)))
(if (<= x1 1.3e+154)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (- t_2 3.0) (* (- (* x2 2.0) x1) (* x1 2.0))))))))
(* 3.0 (- (* x2 -2.0) x1))))
(/ (pow x1 2.0) (+ x1 (* 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 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= 1.3e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = pow(x1, 2.0) / (x1 + (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 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (((x2 * 2.0d0) + t_1) - x1) / t_0
if (x1 <= 1.3d+154) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + ((t_2 - 3.0d0) * (((x2 * 2.0d0) - x1) * (x1 * 2.0d0)))))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x1 ** 2.0d0) / (x1 + (x2 * 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= 1.3e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = Math.pow(x1, 2.0) / (x1 + (x2 * 6.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (((x2 * 2.0) + t_1) - x1) / t_0 tmp = 0 if x1 <= 1.3e+154: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = math.pow(x1, 2.0) / (x1 + (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(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) tmp = 0.0 if (x1 <= 1.3e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)))))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64((x1 ^ 2.0) / Float64(x1 + 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 = (((x2 * 2.0) + t_1) - x1) / t_0; tmp = 0.0; if (x1 <= 1.3e+154) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x1 ^ 2.0) / (x1 + (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[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, 1.3e+154], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 2.0], $MachinePrecision] / N[(x1 + 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 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{x1}^{2}}{x1 + x2 \cdot 6}\\
\end{array}
\end{array}
if x1 < 1.29999999999999994e154Initial program 73.3%
Taylor expanded in x1 around 0 68.7%
+-commutative68.7%
mul-1-neg68.7%
sub-neg68.7%
Simplified68.7%
Taylor expanded in x1 around inf 67.8%
Taylor expanded in x1 around 0 68.6%
mul-1-neg68.6%
unsub-neg68.6%
*-commutative68.6%
Simplified68.6%
if 1.29999999999999994e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 7.0%
*-commutative7.0%
Simplified7.0%
flip-+74.1%
pow274.1%
pow274.1%
Applied egg-rr74.1%
unpow274.1%
swap-sqr74.1%
unpow274.1%
metadata-eval74.1%
*-commutative74.1%
cancel-sign-sub-inv74.1%
metadata-eval74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in x1 around inf 92.6%
Final simplification71.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0)) (t_1 (* x1 (* x1 3.0))))
(if (or (<= (* x2 2.0) -8.5e+36) (not (<= (* x2 2.0) 1e+72)))
(+ x1 (+ (* -6.0 x2) (* x1 (- (* 4.0 (* x2 (- (* x2 2.0) 3.0))) 2.0))))
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ (* x2 2.0) t_1) x1) t_0)) 6.0))
(* (* (- (* x2 2.0) x1) (* x1 2.0)) 0.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double tmp;
if (((x2 * 2.0) <= -8.5e+36) || !((x2 * 2.0) <= 1e+72)) {
tmp = x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + ((((x2 * 2.0) - x1) * (x1 * 2.0)) * 0.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) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
if (((x2 * 2.0d0) <= (-8.5d+36)) .or. (.not. ((x2 * 2.0d0) <= 1d+72))) then
tmp = x1 + (((-6.0d0) * x2) + (x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) - 2.0d0)))
else
tmp = x1 + ((3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * ((4.0d0 * ((((x2 * 2.0d0) + t_1) - x1) / t_0)) - 6.0d0)) + ((((x2 * 2.0d0) - x1) * (x1 * 2.0d0)) * 0.0d0)))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double tmp;
if (((x2 * 2.0) <= -8.5e+36) || !((x2 * 2.0) <= 1e+72)) {
tmp = x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + ((((x2 * 2.0) - x1) * (x1 * 2.0)) * 0.0)))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) tmp = 0 if ((x2 * 2.0) <= -8.5e+36) or not ((x2 * 2.0) <= 1e+72): tmp = x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0))) else: tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + ((((x2 * 2.0) - x1) * (x1 * 2.0)) * 0.0))))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if ((Float64(x2 * 2.0) <= -8.5e+36) || !(Float64(x2 * 2.0) <= 1e+72)) tmp = Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + Float64(Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)) * 0.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); tmp = 0.0; if (((x2 * 2.0) <= -8.5e+36) || ~(((x2 * 2.0) <= 1e+72))) tmp = x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0))); else tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + ((((x2 * 2.0) - x1) * (x1 * 2.0)) * 0.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]}, If[Or[LessEqual[N[(x2 * 2.0), $MachinePrecision], -8.5e+36], N[Not[LessEqual[N[(x2 * 2.0), $MachinePrecision], 1e+72]], $MachinePrecision]], N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x2 \cdot 2 \leq -8.5 \cdot 10^{+36} \lor \neg \left(x2 \cdot 2 \leq 10^{+72}\right):\\
\;\;\;\;x1 + \left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0} - 6\right) + \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right) \cdot 0\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -8.50000000000000014e36 or 9.99999999999999944e71 < (*.f64 2 x2) Initial program 66.3%
Taylor expanded in x1 around 0 47.3%
Taylor expanded in x1 around 0 57.2%
if -8.50000000000000014e36 < (*.f64 2 x2) < 9.99999999999999944e71Initial program 65.1%
Taylor expanded in x1 around 0 60.8%
+-commutative60.8%
mul-1-neg60.8%
sub-neg60.8%
Simplified60.8%
Taylor expanded in x1 around inf 59.5%
Taylor expanded in x1 around inf 61.8%
Final simplification60.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ (* x2 2.0) t_1) x1) t_0)))
(if (<= x1 7.8e+153)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (- t_2 3.0) (* (- (* x2 2.0) x1) (* x1 2.0))))))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= 7.8e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (((x2 * 2.0d0) + t_1) - x1) / t_0
if (x1 <= 7.8d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + ((t_2 - 3.0d0) * (((x2 * 2.0d0) - x1) * (x1 * 2.0d0)))))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= 7.8e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (((x2 * 2.0) + t_1) - x1) / t_0 tmp = 0 if x1 <= 7.8e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) tmp = 0.0 if (x1 <= 7.8e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)))))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.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 = (((x2 * 2.0) + t_1) - x1) / t_0; tmp = 0.0; if (x1 <= 7.8e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + ((t_2 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, 7.8e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(t_2 - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 7.79999999999999966e153Initial program 73.3%
Taylor expanded in x1 around 0 68.7%
+-commutative68.7%
mul-1-neg68.7%
sub-neg68.7%
Simplified68.7%
Taylor expanded in x1 around inf 67.8%
Taylor expanded in x1 around 0 68.6%
mul-1-neg68.6%
unsub-neg68.6%
*-commutative68.6%
Simplified68.6%
if 7.79999999999999966e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.1%
Final simplification66.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0)))
(t_3 (* x2 (- (* x2 2.0) 3.0)))
(t_4
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ (* x2 2.0) t_1) x1) t_0)) 6.0))
(* 4.0 (* x1 t_3)))))))))))
(if (<= x1 -2.4e-226)
t_4
(if (<= x1 1e-221)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 (* x2 -3.0))))))
(if (<= x1 1.32e+154) t_4 (+ x1 (* x1 (+ 1.0 (* 4.0 t_3)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0);
double t_3 = x2 * ((x2 * 2.0) - 3.0);
double t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + (4.0 * (x1 * t_3))))))));
double tmp;
if (x1 <= -2.4e-226) {
tmp = t_4;
} else if (x1 <= 1e-221) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 1.32e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_3)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_0)
t_3 = x2 * ((x2 * 2.0d0) - 3.0d0)
t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * ((4.0d0 * ((((x2 * 2.0d0) + t_1) - x1) / t_0)) - 6.0d0)) + (4.0d0 * (x1 * t_3))))))))
if (x1 <= (-2.4d-226)) then
tmp = t_4
else if (x1 <= 1d-221) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
else if (x1 <= 1.32d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_3)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0);
double t_3 = x2 * ((x2 * 2.0) - 3.0);
double t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + (4.0 * (x1 * t_3))))))));
double tmp;
if (x1 <= -2.4e-226) {
tmp = t_4;
} else if (x1 <= 1e-221) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 1.32e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_3)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0) t_3 = x2 * ((x2 * 2.0) - 3.0) t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + (4.0 * (x1 * t_3)))))))) tmp = 0 if x1 <= -2.4e-226: tmp = t_4 elif x1 <= 1e-221: tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0))))) elif x1 <= 1.32e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_3))) 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(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) t_3 = Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)) t_4 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + Float64(4.0 * Float64(x1 * t_3))))))))) tmp = 0.0 if (x1 <= -2.4e-226) tmp = t_4; elseif (x1 <= 1e-221) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); elseif (x1 <= 1.32e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_3)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0); t_3 = x2 * ((x2 * 2.0) - 3.0); t_4 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_1) - x1) / t_0)) - 6.0)) + (4.0 * (x1 * t_3)))))))); tmp = 0.0; if (x1 <= -2.4e-226) tmp = t_4; elseif (x1 <= 1e-221) tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0))))); elseif (x1 <= 1.32e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 + (4.0 * t_3))); 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[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e-226], t$95$4, If[LessEqual[x1, 1e-221], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.32e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$3), $MachinePrecision]), $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 := 3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0}\\
t_3 := x2 \cdot \left(x2 \cdot 2 - 3\right)\\
t_4 := x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0} - 6\right) + 4 \cdot \left(x1 \cdot t_3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{-226}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 10^{-221}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_3\right)\\
\end{array}
\end{array}
if x1 < -2.4e-226 or 1.00000000000000002e-221 < x1 < 1.31999999999999998e154Initial program 68.9%
Taylor expanded in x1 around 0 63.4%
+-commutative63.4%
mul-1-neg63.4%
sub-neg63.4%
Simplified63.4%
Taylor expanded in x1 around inf 62.4%
Taylor expanded in x1 around 0 57.5%
if -2.4e-226 < x1 < 1.00000000000000002e-221Initial program 99.7%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
if 1.31999999999999998e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.1%
Final simplification60.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0)) (t_1 (* x1 (* x1 3.0))))
(if (<= x1 7.8e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+
(* (* x1 x1) 6.0)
(*
(- (/ (- (+ (* x2 2.0) t_1) x1) t_0) 3.0)
(* (- (* x2 2.0) x1) (* x1 2.0))))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= 7.8e+153) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + ((((((x2 * 2.0) + t_1) - x1) / t_0) - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
if (x1 <= 7.8d+153) then
tmp = x1 + ((3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * (((x1 * x1) * 6.0d0) + ((((((x2 * 2.0d0) + t_1) - x1) / t_0) - 3.0d0) * (((x2 * 2.0d0) - x1) * (x1 * 2.0d0)))))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double tmp;
if (x1 <= 7.8e+153) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + ((((((x2 * 2.0) + t_1) - x1) / t_0) - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) tmp = 0 if x1 <= 7.8e+153: tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + ((((((x2 * 2.0) + t_1) - x1) / t_0) - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0))))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) tmp = 0.0 if (x1 <= 7.8e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) - 3.0) * Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)))))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); tmp = 0.0; if (x1 <= 7.8e+153) tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * (((x1 * x1) * 6.0) + ((((((x2 * 2.0) + t_1) - x1) / t_0) - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0))))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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]}, If[LessEqual[x1, 7.8e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
\mathbf{if}\;x1 \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_1 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0} - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < 7.79999999999999966e153Initial program 73.3%
Taylor expanded in x1 around 0 68.7%
+-commutative68.7%
mul-1-neg68.7%
sub-neg68.7%
Simplified68.7%
Taylor expanded in x1 around inf 67.8%
Taylor expanded in x1 around inf 67.6%
if 7.79999999999999966e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.1%
Final simplification65.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* x2 2.0) 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ (* x2 2.0) t_2) x1) t_1)) 6.0))
(* x1 2.0))))))
(* 3.0 (* x2 -2.0)))))
(t_4 (* 3.0 (/ (- (- t_2 (* x2 2.0)) x1) t_1)))
(t_5 (+ x1 (+ t_4 (+ x1 (* 4.0 (* x1 t_0)))))))
(if (<= x1 -490000000.0)
t_3
(if (<= x1 -2.6e-227)
t_5
(if (<= x1 4.9e-223)
(+ x1 (+ t_4 (+ x1 (* 4.0 (* x1 (* x2 -3.0))))))
(if (<= x1 230000000000.0)
t_5
(if (<= x1 1.32e+154) t_3 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0)))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((x2 * 2.0) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_2) - x1) / t_1)) - 6.0)) + (x1 * 2.0)))))) + (3.0 * (x2 * -2.0)));
double t_4 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1);
double t_5 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_0))));
double tmp;
if (x1 <= -490000000.0) {
tmp = t_3;
} else if (x1 <= -2.6e-227) {
tmp = t_5;
} else if (x1 <= 4.9e-223) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 230000000000.0) {
tmp = t_5;
} else if (x1 <= 1.32e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x2 * ((x2 * 2.0d0) - 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_2) + (t_1 * (((x1 * x1) * ((4.0d0 * ((((x2 * 2.0d0) + t_2) - x1) / t_1)) - 6.0d0)) + (x1 * 2.0d0)))))) + (3.0d0 * (x2 * (-2.0d0))))
t_4 = 3.0d0 * (((t_2 - (x2 * 2.0d0)) - x1) / t_1)
t_5 = x1 + (t_4 + (x1 + (4.0d0 * (x1 * t_0))))
if (x1 <= (-490000000.0d0)) then
tmp = t_3
else if (x1 <= (-2.6d-227)) then
tmp = t_5
else if (x1 <= 4.9d-223) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
else if (x1 <= 230000000000.0d0) then
tmp = t_5
else if (x1 <= 1.32d+154) then
tmp = t_3
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((x2 * 2.0) - 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_2) - x1) / t_1)) - 6.0)) + (x1 * 2.0)))))) + (3.0 * (x2 * -2.0)));
double t_4 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1);
double t_5 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_0))));
double tmp;
if (x1 <= -490000000.0) {
tmp = t_3;
} else if (x1 <= -2.6e-227) {
tmp = t_5;
} else if (x1 <= 4.9e-223) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 230000000000.0) {
tmp = t_5;
} else if (x1 <= 1.32e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((x2 * 2.0) - 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_2) - x1) / t_1)) - 6.0)) + (x1 * 2.0)))))) + (3.0 * (x2 * -2.0))) t_4 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1) t_5 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_0)))) tmp = 0 if x1 <= -490000000.0: tmp = t_3 elif x1 <= -2.6e-227: tmp = t_5 elif x1 <= 4.9e-223: tmp = x1 + (t_4 + (x1 + (4.0 * (x1 * (x2 * -3.0))))) elif x1 <= 230000000000.0: tmp = t_5 elif x1 <= 1.32e+154: tmp = t_3 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(x2 * 2.0) + t_2) - x1) / t_1)) - 6.0)) + Float64(x1 * 2.0)))))) + Float64(3.0 * Float64(x2 * -2.0)))) t_4 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(x2 * 2.0)) - x1) / t_1)) t_5 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))) tmp = 0.0 if (x1 <= -490000000.0) tmp = t_3; elseif (x1 <= -2.6e-227) tmp = t_5; elseif (x1 <= 4.9e-223) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); elseif (x1 <= 230000000000.0) tmp = t_5; elseif (x1 <= 1.32e+154) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((x2 * 2.0) - 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_2) - x1) / t_1)) - 6.0)) + (x1 * 2.0)))))) + (3.0 * (x2 * -2.0))); t_4 = 3.0 * (((t_2 - (x2 * 2.0)) - x1) / t_1); t_5 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_0)))); tmp = 0.0; if (x1 <= -490000000.0) tmp = t_3; elseif (x1 <= -2.6e-227) tmp = t_5; elseif (x1 <= 4.9e-223) tmp = x1 + (t_4 + (x1 + (4.0 * (x1 * (x2 * -3.0))))); elseif (x1 <= 230000000000.0) tmp = t_5; elseif (x1 <= 1.32e+154) tmp = t_3; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $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[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$2), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$2 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -490000000.0], t$95$3, If[LessEqual[x1, -2.6e-227], t$95$5, If[LessEqual[x1, 4.9e-223], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 230000000000.0], t$95$5, If[LessEqual[x1, 1.32e+154], t$95$3, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(x2 \cdot 2 - 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(x2 \cdot 2 + t_2\right) - x1}{t_1} - 6\right) + x1 \cdot 2\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
t_4 := 3 \cdot \frac{\left(t_2 - x2 \cdot 2\right) - x1}{t_1}\\
t_5 := x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right)\right)\\
\mathbf{if}\;x1 \leq -490000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq -2.6 \cdot 10^{-227}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-223}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 230000000000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_0\right)\\
\end{array}
\end{array}
if x1 < -4.9e8 or 2.3e11 < x1 < 1.31999999999999998e154Initial program 40.8%
Taylor expanded in x1 around 0 35.1%
+-commutative35.1%
mul-1-neg35.1%
sub-neg35.1%
Simplified35.1%
Taylor expanded in x1 around inf 37.8%
*-commutative37.8%
Simplified37.8%
Taylor expanded in x1 around inf 37.8%
Taylor expanded in x1 around 0 37.8%
*-commutative37.8%
Simplified37.8%
if -4.9e8 < x1 < -2.60000000000000011e-227 or 4.9e-223 < x1 < 2.3e11Initial program 99.3%
Taylor expanded in x1 around 0 85.7%
if -2.60000000000000011e-227 < x1 < 4.9e-223Initial program 99.7%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
if 1.31999999999999998e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.1%
Final simplification62.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1)))
(t_3
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+ (* 3.0 t_0) (* t_1 (+ (* (* x1 x1) 6.0) (* x1 2.0)))))))))
(t_4 (* x2 (- (* x2 2.0) 3.0)))
(t_5 (+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 t_4)))))))
(if (<= x1 -290000000000.0)
t_3
(if (<= x1 -4.3e-226)
t_5
(if (<= x1 4.9e-223)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 (* x2 -3.0))))))
(if (<= x1 550000000.0)
t_5
(if (<= x1 1.32e+154) t_3 (+ x1 (* x1 (+ 1.0 (* 4.0 t_4)))))))))))
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 - (x2 * 2.0)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * 6.0) + (x1 * 2.0)))))));
double t_4 = x2 * ((x2 * 2.0) - 3.0);
double t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
double tmp;
if (x1 <= -290000000000.0) {
tmp = t_3;
} else if (x1 <= -4.3e-226) {
tmp = t_5;
} else if (x1 <= 4.9e-223) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 550000000.0) {
tmp = t_5;
} else if (x1 <= 1.32e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * 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) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)
t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * 6.0d0) + (x1 * 2.0d0)))))))
t_4 = x2 * ((x2 * 2.0d0) - 3.0d0)
t_5 = x1 + (t_2 + (x1 + (4.0d0 * (x1 * t_4))))
if (x1 <= (-290000000000.0d0)) then
tmp = t_3
else if (x1 <= (-4.3d-226)) then
tmp = t_5
else if (x1 <= 4.9d-223) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))))
else if (x1 <= 550000000.0d0) then
tmp = t_5
else if (x1 <= 1.32d+154) then
tmp = t_3
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_4)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * 6.0) + (x1 * 2.0)))))));
double t_4 = x2 * ((x2 * 2.0) - 3.0);
double t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
double tmp;
if (x1 <= -290000000000.0) {
tmp = t_3;
} else if (x1 <= -4.3e-226) {
tmp = t_5;
} else if (x1 <= 4.9e-223) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0)))));
} else if (x1 <= 550000000.0) {
tmp = t_5;
} else if (x1 <= 1.32e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_4)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1) t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * 6.0) + (x1 * 2.0))))))) t_4 = x2 * ((x2 * 2.0) - 3.0) t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4)))) tmp = 0 if x1 <= -290000000000.0: tmp = t_3 elif x1 <= -4.3e-226: tmp = t_5 elif x1 <= 4.9e-223: tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0))))) elif x1 <= 550000000.0: tmp = t_5 elif x1 <= 1.32e+154: tmp = t_3 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_4))) 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(x2 * 2.0)) - x1) / t_1)) t_3 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(x1 * 2.0)))))))) t_4 = Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)) t_5 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * t_4))))) tmp = 0.0 if (x1 <= -290000000000.0) tmp = t_3; elseif (x1 <= -4.3e-226) tmp = t_5; elseif (x1 <= 4.9e-223) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))))); elseif (x1 <= 550000000.0) tmp = t_5; elseif (x1 <= 1.32e+154) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_4)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1); t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * 6.0) + (x1 * 2.0))))))); t_4 = x2 * ((x2 * 2.0) - 3.0); t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4)))); tmp = 0.0; if (x1 <= -290000000000.0) tmp = t_3; elseif (x1 <= -4.3e-226) tmp = t_5; elseif (x1 <= 4.9e-223) tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * (x2 * -3.0))))); elseif (x1 <= 550000000.0) tmp = t_5; elseif (x1 <= 1.32e+154) tmp = t_3; else tmp = x1 + (x1 * (1.0 + (4.0 * t_4))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -290000000000.0], t$95$3, If[LessEqual[x1, -4.3e-226], t$95$5, If[LessEqual[x1, 4.9e-223], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 550000000.0], t$95$5, If[LessEqual[x1, 1.32e+154], t$95$3, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$4), $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 - x2 \cdot 2\right) - x1}{t_1}\\
t_3 := x1 + \left(t_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + x1 \cdot 2\right)\right)\right)\right)\right)\\
t_4 := x2 \cdot \left(x2 \cdot 2 - 3\right)\\
t_5 := x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x1 \cdot t_4\right)\right)\right)\\
\mathbf{if}\;x1 \leq -290000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq -4.3 \cdot 10^{-226}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-223}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 550000000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t_4\right)\\
\end{array}
\end{array}
if x1 < -2.9e11 or 5.5e8 < x1 < 1.31999999999999998e154Initial program 40.8%
Taylor expanded in x1 around 0 35.1%
+-commutative35.1%
mul-1-neg35.1%
sub-neg35.1%
Simplified35.1%
Taylor expanded in x1 around inf 37.8%
*-commutative37.8%
Simplified37.8%
Taylor expanded in x1 around inf 37.8%
Taylor expanded in x1 around inf 33.1%
if -2.9e11 < x1 < -4.30000000000000024e-226 or 4.9e-223 < x1 < 5.5e8Initial program 99.3%
Taylor expanded in x1 around 0 85.7%
if -4.30000000000000024e-226 < x1 < 4.9e-223Initial program 99.7%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 89.5%
*-commutative89.5%
associate-*l*89.5%
Simplified89.5%
if 1.31999999999999998e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.1%
Final simplification61.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -6.6e+174) (not (<= x2 3.55e+115))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))) (* -6.0 x2)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.6e+174) || !(x2 <= 3.55e+115)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
} else {
tmp = -6.0 * x2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-6.6d+174)) .or. (.not. (x2 <= 3.55d+115))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0)))))
else
tmp = (-6.0d0) * x2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.6e+174) || !(x2 <= 3.55e+115)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
} else {
tmp = -6.0 * x2;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -6.6e+174) or not (x2 <= 3.55e+115): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) else: tmp = -6.0 * x2 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -6.6e+174) || !(x2 <= 3.55e+115)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); else tmp = Float64(-6.0 * x2); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -6.6e+174) || ~((x2 <= 3.55e+115))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))); else tmp = -6.0 * x2; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -6.6e+174], N[Not[LessEqual[x2, 3.55e+115]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * x2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.6 \cdot 10^{+174} \lor \neg \left(x2 \leq 3.55 \cdot 10^{+115}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2\\
\end{array}
\end{array}
if x2 < -6.6000000000000001e174 or 3.5499999999999998e115 < x2 Initial program 72.5%
Taylor expanded in x1 around 0 49.8%
Taylor expanded in x1 around inf 59.6%
if -6.6000000000000001e174 < x2 < 3.5499999999999998e115Initial program 63.4%
Taylor expanded in x1 around 0 43.8%
Taylor expanded in x1 around 0 28.2%
*-commutative28.2%
Simplified28.2%
Taylor expanded in x1 around 0 28.5%
*-commutative28.5%
Simplified28.5%
Final simplification36.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))))
(if (<= x1 -4e-53)
(+ x1 (+ 9.0 t_0))
(if (<= x1 6.2e-46) (* -6.0 x2) (+ x1 t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))));
double tmp;
if (x1 <= -4e-53) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 6.2e-46) {
tmp = -6.0 * 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 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))))
if (x1 <= (-4d-53)) then
tmp = x1 + (9.0d0 + t_0)
else if (x1 <= 6.2d-46) then
tmp = (-6.0d0) * x2
else
tmp = x1 + t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))));
double tmp;
if (x1 <= -4e-53) {
tmp = x1 + (9.0 + t_0);
} else if (x1 <= 6.2e-46) {
tmp = -6.0 * x2;
} else {
tmp = x1 + t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))) tmp = 0 if x1 <= -4e-53: tmp = x1 + (9.0 + t_0) elif x1 <= 6.2e-46: tmp = -6.0 * x2 else: tmp = x1 + t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))))) tmp = 0.0 if (x1 <= -4e-53) tmp = Float64(x1 + Float64(9.0 + t_0)); elseif (x1 <= 6.2e-46) tmp = Float64(-6.0 * x2); else tmp = Float64(x1 + t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))); tmp = 0.0; if (x1 <= -4e-53) tmp = x1 + (9.0 + t_0); elseif (x1 <= 6.2e-46) tmp = -6.0 * x2; else tmp = x1 + t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4e-53], N[(x1 + N[(9.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.2e-46], N[(-6.0 * x2), $MachinePrecision], N[(x1 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{-53}:\\
\;\;\;\;x1 + \left(9 + t_0\right)\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-46}:\\
\;\;\;\;-6 \cdot x2\\
\mathbf{else}:\\
\;\;\;\;x1 + t_0\\
\end{array}
\end{array}
if x1 < -4.00000000000000012e-53Initial program 39.5%
Taylor expanded in x1 around 0 16.1%
Taylor expanded in x1 around inf 10.5%
if -4.00000000000000012e-53 < x1 < 6.2000000000000002e-46Initial program 99.5%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in x1 around 0 59.4%
*-commutative59.4%
Simplified59.4%
if 6.2000000000000002e-46 < x1 Initial program 51.5%
Taylor expanded in x1 around 0 24.3%
Taylor expanded in x1 around inf 41.2%
Final simplification36.3%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* -6.0 x2) (* x1 (- (* 4.0 (* x2 (- (* x2 2.0) 3.0))) 2.0)))))
double code(double x1, double x2) {
return x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (((-6.0d0) * x2) + (x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) - 2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)));
}
def code(x1, x2): return x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)))
function code(x1, x2) return Float64(x1 + Float64(Float64(-6.0 * x2) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) - 2.0)))) end
function tmp = code(x1, x2) tmp = x1 + ((-6.0 * x2) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0))); end
code[x1_, x2_] := N[(x1 + N[(N[(-6.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(-6 \cdot x2 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)
\end{array}
Initial program 65.6%
Taylor expanded in x1 around 0 45.2%
Taylor expanded in x1 around 0 49.6%
Final simplification49.6%
(FPCore (x1 x2) :precision binary64 (* -6.0 x2))
double code(double x1, double x2) {
return -6.0 * x2;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (-6.0d0) * x2
end function
public static double code(double x1, double x2) {
return -6.0 * x2;
}
def code(x1, x2): return -6.0 * x2
function code(x1, x2) return Float64(-6.0 * x2) end
function tmp = code(x1, x2) tmp = -6.0 * x2; end
code[x1_, x2_] := N[(-6.0 * x2), $MachinePrecision]
\begin{array}{l}
\\
-6 \cdot x2
\end{array}
Initial program 65.6%
Taylor expanded in x1 around 0 45.2%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Taylor expanded in x1 around 0 24.7%
*-commutative24.7%
Simplified24.7%
Final simplification24.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 65.6%
Taylor expanded in x1 around 0 45.2%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
Taylor expanded in x1 around inf 2.9%
Final simplification2.9%
herbie shell --seed 2023322
(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))))))