
(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 31 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 10.8%
Taylor expanded in x1 around inf 98.8%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 10.8%
Taylor expanded in x1 around inf 98.8%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (* x2 t_2))
(t_4 (* 4.0 t_3))
(t_5 (* x1 (* x1 3.0)))
(t_6 (/ (- (+ t_5 (* 2.0 x2)) x1) t_1))
(t_7
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_6) (- t_6 3.0))
(* (* x1 x1) (- (* t_6 4.0) 6.0))))
(* t_5 (+ 3.0 (/ -1.0 x1))))))
t_0))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_0
(+
x1
(*
x1
(+
t_4
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_2))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_4
(*
2.0
(+
(+ 1.0 (+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_2)))
(* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 -6.6e-9)
t_7
(if (<= x1 1.5e-22)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
t_7
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_3)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = x2 * t_2;
double t_4 = 4.0 * t_3;
double t_5 = x1 * (x1 * 3.0);
double t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1;
double t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_5 * (3.0 + (-1.0 / x1)))))) + t_0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -6.6e-9) {
tmp = t_7;
} else if (x1 <= 1.5e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = t_7;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = x2 * t_2
t_4 = 4.0d0 * t_3
t_5 = x1 * (x1 * 3.0d0)
t_6 = ((t_5 + (2.0d0 * x2)) - x1) / t_1
t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_6) * (t_6 - 3.0d0)) + ((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)))) + (t_5 * (3.0d0 + ((-1.0d0) / x1)))))) + t_0)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_2)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_4 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_2))) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-6.6d-9)) then
tmp = t_7
else if (x1 <= 1.5d-22) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = t_7
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_3))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = x2 * t_2;
double t_4 = 4.0 * t_3;
double t_5 = x1 * (x1 * 3.0);
double t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1;
double t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_5 * (3.0 + (-1.0 / x1)))))) + t_0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -6.6e-9) {
tmp = t_7;
} else if (x1 <= 1.5e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = t_7;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = (x1 * x1) + 1.0 t_2 = (2.0 * x2) - 3.0 t_3 = x2 * t_2 t_4 = 4.0 * t_3 t_5 = x1 * (x1 * 3.0) t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1 t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_5 * (3.0 + (-1.0 / x1)))))) + t_0) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= -6.6e-9: tmp = t_7 elif x1 <= 1.5e-22: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = t_7 else: tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(x2 * t_2) t_4 = Float64(4.0 * t_3) t_5 = Float64(x1 * Float64(x1 * 3.0)) t_6 = Float64(Float64(Float64(t_5 + Float64(2.0 * x2)) - x1) / t_1) t_7 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(t_6 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)))) + Float64(t_5 * Float64(3.0 + Float64(-1.0 / x1)))))) + t_0)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(x1 * Float64(t_4 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_2)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_4 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_2))) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -6.6e-9) tmp = t_7; elseif (x1 <= 1.5e-22) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = t_7; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_3))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = (x1 * x1) + 1.0; t_2 = (2.0 * x2) - 3.0; t_3 = x2 * t_2; t_4 = 4.0 * t_3; t_5 = x1 * (x1 * 3.0); t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1; t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (t_5 * (3.0 + (-1.0 / x1)))))) + t_0); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -6.6e-9) tmp = t_7; elseif (x1 <= 1.5e-22) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = t_7; else tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$5 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(t$95$6 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$0 + N[(x1 + N[(x1 * N[(t$95$4 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$4 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6.6e-9], t$95$7, If[LessEqual[x1, 1.5e-22], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], t$95$7, N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 2 \cdot x2 - 3\\
t_3 := x2 \cdot t\_2\\
t_4 := 4 \cdot t\_3\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := \frac{\left(t\_5 + 2 \cdot x2\right) - x1}{t\_1}\\
t_7 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(t\_6 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right) + t\_5 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + t\_0\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + x1 \cdot \left(t\_4 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_2\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_2\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-9}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_3\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.2%
if -1.60000000000000002e123 < x1 < -6.60000000000000037e-9 or 1.5e-22 < x1 < 8.2000000000000001e74Initial program 92.1%
Taylor expanded in x1 around 0 85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in x1 around inf 92.2%
if -6.60000000000000037e-9 < x1 < 1.5e-22Initial program 99.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x2 around 0 99.8%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification93.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.2e+113)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(if (<= x1 8.2e+74)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.2e+113) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else if (x1 <= 8.2e+74) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.2d+113)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else if (x1 <= 8.2d+74) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.2e+113) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else if (x1 <= 8.2e+74) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.2e+113: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) elif x1 <= 8.2e+74: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.2e+113) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.2e+113) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); elseif (x1 <= 8.2e+74) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.2e+113], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+113}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.1999999999999998e113Initial program 0.0%
Taylor expanded in x1 around inf 20.5%
Taylor expanded in x1 around inf 100.0%
if -5.1999999999999998e113 < x1 < 8.2000000000000001e74Initial program 99.4%
Taylor expanded in x1 around inf 97.8%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (- (* 2.0 x2) 3.0))
(t_3 (* x2 t_2))
(t_4 (* 4.0 t_3))
(t_5 (* x1 (* x1 3.0)))
(t_6 (/ (- (+ t_5 (* 2.0 x2)) x1) t_1))
(t_7
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_6) (- t_6 3.0))
(* (* x1 x1) (- (* t_6 4.0) 6.0))))
(* 3.0 t_5))))
t_0))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_0
(+
x1
(*
x1
(+
t_4
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_2))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_4
(*
2.0
(+
(+ 1.0 (+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_2)))
(* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 -0.000225)
t_7
(if (<= x1 0.007)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
t_7
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_3)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = x2 * t_2;
double t_4 = 4.0 * t_3;
double t_5 = x1 * (x1 * 3.0);
double t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1;
double t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (3.0 * t_5)))) + t_0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -0.000225) {
tmp = t_7;
} else if (x1 <= 0.007) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = t_7;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = (2.0d0 * x2) - 3.0d0
t_3 = x2 * t_2
t_4 = 4.0d0 * t_3
t_5 = x1 * (x1 * 3.0d0)
t_6 = ((t_5 + (2.0d0 * x2)) - x1) / t_1
t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_6) * (t_6 - 3.0d0)) + ((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_5)))) + t_0)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_2)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_4 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_2))) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-0.000225d0)) then
tmp = t_7
else if (x1 <= 0.007d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = t_7
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_3))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (2.0 * x2) - 3.0;
double t_3 = x2 * t_2;
double t_4 = 4.0 * t_3;
double t_5 = x1 * (x1 * 3.0);
double t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1;
double t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (3.0 * t_5)))) + t_0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -0.000225) {
tmp = t_7;
} else if (x1 <= 0.007) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = t_7;
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = (x1 * x1) + 1.0 t_2 = (2.0 * x2) - 3.0 t_3 = x2 * t_2 t_4 = 4.0 * t_3 t_5 = x1 * (x1 * 3.0) t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1 t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (3.0 * t_5)))) + t_0) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= -0.000225: tmp = t_7 elif x1 <= 0.007: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = t_7 else: tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(2.0 * x2) - 3.0) t_3 = Float64(x2 * t_2) t_4 = Float64(4.0 * t_3) t_5 = Float64(x1 * Float64(x1 * 3.0)) t_6 = Float64(Float64(Float64(t_5 + Float64(2.0 * x2)) - x1) / t_1) t_7 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(t_6 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)))) + Float64(3.0 * t_5)))) + t_0)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(x1 * Float64(t_4 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_2)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_4 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_2))) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -0.000225) tmp = t_7; elseif (x1 <= 0.007) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = t_7; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_3))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = (x1 * x1) + 1.0; t_2 = (2.0 * x2) - 3.0; t_3 = x2 * t_2; t_4 = 4.0 * t_3; t_5 = x1 * (x1 * 3.0); t_6 = ((t_5 + (2.0 * x2)) - x1) / t_1; t_7 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_6) * (t_6 - 3.0)) + ((x1 * x1) * ((t_6 * 4.0) - 6.0)))) + (3.0 * t_5)))) + t_0); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_0 + (x1 + (x1 * (t_4 + (x1 * (((2.0 * ((x2 * -2.0) - t_2)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_4 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_2))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -0.000225) tmp = t_7; elseif (x1 <= 0.007) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = t_7; else tmp = x1 + ((x1 + (4.0 * (x1 * t_3))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(4.0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$5 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(t$95$6 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$0 + N[(x1 + N[(x1 * N[(t$95$4 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$4 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.000225], t$95$7, If[LessEqual[x1, 0.007], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], t$95$7, N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 2 \cdot x2 - 3\\
t_3 := x2 \cdot t\_2\\
t_4 := 4 \cdot t\_3\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := \frac{\left(t\_5 + 2 \cdot x2\right) - x1}{t\_1}\\
t_7 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(t\_6 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\right) + 3 \cdot t\_5\right)\right)\right) + t\_0\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + x1 \cdot \left(t\_4 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_2\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_4 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_2\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.000225:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq 0.007:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_3\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.2%
if -1.60000000000000002e123 < x1 < -2.2499999999999999e-4 or 0.00700000000000000015 < x1 < 8.2000000000000001e74Initial program 90.9%
Taylor expanded in x1 around 0 88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x1 around inf 87.7%
if -2.2499999999999999e-4 < x1 < 0.00700000000000000015Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification92.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.2e+113)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(if (<= x1 8.2e+74)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 (+ 3.0 (/ -1.0 x1))))))
(* 3.0 (* x2 -2.0))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.2e+113) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else if (x1 <= 8.2e+74) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.2d+113)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else if (x1 <= 8.2d+74) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.2e+113) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else if (x1 <= 8.2e+74) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.2e+113: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) elif x1 <= 8.2e+74: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.2e+113) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.2e+113) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); elseif (x1 <= 8.2e+74) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * (3.0 + (-1.0 / x1)))))) + (3.0 * (x2 * -2.0))); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.2e+113], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.2 \cdot 10^{+113}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.1999999999999998e113Initial program 0.0%
Taylor expanded in x1 around inf 20.5%
Taylor expanded in x1 around inf 100.0%
if -5.1999999999999998e113 < x1 < 8.2000000000000001e74Initial program 99.4%
Taylor expanded in x1 around 0 82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in x1 around inf 96.5%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification97.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 4.0 (* x2 t_0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_4))
(t_6 (* t_2 t_5))
(t_7 (* x1 (* x1 x1)))
(t_8 (- t_5 3.0)))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_1
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_0))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_3
(*
2.0
(+
(+ 1.0 (+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_0)))
(* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 -14.6)
(+
x1
(+
t_1
(+
x1
(+
t_7
(+
t_6
(*
t_4
(+
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(* t_8 (* (* x1 2.0) 3.0)))))))))
(if (<= x1 0.029)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
(+
x1
(+
t_1
(+
x1
(+
t_7
(+
t_6
(* t_4 (+ (* (* (* x1 2.0) t_5) t_8) (* (* x1 x1) 6.0))))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 4.0 * (x2 * t_0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_6 = t_2 * t_5;
double t_7 = x1 * (x1 * x1);
double t_8 = t_5 - 3.0;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_1 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -14.6) {
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_8 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 0.029) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * ((((x1 * 2.0) * t_5) * t_8) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = 4.0d0 * (x2 * t_0)
t_4 = (x1 * x1) + 1.0d0
t_5 = ((t_2 + (2.0d0 * x2)) - x1) / t_4
t_6 = t_2 * t_5
t_7 = x1 * (x1 * x1)
t_8 = t_5 - 3.0d0
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_1 + (x1 + (x1 * (t_3 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_0)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_0))) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-14.6d0)) then
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + (t_8 * ((x1 * 2.0d0) * 3.0d0))))))))
else if (x1 <= 0.029d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * ((((x1 * 2.0d0) * t_5) * t_8) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 4.0 * (x2 * t_0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_6 = t_2 * t_5;
double t_7 = x1 * (x1 * x1);
double t_8 = t_5 - 3.0;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_1 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -14.6) {
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_8 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 0.029) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * ((((x1 * 2.0) * t_5) * t_8) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * 3.0) t_3 = 4.0 * (x2 * t_0) t_4 = (x1 * x1) + 1.0 t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4 t_6 = t_2 * t_5 t_7 = x1 * (x1 * x1) t_8 = t_5 - 3.0 tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_1 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= -14.6: tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_8 * ((x1 * 2.0) * 3.0)))))))) elif x1 <= 0.029: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * ((((x1 * 2.0) * t_5) * t_8) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(4.0 * Float64(x2 * t_0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_4) t_6 = Float64(t_2 * t_5) t_7 = Float64(x1 * Float64(x1 * x1)) t_8 = Float64(t_5 - 3.0) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_0)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_0))) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -14.6) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_7 + Float64(t_6 + Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(t_8 * Float64(Float64(x1 * 2.0) * 3.0))))))))); elseif (x1 <= 0.029) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_7 + Float64(t_6 + Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_8) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * 3.0); t_3 = 4.0 * (x2 * t_0); t_4 = (x1 * x1) + 1.0; t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4; t_6 = t_2 * t_5; t_7 = x1 * (x1 * x1); t_8 = t_5 - 3.0; tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_1 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -14.6) tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_8 * ((x1 * 2.0) * 3.0)))))))); elseif (x1 <= 0.029) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = x1 + (t_1 + (x1 + (t_7 + (t_6 + (t_4 * ((((x1 * 2.0) * t_5) * t_8) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$5 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$1 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -14.6], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$7 + N[(t$95$6 + N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$8 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.029], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$7 + N[(t$95$6 + N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$8), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 4 \cdot \left(x2 \cdot t\_0\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_4}\\
t_6 := t\_2 \cdot t\_5\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
t_8 := t\_5 - 3\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_0\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_0\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -14.6:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_7 + \left(t\_6 + t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + t\_8 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.029:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_7 + \left(t\_6 + t\_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot t\_8 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.2%
if -1.60000000000000002e123 < x1 < -14.5999999999999996Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around inf 76.6%
if -14.5999999999999996 < x1 < 0.0290000000000000015Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 0.0290000000000000015 < x1 < 2e114Initial program 94.6%
Taylor expanded in x1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x1 around inf 89.3%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification92.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x2 t_1))
(t_3 (* 4.0 t_2))
(t_4 (* x1 (* x1 3.0)))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (/ (- (+ t_4 (* 2.0 x2)) x1) t_6))
(t_8 (* (* x1 x1) (- (* t_7 4.0) 6.0))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_5
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_1))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+ t_3 (* 2.0 (+ 1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))
6.0)))))
6.0)))))))
(if (<= x1 -29.5)
(+ x1 (+ t_5 (+ x1 (+ t_0 (+ (* t_4 t_7) (* t_6 (+ (* x1 2.0) t_8)))))))
(if (<= x1 2e-22)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
(* t_4 (+ 3.0 (/ -1.0 x1)))
(*
t_6
(+ t_8 (* (- t_7 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_2)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 2e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x2 * t_1
t_3 = 4.0d0 * t_2
t_4 = x1 * (x1 * 3.0d0)
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = (x1 * x1) + 1.0d0
t_7 = ((t_4 + (2.0d0 * x2)) - x1) / t_6
t_8 = (x1 * x1) * ((t_7 * 4.0d0) - 6.0d0)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_1)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * (1.0d0 + (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-29.5d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0d0) + t_8))))))
else if (x1 <= 2d-22) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (3.0d0 + ((-1.0d0) / x1))) + (t_6 * (t_8 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_2))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 2e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (2.0 * x2) - 3.0 t_2 = x2 * t_1 t_3 = 4.0 * t_2 t_4 = x1 * (x1 * 3.0) t_5 = 3.0 * (x2 * -2.0) t_6 = (x1 * x1) + 1.0 t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6 t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))) elif x1 <= -29.5: tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))) elif x1 <= 2e-22: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x2 * t_1) t_3 = Float64(4.0 * t_2) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_6) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(t_7 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_1)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(1.0 + Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -29.5) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(t_4 * t_7) + Float64(t_6 * Float64(Float64(x1 * 2.0) + t_8))))))); elseif (x1 <= 2e-22) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(t_4 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_6 * Float64(t_8 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_2))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (2.0 * x2) - 3.0; t_2 = x2 * t_1; t_3 = 4.0 * t_2; t_4 = x1 * (x1 * 3.0); t_5 = 3.0 * (x2 * -2.0); t_6 = (x1 * x1) + 1.0; t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6; t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -29.5) tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))); elseif (x1 <= 2e-22) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$7 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(1.0 + N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -29.5], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(t$95$4 * t$95$7), $MachinePrecision] + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-22], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(t$95$4 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(t$95$8 + N[(N[(t$95$7 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x2 \cdot t\_1\\
t_3 := 4 \cdot t\_2\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_6}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_1\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(1 + 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -29.5:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_4 \cdot t\_7 + t\_6 \cdot \left(x1 \cdot 2 + t\_8\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_4 \cdot \left(3 + \frac{-1}{x1}\right) + t\_6 \cdot \left(t\_8 + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_2\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
if -1.60000000000000002e123 < x1 < -29.5Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
Taylor expanded in x1 around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -29.5 < x1 < 2.0000000000000001e-22Initial program 99.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x2 around 0 99.8%
if 2.0000000000000001e-22 < x1 < 8.2000000000000001e74Initial program 99.2%
Taylor expanded in x1 around 0 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x1 around 0 80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
Taylor expanded in x1 around inf 84.1%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification91.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* x2 t_0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 3.0 (* x2 -2.0)))
(t_4 (* x1 (* x1 3.0)))
(t_5 (* 4.0 t_1))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (/ (- (+ t_4 (* 2.0 x2)) x1) t_6))
(t_8 (* (* x1 x1) (- (* t_7 4.0) 6.0))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_3
(+
x1
(*
x1
(+
t_5
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_0))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_5
(*
2.0
(+
(+ 1.0 (+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_0)))
(* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 -29.5)
(+ x1 (+ t_3 (+ x1 (+ t_2 (+ (* t_4 t_7) (* t_6 (+ (* x1 2.0) t_8)))))))
(if (<= x1 1.5e-22)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(* t_4 (+ 3.0 (/ -1.0 x1)))
(*
t_6
(+ t_8 (* (- t_7 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_1)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x2 * t_0;
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = x1 * (x1 * 3.0);
double t_5 = 4.0 * t_1;
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_3 + (x1 + (x1 * (t_5 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 1.5e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x2 * t_0
t_2 = x1 * (x1 * x1)
t_3 = 3.0d0 * (x2 * (-2.0d0))
t_4 = x1 * (x1 * 3.0d0)
t_5 = 4.0d0 * t_1
t_6 = (x1 * x1) + 1.0d0
t_7 = ((t_4 + (2.0d0 * x2)) - x1) / t_6
t_8 = (x1 * x1) * ((t_7 * 4.0d0) - 6.0d0)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_3 + (x1 + (x1 * (t_5 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_0)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_5 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_0))) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-29.5d0)) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0d0) + t_8))))))
else if (x1 <= 1.5d-22) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * (3.0d0 + ((-1.0d0) / x1))) + (t_6 * (t_8 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_1))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x2 * t_0;
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = x1 * (x1 * 3.0);
double t_5 = 4.0 * t_1;
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_3 + (x1 + (x1 * (t_5 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 1.5e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x2 * t_0 t_2 = x1 * (x1 * x1) t_3 = 3.0 * (x2 * -2.0) t_4 = x1 * (x1 * 3.0) t_5 = 4.0 * t_1 t_6 = (x1 * x1) + 1.0 t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6 t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_3 + (x1 + (x1 * (t_5 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= -29.5: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))) elif x1 <= 1.5e-22: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x2 * t_0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(3.0 * Float64(x2 * -2.0)) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(4.0 * t_1) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_6) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(t_7 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(x1 * Float64(t_5 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_0)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_5 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_0))) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -29.5) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_4 * t_7) + Float64(t_6 * Float64(Float64(x1 * 2.0) + t_8))))))); elseif (x1 <= 1.5e-22) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_4 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_6 * Float64(t_8 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_1))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x2 * t_0; t_2 = x1 * (x1 * x1); t_3 = 3.0 * (x2 * -2.0); t_4 = x1 * (x1 * 3.0); t_5 = 4.0 * t_1; t_6 = (x1 * x1) + 1.0; t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6; t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_3 + (x1 + (x1 * (t_5 + (x1 * (((2.0 * ((x2 * -2.0) - t_0)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_5 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_0))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -29.5) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))); elseif (x1 <= 1.5e-22) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * (3.0 + (-1.0 / x1))) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 + ((x1 + (4.0 * (x1 * t_1))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(4.0 * t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$7 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$3 + N[(x1 + N[(x1 * N[(t$95$5 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$5 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -29.5], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$4 * t$95$7), $MachinePrecision] + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e-22], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$4 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(t$95$8 + N[(N[(t$95$7 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x2 \cdot t\_0\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2\right)\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := 4 \cdot t\_1\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_6}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + x1 \cdot \left(t\_5 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_0\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_5 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_0\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -29.5:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_2 + \left(t\_4 \cdot t\_7 + t\_6 \cdot \left(x1 \cdot 2 + t\_8\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_2 + \left(t\_4 \cdot \left(3 + \frac{-1}{x1}\right) + t\_6 \cdot \left(t\_8 + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.2%
if -1.60000000000000002e123 < x1 < -29.5Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
Taylor expanded in x1 around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -29.5 < x1 < 1.5e-22Initial program 99.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x2 around 0 99.8%
if 1.5e-22 < x1 < 8.2000000000000001e74Initial program 99.2%
Taylor expanded in x1 around 0 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x1 around 0 80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
Taylor expanded in x1 around inf 84.1%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification91.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (- (* 2.0 x2) 3.0))
(t_5 (* x2 t_4))
(t_6 (* 4.0 t_5))
(t_7 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_8 (* x1 (* x1 x1)))
(t_9 (- t_3 3.0)))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_0
(+
x1
(*
x1
(+
t_6
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_4))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+
t_6
(*
2.0
(+
(+ 1.0 (+ (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))) (* 3.0 t_4)))
(* 2.0 (* x2 (- 3.0 (* 2.0 x2)))))))
6.0)))))
6.0)))))))
(if (<= x1 -5.3)
(+
x1
(+
t_0
(+
x1
(+ t_8 (+ (* t_1 t_3) (* t_2 (+ t_7 (* t_9 (* (* x1 2.0) 3.0)))))))))
(if (<= x1 2e-22)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
(+
x1
(+
t_0
(+
x1
(+
t_8
(+
(* t_1 (+ 3.0 (/ -1.0 x1)))
(* t_2 (+ t_7 (* t_9 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_5)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (2.0 * x2) - 3.0;
double t_5 = x2 * t_4;
double t_6 = 4.0 * t_5;
double t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_8 = x1 * (x1 * x1);
double t_9 = t_3 - 3.0;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_6 + (x1 * (((2.0 * ((x2 * -2.0) - t_4)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_4))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -5.3) {
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * t_3) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 2e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * (3.0 + (-1.0 / x1))) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_5))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: t_9
real(8) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = (2.0d0 * x2) - 3.0d0
t_5 = x2 * t_4
t_6 = 4.0d0 * t_5
t_7 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_8 = x1 * (x1 * x1)
t_9 = t_3 - 3.0d0
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_0 + (x1 + (x1 * (t_6 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_4)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_6 + (2.0d0 * ((1.0d0 + ((2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (3.0d0 * t_4))) + (2.0d0 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-5.3d0)) then
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * t_3) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0d0) * 3.0d0))))))))
else if (x1 <= 2d-22) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * (3.0d0 + ((-1.0d0) / x1))) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_5))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = (2.0 * x2) - 3.0;
double t_5 = x2 * t_4;
double t_6 = 4.0 * t_5;
double t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_8 = x1 * (x1 * x1);
double t_9 = t_3 - 3.0;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_0 + (x1 + (x1 * (t_6 + (x1 * (((2.0 * ((x2 * -2.0) - t_4)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_4))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -5.3) {
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * t_3) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * 3.0))))))));
} else if (x1 <= 2e-22) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * (3.0 + (-1.0 / x1))) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_5))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = (2.0 * x2) - 3.0 t_5 = x2 * t_4 t_6 = 4.0 * t_5 t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_8 = x1 * (x1 * x1) t_9 = t_3 - 3.0 tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_0 + (x1 + (x1 * (t_6 + (x1 * (((2.0 * ((x2 * -2.0) - t_4)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_4))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))) elif x1 <= -5.3: tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * t_3) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * 3.0)))))))) elif x1 <= 2e-22: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * (3.0 + (-1.0 / x1))) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * t_5))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(Float64(2.0 * x2) - 3.0) t_5 = Float64(x2 * t_4) t_6 = Float64(4.0 * t_5) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_8 = Float64(x1 * Float64(x1 * x1)) t_9 = Float64(t_3 - 3.0) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(x1 * Float64(t_6 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_4)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_6 + Float64(2.0 * Float64(Float64(1.0 + Float64(Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(3.0 * t_4))) + Float64(2.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -5.3) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_8 + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(t_7 + Float64(t_9 * Float64(Float64(x1 * 2.0) * 3.0))))))))); elseif (x1 <= 2e-22) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_8 + Float64(Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1))) + Float64(t_2 * Float64(t_7 + Float64(t_9 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_5))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = (2.0 * x2) - 3.0; t_5 = x2 * t_4; t_6 = 4.0 * t_5; t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_8 = x1 * (x1 * x1); t_9 = t_3 - 3.0; tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_0 + (x1 + (x1 * (t_6 + (x1 * (((2.0 * ((x2 * -2.0) - t_4)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_6 + (2.0 * ((1.0 + ((2.0 * (x2 * (3.0 + (x2 * -2.0)))) + (3.0 * t_4))) + (2.0 * (x2 * (3.0 - (2.0 * x2))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -5.3) tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * t_3) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * 3.0)))))))); elseif (x1 <= 2e-22) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = x1 + (t_0 + (x1 + (t_8 + ((t_1 * (3.0 + (-1.0 / x1))) + (t_2 * (t_7 + (t_9 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 + ((x1 + (4.0 * (x1 * t_5))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(x2 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(4.0 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$3 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$0 + N[(x1 + N[(x1 * N[(t$95$6 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$6 + N[(2.0 * N[(N[(1.0 + N[(N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.3], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$8 + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(t$95$7 + N[(t$95$9 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e-22], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$8 + N[(N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(t$95$7 + N[(t$95$9 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 2 \cdot x2 - 3\\
t_5 := x2 \cdot t\_4\\
t_6 := 4 \cdot t\_5\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_8 := x1 \cdot \left(x1 \cdot x1\right)\\
t_9 := t\_3 - 3\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + x1 \cdot \left(t\_6 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_4\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_6 + 2 \cdot \left(\left(1 + \left(2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + 3 \cdot t\_4\right)\right) + 2 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5.3:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + \left(t\_8 + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(t\_7 + t\_9 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-22}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + \left(t\_8 + \left(t\_1 \cdot \left(3 + \frac{-1}{x1}\right) + t\_2 \cdot \left(t\_7 + t\_9 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_5\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 73.2%
if -1.60000000000000002e123 < x1 < -5.29999999999999982Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around inf 76.6%
if -5.29999999999999982 < x1 < 2.0000000000000001e-22Initial program 99.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x2 around 0 99.8%
if 2.0000000000000001e-22 < x1 < 8.2000000000000001e74Initial program 99.2%
Taylor expanded in x1 around 0 89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x1 around 0 80.5%
+-commutative80.5%
mul-1-neg80.5%
unsub-neg80.5%
Simplified80.5%
Taylor expanded in x1 around inf 84.1%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification92.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x2 t_1))
(t_3 (* 4.0 t_2))
(t_4 (* x1 (* x1 3.0)))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (/ (- (+ t_4 (* 2.0 x2)) x1) t_6))
(t_8 (* (* x1 x1) (- (* t_7 4.0) 6.0))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_5
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_1))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+ t_3 (* 2.0 (+ 1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))
6.0)))))
6.0)))))))
(if (<= x1 -29.5)
(+ x1 (+ t_5 (+ x1 (+ t_0 (+ (* t_4 t_7) (* t_6 (+ (* x1 2.0) t_8)))))))
(if (<= x1 3.25)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 8.2e+74)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
(* 3.0 t_4)
(*
t_6
(+ t_8 (* (- t_7 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 t_2)))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 3.25) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((3.0 * t_4) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x2 * t_1
t_3 = 4.0d0 * t_2
t_4 = x1 * (x1 * 3.0d0)
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = (x1 * x1) + 1.0d0
t_7 = ((t_4 + (2.0d0 * x2)) - x1) / t_6
t_8 = (x1 * x1) * ((t_7 * 4.0d0) - 6.0d0)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_1)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * (1.0d0 + (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-29.5d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0d0) + t_8))))))
else if (x1 <= 3.25d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 8.2d+74) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((3.0d0 * t_4) + (t_6 * (t_8 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_2))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8))))));
} else if (x1 <= 3.25) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 8.2e+74) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((3.0 * t_4) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (2.0 * x2) - 3.0 t_2 = x2 * t_1 t_3 = 4.0 * t_2 t_4 = x1 * (x1 * 3.0) t_5 = 3.0 * (x2 * -2.0) t_6 = (x1 * x1) + 1.0 t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6 t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))) elif x1 <= -29.5: tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))) elif x1 <= 3.25: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 8.2e+74: tmp = x1 + (t_5 + (x1 + (t_0 + ((3.0 * t_4) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x2 * t_1) t_3 = Float64(4.0 * t_2) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_6) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(t_7 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_1)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(1.0 + Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -29.5) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(t_4 * t_7) + Float64(t_6 * Float64(Float64(x1 * 2.0) + t_8))))))); elseif (x1 <= 3.25) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 8.2e+74) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_4) + Float64(t_6 * Float64(t_8 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_2))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (2.0 * x2) - 3.0; t_2 = x2 * t_1; t_3 = 4.0 * t_2; t_4 = x1 * (x1 * 3.0); t_5 = 3.0 * (x2 * -2.0); t_6 = (x1 * x1) + 1.0; t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6; t_8 = (x1 * x1) * ((t_7 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -29.5) tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * t_7) + (t_6 * ((x1 * 2.0) + t_8)))))); elseif (x1 <= 3.25) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 8.2e+74) tmp = x1 + (t_5 + (x1 + (t_0 + ((3.0 * t_4) + (t_6 * (t_8 + ((t_7 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 + ((x1 + (4.0 * (x1 * t_2))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$7 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(1.0 + N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -29.5], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(t$95$4 * t$95$7), $MachinePrecision] + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.25], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8.2e+74], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$4), $MachinePrecision] + N[(t$95$6 * N[(t$95$8 + N[(N[(t$95$7 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x2 \cdot t\_1\\
t_3 := 4 \cdot t\_2\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_6}\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_1\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(1 + 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -29.5:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_4 \cdot t\_7 + t\_6 \cdot \left(x1 \cdot 2 + t\_8\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.25:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 8.2 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_4 + t\_6 \cdot \left(t\_8 + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t\_2\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
if -1.60000000000000002e123 < x1 < -29.5Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
Taylor expanded in x1 around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -29.5 < x1 < 3.25Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 3.25 < x1 < 8.2000000000000001e74Initial program 99.1%
Taylor expanded in x1 around 0 98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in x1 around 0 85.8%
+-commutative85.8%
mul-1-neg85.8%
unsub-neg85.8%
Simplified85.8%
Taylor expanded in x1 around inf 85.8%
if 8.2000000000000001e74 < x1 Initial program 22.0%
Taylor expanded in x1 around 0 14.4%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x2 around 0 98.0%
Final simplification91.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_0 (* 2.0 x2)) x1) t_4)))
(if (<= x1 -2.45e+116)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -1.06)
(+
x1
(+
t_1
(+
x1
(+
t_2
(+
(* t_4 (+ (* (* x1 x1) (- (* t_5 4.0) 6.0)) t_3))
(* t_0 (* 2.0 x2)))))))
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
(+
x1
(+
t_1
(+
x1
(+
t_2
(+
(* t_0 t_5)
(*
t_4
(+
t_3
(* (* x1 x1) (- (* 4.0 (+ 3.0 (/ -1.0 x1))) 6.0)))))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_0 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -1.06) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + t_3)) + (t_0 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_5) + (t_4 * (t_3 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * x1)
t_3 = 4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))
t_4 = (x1 * x1) + 1.0d0
t_5 = ((t_0 + (2.0d0 * x2)) - x1) / t_4
if (x1 <= (-2.45d+116)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-1.06d0)) then
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + t_3)) + (t_0 * (2.0d0 * x2))))))
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_5) + (t_4 * (t_3 + ((x1 * x1) * ((4.0d0 * (3.0d0 + ((-1.0d0) / x1))) - 6.0d0))))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)));
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_0 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -1.06) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + t_3)) + (t_0 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_5) + (t_4 * (t_3 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * x1) t_3 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))) t_4 = (x1 * x1) + 1.0 t_5 = ((t_0 + (2.0 * x2)) - x1) / t_4 tmp = 0 if x1 <= -2.45e+116: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -1.06: tmp = x1 + (t_1 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + t_3)) + (t_0 * (2.0 * x2)))))) elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_5) + (t_4 * (t_3 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_4) tmp = 0.0 if (x1 <= -2.45e+116) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -1.06) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + t_3)) + Float64(t_0 * Float64(2.0 * x2))))))); elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * t_5) + Float64(t_4 * Float64(t_3 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 + Float64(-1.0 / x1))) - 6.0))))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * x1); t_3 = 4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))); t_4 = (x1 * x1) + 1.0; t_5 = ((t_0 + (2.0 * x2)) - x1) / t_4; tmp = 0.0; if (x1 <= -2.45e+116) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -1.06) tmp = x1 + (t_1 + (x1 + (t_2 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + t_3)) + (t_0 * (2.0 * x2)))))); elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_5) + (t_4 * (t_3 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[x1, -2.45e+116], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.06], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * t$95$5), $MachinePrecision] + N[(t$95$4 * N[(t$95$3 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_4}\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+116}:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.06:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_2 + \left(t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + t\_3\right) + t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_2 + \left(t\_0 \cdot t\_5 + t\_4 \cdot \left(t\_3 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \frac{-1}{x1}\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.4499999999999999e116Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 11.6%
*-commutative11.6%
Simplified11.6%
Taylor expanded in x1 around 0 65.7%
if -2.4499999999999999e116 < x1 < -1.0600000000000001Initial program 94.0%
Taylor expanded in x1 around 0 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x1 around 0 76.6%
+-commutative76.6%
mul-1-neg76.6%
unsub-neg76.6%
Simplified76.6%
Taylor expanded in x1 around 0 78.0%
Taylor expanded in x1 around 0 78.1%
if -1.0600000000000001 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 1.3500000000000001 < x1 < 2e114Initial program 94.6%
Taylor expanded in x1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x1 around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
Simplified75.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.2%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification90.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x2 t_1))
(t_3 (* 4.0 t_2))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (* x1 (* x1 3.0)))
(t_7 (/ (- (+ t_6 (* 2.0 x2)) x1) t_4))
(t_8 (* 4.0 (* x1 t_2))))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_5
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_1))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+ t_3 (* 2.0 (+ 1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))
6.0)))))
6.0)))))))
(if (<= x1 -1.16)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
(* t_4 (+ (* (* x1 x1) (- (* t_7 4.0) 6.0)) t_8))
(* t_6 (* 2.0 x2)))))))
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
(* t_6 t_7)
(*
t_4
(+
t_8
(* (* x1 x1) (- (* 4.0 (+ 3.0 (/ -1.0 x1))) 6.0)))))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * 3.0);
double t_7 = ((t_6 + (2.0 * x2)) - x1) / t_4;
double t_8 = 4.0 * (x1 * t_2);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -1.16) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (((x1 * x1) * ((t_7 * 4.0) - 6.0)) + t_8)) + (t_6 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_6 * t_7) + (t_4 * (t_8 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x2 * t_1
t_3 = 4.0d0 * t_2
t_4 = (x1 * x1) + 1.0d0
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = x1 * (x1 * 3.0d0)
t_7 = ((t_6 + (2.0d0 * x2)) - x1) / t_4
t_8 = 4.0d0 * (x1 * t_2)
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_1)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * (1.0d0 + (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-1.16d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (((x1 * x1) * ((t_7 * 4.0d0) - 6.0d0)) + t_8)) + (t_6 * (2.0d0 * x2))))))
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_6 * t_7) + (t_4 * (t_8 + ((x1 * x1) * ((4.0d0 * (3.0d0 + ((-1.0d0) / x1))) - 6.0d0))))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = x1 * (x1 * 3.0);
double t_7 = ((t_6 + (2.0 * x2)) - x1) / t_4;
double t_8 = 4.0 * (x1 * t_2);
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -1.16) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (((x1 * x1) * ((t_7 * 4.0) - 6.0)) + t_8)) + (t_6 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_5 + (x1 + (t_0 + ((t_6 * t_7) + (t_4 * (t_8 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (2.0 * x2) - 3.0 t_2 = x2 * t_1 t_3 = 4.0 * t_2 t_4 = (x1 * x1) + 1.0 t_5 = 3.0 * (x2 * -2.0) t_6 = x1 * (x1 * 3.0) t_7 = ((t_6 + (2.0 * x2)) - x1) / t_4 t_8 = 4.0 * (x1 * t_2) tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))) elif x1 <= -1.16: tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (((x1 * x1) * ((t_7 * 4.0) - 6.0)) + t_8)) + (t_6 * (2.0 * x2)))))) elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = x1 + (t_5 + (x1 + (t_0 + ((t_6 * t_7) + (t_4 * (t_8 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x2 * t_1) t_3 = Float64(4.0 * t_2) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(x1 * Float64(x1 * 3.0)) t_7 = Float64(Float64(Float64(t_6 + Float64(2.0 * x2)) - x1) / t_4) t_8 = Float64(4.0 * Float64(x1 * t_2)) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_1)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(1.0 + Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -1.16) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_7 * 4.0) - 6.0)) + t_8)) + Float64(t_6 * Float64(2.0 * x2))))))); elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(Float64(t_6 * t_7) + Float64(t_4 * Float64(t_8 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 + Float64(-1.0 / x1))) - 6.0))))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (2.0 * x2) - 3.0; t_2 = x2 * t_1; t_3 = 4.0 * t_2; t_4 = (x1 * x1) + 1.0; t_5 = 3.0 * (x2 * -2.0); t_6 = x1 * (x1 * 3.0); t_7 = ((t_6 + (2.0 * x2)) - x1) / t_4; t_8 = 4.0 * (x1 * t_2); tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -1.16) tmp = x1 + (t_5 + (x1 + (t_0 + ((t_4 * (((x1 * x1) * ((t_7 * 4.0) - 6.0)) + t_8)) + (t_6 * (2.0 * x2)))))); elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = x1 + (t_5 + (x1 + (t_0 + ((t_6 * t_7) + (t_4 * (t_8 + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$6 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$8 = N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(1.0 + N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.16], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$7 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(N[(t$95$6 * t$95$7), $MachinePrecision] + N[(t$95$4 * N[(t$95$8 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x2 \cdot t\_1\\
t_3 := 4 \cdot t\_2\\
t_4 := x1 \cdot x1 + 1\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot \left(x1 \cdot 3\right)\\
t_7 := \frac{\left(t\_6 + 2 \cdot x2\right) - x1}{t\_4}\\
t_8 := 4 \cdot \left(x1 \cdot t\_2\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_1\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(1 + 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.16:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right) + t\_8\right) + t\_6 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_6 \cdot t\_7 + t\_4 \cdot \left(t\_8 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \frac{-1}{x1}\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
if -1.60000000000000002e123 < x1 < -1.15999999999999992Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
Taylor expanded in x1 around 0 70.5%
Taylor expanded in x1 around 0 70.7%
if -1.15999999999999992 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 1.3500000000000001 < x1 < 2e114Initial program 94.6%
Taylor expanded in x1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x1 around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
Simplified75.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.2%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification90.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x2 t_1))
(t_3 (* 4.0 t_2))
(t_4 (* x1 (* x1 3.0)))
(t_5 (* 3.0 (* x2 -2.0)))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (/ (- (+ t_4 (* 2.0 x2)) x1) t_6))
(t_8 (* t_4 t_7)))
(if (<= x1 -1.6e+123)
(+
x1
(+
t_5
(+
x1
(*
x1
(+
t_3
(*
x1
(-
(+
(* 2.0 (- (* x2 -2.0) t_1))
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(+ t_3 (* 2.0 (+ 1.0 (* 2.0 (* x2 (+ 3.0 (* x2 -2.0)))))))
6.0)))))
6.0)))))))
(if (<= x1 -29.5)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+ t_8 (* t_6 (+ (* x1 2.0) (* (* x1 x1) (- (* t_7 4.0) 6.0)))))))))
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
t_8
(*
t_6
(+
(* 4.0 (* x1 t_2))
(* (* x1 x1) (- (* 4.0 (+ 3.0 (/ -1.0 x1))) 6.0)))))))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = t_4 * t_7;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((x1 * 2.0) + ((x1 * x1) * ((t_7 * 4.0) - 6.0))))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((4.0 * (x1 * t_2)) + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x2 * t_1
t_3 = 4.0d0 * t_2
t_4 = x1 * (x1 * 3.0d0)
t_5 = 3.0d0 * (x2 * (-2.0d0))
t_6 = (x1 * x1) + 1.0d0
t_7 = ((t_4 + (2.0d0 * x2)) - x1) / t_6
t_8 = t_4 * t_7
if (x1 <= (-1.6d+123)) then
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0d0 * ((x2 * (-2.0d0)) - t_1)) + ((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((t_3 + (2.0d0 * (1.0d0 + (2.0d0 * (x2 * (3.0d0 + (x2 * (-2.0d0)))))))) - 6.0d0))))) - 6.0d0))))))
else if (x1 <= (-29.5d0)) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_7 * 4.0d0) - 6.0d0))))))))
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((4.0d0 * (x1 * t_2)) + ((x1 * x1) * ((4.0d0 * (3.0d0 + ((-1.0d0) / x1))) - 6.0d0))))))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x2 * t_1;
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = 3.0 * (x2 * -2.0);
double t_6 = (x1 * x1) + 1.0;
double t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6;
double t_8 = t_4 * t_7;
double tmp;
if (x1 <= -1.6e+123) {
tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0))))));
} else if (x1 <= -29.5) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((x1 * 2.0) + ((x1 * x1) * ((t_7 * 4.0) - 6.0))))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((4.0 * (x1 * t_2)) + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0))))))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = (2.0 * x2) - 3.0 t_2 = x2 * t_1 t_3 = 4.0 * t_2 t_4 = x1 * (x1 * 3.0) t_5 = 3.0 * (x2 * -2.0) t_6 = (x1 * x1) + 1.0 t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6 t_8 = t_4 * t_7 tmp = 0 if x1 <= -1.6e+123: tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))) elif x1 <= -29.5: tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((x1 * 2.0) + ((x1 * x1) * ((t_7 * 4.0) - 6.0)))))))) elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((4.0 * (x1 * t_2)) + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x2 * t_1) t_3 = Float64(4.0 * t_2) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(3.0 * Float64(x2 * -2.0)) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_6) t_8 = Float64(t_4 * t_7) tmp = 0.0 if (x1 <= -1.6e+123) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(t_3 + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) - t_1)) + Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(t_3 + Float64(2.0 * Float64(1.0 + Float64(2.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0))))))) - 6.0))))) - 6.0))))))); elseif (x1 <= -29.5) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_8 + Float64(t_6 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_7 * 4.0) - 6.0))))))))); elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_8 + Float64(t_6 * Float64(Float64(4.0 * Float64(x1 * t_2)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(3.0 + Float64(-1.0 / x1))) - 6.0))))))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (2.0 * x2) - 3.0; t_2 = x2 * t_1; t_3 = 4.0 * t_2; t_4 = x1 * (x1 * 3.0); t_5 = 3.0 * (x2 * -2.0); t_6 = (x1 * x1) + 1.0; t_7 = ((t_4 + (2.0 * x2)) - x1) / t_6; t_8 = t_4 * t_7; tmp = 0.0; if (x1 <= -1.6e+123) tmp = x1 + (t_5 + (x1 + (x1 * (t_3 + (x1 * (((2.0 * ((x2 * -2.0) - t_1)) + ((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((t_3 + (2.0 * (1.0 + (2.0 * (x2 * (3.0 + (x2 * -2.0))))))) - 6.0))))) - 6.0)))))); elseif (x1 <= -29.5) tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((x1 * 2.0) + ((x1 * x1) * ((t_7 * 4.0) - 6.0)))))))); elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = x1 + (t_5 + (x1 + (t_0 + (t_8 + (t_6 * ((4.0 * (x1 * t_2)) + ((x1 * x1) * ((4.0 * (3.0 + (-1.0 / x1))) - 6.0)))))))); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$4 * t$95$7), $MachinePrecision]}, If[LessEqual[x1, -1.6e+123], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(t$95$3 + N[(x1 * N[(N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$3 + N[(2.0 * N[(1.0 + N[(2.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -29.5], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$8 + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$7 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$8 + N[(t$95$6 * N[(N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x2 \cdot t\_1\\
t_3 := 4 \cdot t\_2\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := 3 \cdot \left(x2 \cdot -2\right)\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_6}\\
t_8 := t\_4 \cdot t\_7\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+123}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(t\_3 + x1 \cdot \left(\left(2 \cdot \left(x2 \cdot -2 - t\_1\right) + \left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(\left(t\_3 + 2 \cdot \left(1 + 2 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right) - 6\right)\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -29.5:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_6 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t\_7 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_8 + t\_6 \cdot \left(4 \cdot \left(x1 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(3 + \frac{-1}{x1}\right) - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000002e123Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.7%
if -1.60000000000000002e123 < x1 < -29.5Initial program 85.1%
Taylor expanded in x1 around 0 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x1 around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
Simplified69.3%
Taylor expanded in x1 around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -29.5 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 1.3500000000000001 < x1 < 2e114Initial program 94.6%
Taylor expanded in x1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x1 around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
Simplified75.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.2%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification91.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
(* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))))))))
(if (<= x1 -2.45e+116)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -0.56)
t_2
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
t_2
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -0.56) {
tmp = t_2;
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = t_2;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))))))
if (x1 <= (-2.45d+116)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-0.56d0)) then
tmp = t_2
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = t_2
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -0.56) {
tmp = t_2;
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = t_2;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))) tmp = 0 if x1 <= -2.45e+116: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -0.56: tmp = t_2 elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = t_2 else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))))))) tmp = 0.0 if (x1 <= -2.45e+116) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -0.56) tmp = t_2; elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = t_2; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))); tmp = 0.0; if (x1 <= -2.45e+116) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -0.56) tmp = t_2; elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = t_2; else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.45e+116], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.56], t$95$2, If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], t$95$2, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $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 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+116}:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.56:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.4499999999999999e116Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 11.6%
*-commutative11.6%
Simplified11.6%
Taylor expanded in x1 around 0 65.7%
if -2.4499999999999999e116 < x1 < -0.56000000000000005 or 1.3500000000000001 < x1 < 2e114Initial program 94.3%
Taylor expanded in x1 around 0 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in x1 around 0 76.0%
+-commutative76.0%
mul-1-neg76.0%
unsub-neg76.0%
Simplified76.0%
Taylor expanded in x1 around 0 80.2%
Taylor expanded in x1 around inf 80.2%
if -0.56000000000000005 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification90.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4
(*
t_3
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_3) 4.0) 6.0))
(* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))))))
(if (<= x1 -2.45e+116)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -1.06)
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ t_4 (* t_0 (* 2.0 x2)))))))
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
(+ x1 (+ t_1 (+ x1 (+ t_2 (+ (* 3.0 t_0) t_4)))))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_3 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -1.06) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = t_3 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_3) * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
if (x1 <= (-2.45d+116)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-1.06d0)) then
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (2.0d0 * x2))))))
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = x1 + (t_1 + (x1 + (t_2 + ((3.0d0 * t_0) + t_4))))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_3 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -1.06) {
tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (2.0 * x2))))));
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * x1) t_3 = (x1 * x1) + 1.0 t_4 = t_3 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) tmp = 0 if x1 <= -2.45e+116: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -1.06: tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (2.0 * x2)))))) elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = x1 + (t_1 + (x1 + (t_2 + ((3.0 * t_0) + t_4)))) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))) tmp = 0.0 if (x1 <= -2.45e+116) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -1.06) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(t_4 + Float64(t_0 * Float64(2.0 * x2))))))); elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(3.0 * t_0) + t_4))))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * x1); t_3 = (x1 * x1) + 1.0; t_4 = t_3 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_3) * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))); tmp = 0.0; if (x1 <= -2.45e+116) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -1.06) tmp = x1 + (t_1 + (x1 + (t_2 + (t_4 + (t_0 * (2.0 * x2)))))); elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = x1 + (t_1 + (x1 + (t_2 + ((3.0 * t_0) + t_4)))); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.45e+116], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.06], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(t$95$4 + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(3.0 * t$95$0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_3} \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+116}:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.06:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_2 + \left(t\_4 + t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_2 + \left(3 \cdot t\_0 + t\_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.4499999999999999e116Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 11.6%
*-commutative11.6%
Simplified11.6%
Taylor expanded in x1 around 0 65.7%
if -2.4499999999999999e116 < x1 < -1.0600000000000001Initial program 94.0%
Taylor expanded in x1 around 0 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x1 around 0 76.6%
+-commutative76.6%
mul-1-neg76.6%
unsub-neg76.6%
Simplified76.6%
Taylor expanded in x1 around 0 78.0%
Taylor expanded in x1 around 0 78.1%
if -1.0600000000000001 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 1.3500000000000001 < x1 < 2e114Initial program 94.6%
Taylor expanded in x1 around 0 93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x1 around 0 75.5%
+-commutative75.5%
mul-1-neg75.5%
unsub-neg75.5%
Simplified75.5%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x1 around inf 82.2%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification90.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(*
t_1
(+
(* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))
(* (* x1 x1) 6.0))))))))))
(if (<= x1 -2.45e+116)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -0.43)
t_2
(if (<= x1 1.35)
(+
x1
(+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(if (<= x1 2e+114)
t_2
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -0.43) {
tmp = t_2;
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = t_2;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) + (t_1 * ((4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0)))) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-2.45d+116)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-0.43d0)) then
tmp = t_2
else if (x1 <= 1.35d0) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+114) then
tmp = t_2
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -2.45e+116) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -0.43) {
tmp = t_2;
} else if (x1 <= 1.35) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else if (x1 <= 2e+114) {
tmp = t_2;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -2.45e+116: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -0.43: tmp = t_2 elif x1 <= 1.35: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) elif x1 <= 2e+114: tmp = t_2 else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(t_1 * Float64(Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -2.45e+116) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -0.43) tmp = t_2; elseif (x1 <= 1.35) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); elseif (x1 <= 2e+114) tmp = t_2; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * ((4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -2.45e+116) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -0.43) tmp = t_2; elseif (x1 <= 1.35) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); elseif (x1 <= 2e+114) tmp = t_2; else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.45e+116], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.43], t$95$2, If[LessEqual[x1, 1.35], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+114], t$95$2, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $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 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} + t\_1 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2.45 \cdot 10^{+116}:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.43:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.4499999999999999e116Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 11.6%
*-commutative11.6%
Simplified11.6%
Taylor expanded in x1 around 0 65.7%
if -2.4499999999999999e116 < x1 < -0.429999999999999993 or 1.3500000000000001 < x1 < 2e114Initial program 94.3%
Taylor expanded in x1 around 0 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in x1 around 0 76.0%
+-commutative76.0%
mul-1-neg76.0%
unsub-neg76.0%
Simplified76.0%
Taylor expanded in x1 around 0 80.2%
Taylor expanded in x1 around inf 78.5%
if -0.429999999999999993 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 98.7%
if 2e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification90.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 -2.0))))
(t_1 (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))))
(if (<= x1 -29.5)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -3.5e-54)
(+ x1 (+ 9.0 (+ x1 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(if (<= x1 -8.2e-93)
t_0
(if (<= x1 -4.2e-121)
t_1
(if (<= x1 9.5e-97)
t_0
(if (<= x1 3.8e+102)
t_1
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * -2.0));
double t_1 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -29.5) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -3.5e-54) {
tmp = x1 + (9.0 + (x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= -8.2e-93) {
tmp = t_0;
} else if (x1 <= -4.2e-121) {
tmp = t_1;
} else if (x1 <= 9.5e-97) {
tmp = t_0;
} else if (x1 <= 3.8e+102) {
tmp = t_1;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
t_1 = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
if (x1 <= (-29.5d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-3.5d-54)) then
tmp = x1 + (9.0d0 + (x1 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else if (x1 <= (-8.2d-93)) then
tmp = t_0
else if (x1 <= (-4.2d-121)) then
tmp = t_1
else if (x1 <= 9.5d-97) then
tmp = t_0
else if (x1 <= 3.8d+102) then
tmp = t_1
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * -2.0));
double t_1 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -29.5) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -3.5e-54) {
tmp = x1 + (9.0 + (x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= -8.2e-93) {
tmp = t_0;
} else if (x1 <= -4.2e-121) {
tmp = t_1;
} else if (x1 <= 9.5e-97) {
tmp = t_0;
} else if (x1 <= 3.8e+102) {
tmp = t_1;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * -2.0)) t_1 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) tmp = 0 if x1 <= -29.5: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -3.5e-54: tmp = x1 + (9.0 + (x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))) elif x1 <= -8.2e-93: tmp = t_0 elif x1 <= -4.2e-121: tmp = t_1 elif x1 <= 9.5e-97: tmp = t_0 elif x1 <= 3.8e+102: tmp = t_1 else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))) t_1 = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)) tmp = 0.0 if (x1 <= -29.5) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -3.5e-54) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); elseif (x1 <= -8.2e-93) tmp = t_0; elseif (x1 <= -4.2e-121) tmp = t_1; elseif (x1 <= 9.5e-97) tmp = t_0; elseif (x1 <= 3.8e+102) tmp = t_1; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * -2.0)); t_1 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); tmp = 0.0; if (x1 <= -29.5) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -3.5e-54) tmp = x1 + (9.0 + (x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2)))))); elseif (x1 <= -8.2e-93) tmp = t_0; elseif (x1 <= -4.2e-121) tmp = t_1; elseif (x1 <= 9.5e-97) tmp = t_0; elseif (x1 <= 3.8e+102) tmp = t_1; else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -29.5], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.5e-54], N[(x1 + N[(9.0 + N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.2e-93], t$95$0, If[LessEqual[x1, -4.2e-121], t$95$1, If[LessEqual[x1, 9.5e-97], t$95$0, If[LessEqual[x1, 3.8e+102], t$95$1, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
t_1 := x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{if}\;x1 \leq -29.5:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.5 \cdot 10^{-54}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -8.2 \cdot 10^{-93}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-97}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -29.5Initial program 28.8%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around inf 11.9%
*-commutative11.9%
Simplified11.9%
Taylor expanded in x1 around 0 50.9%
if -29.5 < x1 < -3.49999999999999982e-54Initial program 99.0%
Taylor expanded in x1 around 0 73.4%
Taylor expanded in x1 around inf 60.1%
Taylor expanded in x2 around 0 85.7%
if -3.49999999999999982e-54 < x1 < -8.1999999999999998e-93 or -4.1999999999999997e-121 < x1 < 9.5000000000000001e-97Initial program 99.5%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 86.3%
*-commutative86.3%
Simplified86.3%
if -8.1999999999999998e-93 < x1 < -4.1999999999999997e-121 or 9.5000000000000001e-97 < x1 < 3.79999999999999979e102Initial program 99.3%
Taylor expanded in x1 around 0 63.4%
Taylor expanded in x1 around 0 56.9%
Taylor expanded in x1 around 0 61.8%
Taylor expanded in x1 around inf 57.5%
if 3.79999999999999979e102 < x1 Initial program 15.2%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x2 around 0 97.8%
Final simplification75.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))))
(if (<= x1 -2300000000000.0)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -8.7e-268)
t_0
(if (<= x1 5.3e-263)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 1.4e+114)
t_0
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -8.7e-268) {
tmp = t_0;
} else if (x1 <= 5.3e-263) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.4e+114) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
if (x1 <= (-2300000000000.0d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-8.7d-268)) then
tmp = t_0
else if (x1 <= 5.3d-263) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 1.4d+114) then
tmp = t_0
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -8.7e-268) {
tmp = t_0;
} else if (x1 <= 5.3e-263) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.4e+114) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) tmp = 0 if x1 <= -2300000000000.0: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -8.7e-268: tmp = t_0 elif x1 <= 5.3e-263: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 1.4e+114: tmp = t_0 else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))) tmp = 0.0 if (x1 <= -2300000000000.0) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -8.7e-268) tmp = t_0; elseif (x1 <= 5.3e-263) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 1.4e+114) tmp = t_0; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); tmp = 0.0; if (x1 <= -2300000000000.0) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -8.7e-268) tmp = t_0; elseif (x1 <= 5.3e-263) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 1.4e+114) tmp = t_0; else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2300000000000.0], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.7e-268], t$95$0, If[LessEqual[x1, 5.3e-263], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.4e+114], t$95$0, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{if}\;x1 \leq -2300000000000:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -8.7 \cdot 10^{-268}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 5.3 \cdot 10^{-263}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+114}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3e12Initial program 25.3%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x1 around inf 12.4%
*-commutative12.4%
Simplified12.4%
Taylor expanded in x1 around 0 52.9%
if -2.3e12 < x1 < -8.69999999999999957e-268 or 5.2999999999999997e-263 < x1 < 1.4e114Initial program 98.6%
Taylor expanded in x1 around 0 78.6%
Taylor expanded in x1 around 0 75.8%
Taylor expanded in x1 around 0 78.5%
Taylor expanded in x1 around 0 78.5%
if -8.69999999999999957e-268 < x1 < 5.2999999999999997e-263Initial program 99.7%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 72.9%
Taylor expanded in x1 around 0 73.0%
Taylor expanded in x2 around 0 93.8%
*-commutative93.8%
Simplified93.8%
if 1.4e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification77.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2300000000000.0)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 1.12e-20)
(+ x1 (+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= 1.12e-20) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2300000000000.0d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= 1.12d-20) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= 1.12e-20) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2300000000000.0: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= 1.12e-20: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2300000000000.0) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= 1.12e-20) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2300000000000.0) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= 1.12e-20) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2300000000000.0], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.12e-20], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2300000000000:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.12 \cdot 10^{-20}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3e12Initial program 25.3%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x1 around inf 12.4%
*-commutative12.4%
Simplified12.4%
Taylor expanded in x1 around 0 52.9%
if -2.3e12 < x1 < 1.12000000000000002e-20Initial program 99.4%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x1 around 0 85.1%
Taylor expanded in x2 around 0 97.7%
if 1.12000000000000002e-20 < x1 Initial program 44.1%
Taylor expanded in x1 around 0 19.7%
Taylor expanded in x1 around 0 68.4%
Taylor expanded in x2 around 0 79.8%
Final simplification82.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))))
(if (<= x1 -2300000000000.0)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -4.2e-121)
t_0
(if (<= x1 3e-97)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 1.9e+105)
t_0
(* x1 (+ 1.0 (* x1 (* 3.0 (+ (* 2.0 x2) (+ x1 3.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 3e-97) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.9e+105) {
tmp = t_0;
} else {
tmp = x1 * (1.0 + (x1 * (3.0 * ((2.0 * x2) + (x1 + 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) :: tmp
t_0 = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
if (x1 <= (-2300000000000.0d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-4.2d-121)) then
tmp = t_0
else if (x1 <= 3d-97) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 1.9d+105) then
tmp = t_0
else
tmp = x1 * (1.0d0 + (x1 * (3.0d0 * ((2.0d0 * x2) + (x1 + 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 3e-97) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.9e+105) {
tmp = t_0;
} else {
tmp = x1 * (1.0 + (x1 * (3.0 * ((2.0 * x2) + (x1 + 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) tmp = 0 if x1 <= -2300000000000.0: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -4.2e-121: tmp = t_0 elif x1 <= 3e-97: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 1.9e+105: tmp = t_0 else: tmp = x1 * (1.0 + (x1 * (3.0 * ((2.0 * x2) + (x1 + 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)) tmp = 0.0 if (x1 <= -2300000000000.0) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 3e-97) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 1.9e+105) tmp = t_0; else tmp = Float64(x1 * Float64(1.0 + Float64(x1 * Float64(3.0 * Float64(Float64(2.0 * x2) + Float64(x1 + 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); tmp = 0.0; if (x1 <= -2300000000000.0) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 3e-97) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 1.9e+105) tmp = t_0; else tmp = x1 * (1.0 + (x1 * (3.0 * ((2.0 * x2) + (x1 + 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2300000000000.0], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.2e-121], t$95$0, If[LessEqual[x1, 3e-97], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e+105], t$95$0, N[(x1 * N[(1.0 + N[(x1 * N[(3.0 * N[(N[(2.0 * x2), $MachinePrecision] + N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{if}\;x1 \leq -2300000000000:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 3 \cdot 10^{-97}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+105}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(1 + x1 \cdot \left(3 \cdot \left(2 \cdot x2 + \left(x1 + 3\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3e12Initial program 25.3%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x1 around inf 12.4%
*-commutative12.4%
Simplified12.4%
Taylor expanded in x1 around 0 52.9%
if -2.3e12 < x1 < -4.1999999999999997e-121 or 3.00000000000000024e-97 < x1 < 1.9e105Initial program 99.1%
Taylor expanded in x1 around 0 66.5%
Taylor expanded in x1 around 0 60.9%
Taylor expanded in x1 around 0 66.1%
Taylor expanded in x1 around inf 57.1%
if -4.1999999999999997e-121 < x1 < 3.00000000000000024e-97Initial program 99.6%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x2 around 0 86.4%
*-commutative86.4%
Simplified86.4%
if 1.9e105 < x1 Initial program 13.3%
Taylor expanded in x1 around 0 4.9%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x1 around inf 93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in x1 around 0 93.3%
distribute-lft-out93.3%
cancel-sign-sub-inv93.3%
metadata-eval93.3%
*-commutative93.3%
associate-+l+93.3%
Simplified93.3%
Final simplification72.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))))
(if (<= x1 -2200000000000.0)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 -4.2e-121)
t_0
(if (<= x1 1.6e-99)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 3.8e+102)
t_0
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -2200000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 1.6e-99) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.8e+102) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
if (x1 <= (-2200000000000.0d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= (-4.2d-121)) then
tmp = t_0
else if (x1 <= 1.6d-99) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 3.8d+102) then
tmp = t_0
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double tmp;
if (x1 <= -2200000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 1.6e-99) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.8e+102) {
tmp = t_0;
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) tmp = 0 if x1 <= -2200000000000.0: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= -4.2e-121: tmp = t_0 elif x1 <= 1.6e-99: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 3.8e+102: tmp = t_0 else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)) tmp = 0.0 if (x1 <= -2200000000000.0) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 1.6e-99) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 3.8e+102) tmp = t_0; else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); tmp = 0.0; if (x1 <= -2200000000000.0) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 1.6e-99) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 3.8e+102) tmp = t_0; else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2200000000000.0], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.2e-121], t$95$0, If[LessEqual[x1, 1.6e-99], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e+102], t$95$0, N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{if}\;x1 \leq -2200000000000:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-99}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+102}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.2e12Initial program 25.3%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x1 around inf 12.4%
*-commutative12.4%
Simplified12.4%
Taylor expanded in x1 around 0 52.9%
if -2.2e12 < x1 < -4.1999999999999997e-121 or 1.6e-99 < x1 < 3.79999999999999979e102Initial program 99.1%
Taylor expanded in x1 around 0 66.0%
Taylor expanded in x1 around 0 61.8%
Taylor expanded in x1 around 0 65.6%
Taylor expanded in x1 around inf 56.5%
if -4.1999999999999997e-121 < x1 < 1.6e-99Initial program 99.6%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x2 around 0 86.4%
*-commutative86.4%
Simplified86.4%
if 3.79999999999999979e102 < x1 Initial program 15.2%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x2 around 0 97.8%
Final simplification73.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(t_1 (* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))))
(if (<= x1 -2300000000000.0)
t_1
(if (<= x1 -4.2e-121)
t_0
(if (<= x1 1.32e-99)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 3.7e+113) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double t_1 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
double tmp;
if (x1 <= -2300000000000.0) {
tmp = t_1;
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 1.32e-99) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.7e+113) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
t_1 = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
if (x1 <= (-2300000000000.0d0)) then
tmp = t_1
else if (x1 <= (-4.2d-121)) then
tmp = t_0
else if (x1 <= 1.32d-99) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 3.7d+113) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
double t_1 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
double tmp;
if (x1 <= -2300000000000.0) {
tmp = t_1;
} else if (x1 <= -4.2e-121) {
tmp = t_0;
} else if (x1 <= 1.32e-99) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 3.7e+113) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) t_1 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) tmp = 0 if x1 <= -2300000000000.0: tmp = t_1 elif x1 <= -4.2e-121: tmp = t_0 elif x1 <= 1.32e-99: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 3.7e+113: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)) t_1 = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))) tmp = 0.0 if (x1 <= -2300000000000.0) tmp = t_1; elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 1.32e-99) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 3.7e+113) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); t_1 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); tmp = 0.0; if (x1 <= -2300000000000.0) tmp = t_1; elseif (x1 <= -4.2e-121) tmp = t_0; elseif (x1 <= 1.32e-99) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 3.7e+113) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2300000000000.0], t$95$1, If[LessEqual[x1, -4.2e-121], t$95$0, If[LessEqual[x1, 1.32e-99], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.7e+113], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
t_1 := x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2300000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1.32 \cdot 10^{-99}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -2.3e12 or 3.6999999999999998e113 < x1 Initial program 20.1%
Taylor expanded in x1 around 0 4.2%
Taylor expanded in x1 around 0 40.5%
Taylor expanded in x1 around inf 47.4%
*-commutative47.4%
Simplified47.4%
Taylor expanded in x1 around 0 60.2%
if -2.3e12 < x1 < -4.1999999999999997e-121 or 1.31999999999999999e-99 < x1 < 3.6999999999999998e113Initial program 99.1%
Taylor expanded in x1 around 0 66.5%
Taylor expanded in x1 around 0 60.9%
Taylor expanded in x1 around 0 66.1%
Taylor expanded in x1 around inf 57.1%
if -4.1999999999999997e-121 < x1 < 1.31999999999999999e-99Initial program 99.6%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x1 around 0 87.5%
Taylor expanded in x2 around 0 86.4%
*-commutative86.4%
Simplified86.4%
Final simplification68.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2300000000000.0)
(* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))
(if (<= x1 1.4e+114)
(+ x1 (+ (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) (* x1 -2.0)))
(+ x1 (+ x1 (* 3.0 (* x1 (+ (* x1 (+ x1 3.0)) -1.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= 1.4e+114) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2300000000000.0d0)) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else if (x1 <= 1.4d+114) then
tmp = x1 + ((x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 + (x1 + (3.0d0 * (x1 * ((x1 * (x1 + 3.0d0)) + (-1.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2300000000000.0) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else if (x1 <= 1.4e+114) {
tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0));
} else {
tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2300000000000.0: tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) elif x1 <= 1.4e+114: tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)) else: tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2300000000000.0) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); elseif (x1 <= 1.4e+114) tmp = Float64(x1 + Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) + Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(x1 + Float64(3.0 * Float64(x1 * Float64(Float64(x1 * Float64(x1 + 3.0)) + -1.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2300000000000.0) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); elseif (x1 <= 1.4e+114) tmp = x1 + ((x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) + (x1 * -2.0)); else tmp = x1 + (x1 + (3.0 * (x1 * ((x1 * (x1 + 3.0)) + -1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2300000000000.0], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.4e+114], N[(x1 + N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(3.0 * N[(x1 * N[(N[(x1 * N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2300000000000:\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+114}:\\
\;\;\;\;x1 + \left(x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 + 3\right) + -1\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.3e12Initial program 25.3%
Taylor expanded in x1 around 0 3.6%
Taylor expanded in x1 around 0 3.5%
Taylor expanded in x1 around inf 12.4%
*-commutative12.4%
Simplified12.4%
Taylor expanded in x1 around 0 52.9%
if -2.3e12 < x1 < 1.4e114Initial program 98.7%
Taylor expanded in x1 around 0 77.8%
Taylor expanded in x1 around 0 75.3%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 88.1%
if 1.4e114 < x1 Initial program 13.6%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification82.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0))))))))
(if (<= x1 -6.5e-9)
t_0
(if (<= x1 9e-41)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 1.9e+110)
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
double tmp;
if (x1 <= -6.5e-9) {
tmp = t_0;
} else if (x1 <= 9e-41) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.9e+110) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} 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) :: tmp
t_0 = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
if (x1 <= (-6.5d-9)) then
tmp = t_0
else if (x1 <= 9d-41) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 1.9d+110) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
double tmp;
if (x1 <= -6.5e-9) {
tmp = t_0;
} else if (x1 <= 9e-41) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.9e+110) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) tmp = 0 if x1 <= -6.5e-9: tmp = t_0 elif x1 <= 9e-41: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 1.9e+110: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))) tmp = 0.0 if (x1 <= -6.5e-9) tmp = t_0; elseif (x1 <= 9e-41) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 1.9e+110) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); tmp = 0.0; if (x1 <= -6.5e-9) tmp = t_0; elseif (x1 <= 9e-41) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 1.9e+110) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.5e-9], t$95$0, If[LessEqual[x1, 9e-41], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e+110], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-41}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+110}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -6.5000000000000003e-9 or 1.89999999999999994e110 < x1 Initial program 23.0%
Taylor expanded in x1 around 0 5.0%
Taylor expanded in x1 around 0 40.0%
Taylor expanded in x1 around inf 45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in x1 around 0 58.3%
if -6.5000000000000003e-9 < x1 < 9e-41Initial program 99.4%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 87.0%
Taylor expanded in x2 around 0 78.4%
*-commutative78.4%
Simplified78.4%
if 9e-41 < x1 < 1.89999999999999994e110Initial program 99.4%
Taylor expanded in x1 around 0 52.2%
Taylor expanded in x1 around inf 43.4%
Taylor expanded in x1 around inf 43.4%
Final simplification65.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6.5e-9) (not (<= x1 1.35))) (* x1 (+ 1.0 (* 3.0 (* x1 (- 3.0 (* x2 -2.0)))))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e-9) || !(x1 <= 1.35)) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6.5d-9)) .or. (.not. (x1 <= 1.35d0))) then
tmp = x1 * (1.0d0 + (3.0d0 * (x1 * (3.0d0 - (x2 * (-2.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.5e-9) || !(x1 <= 1.35)) {
tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.5e-9) or not (x1 <= 1.35): tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.5e-9) || !(x1 <= 1.35)) tmp = Float64(x1 * Float64(1.0 + Float64(3.0 * Float64(x1 * Float64(3.0 - Float64(x2 * -2.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6.5e-9) || ~((x1 <= 1.35))) tmp = x1 * (1.0 + (3.0 * (x1 * (3.0 - (x2 * -2.0))))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.5e-9], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(x1 * N[(1.0 + N[(3.0 * N[(x1 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{-9} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;x1 \cdot \left(1 + 3 \cdot \left(x1 \cdot \left(3 - x2 \cdot -2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -6.5000000000000003e-9 or 1.3500000000000001 < x1 Initial program 35.0%
Taylor expanded in x1 around 0 10.4%
Taylor expanded in x1 around 0 37.0%
Taylor expanded in x1 around inf 41.8%
*-commutative41.8%
Simplified41.8%
Taylor expanded in x1 around 0 52.2%
if -6.5000000000000003e-9 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x1 around 0 86.1%
Taylor expanded in x2 around 0 73.9%
*-commutative73.9%
Simplified73.9%
Final simplification63.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.1e+99) (not (<= x1 1.35))) (+ 9.0 (+ (* x1 2.0) (* -12.0 (* x1 x2)))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.1e+99) || !(x1 <= 1.35)) {
tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.1d+99)) .or. (.not. (x1 <= 1.35d0))) then
tmp = 9.0d0 + ((x1 * 2.0d0) + ((-12.0d0) * (x1 * x2)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.1e+99) || !(x1 <= 1.35)) {
tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.1e+99) or not (x1 <= 1.35): tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.1e+99) || !(x1 <= 1.35)) tmp = Float64(9.0 + Float64(Float64(x1 * 2.0) + Float64(-12.0 * Float64(x1 * x2)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.1e+99) || ~((x1 <= 1.35))) tmp = 9.0 + ((x1 * 2.0) + (-12.0 * (x1 * x2))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.1e+99], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(9.0 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{+99} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;9 + \left(x1 \cdot 2 + -12 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -3.1000000000000001e99 or 1.3500000000000001 < x1 Initial program 25.1%
Taylor expanded in x1 around 0 10.8%
Taylor expanded in x1 around inf 27.6%
Taylor expanded in x2 around 0 21.5%
if -3.1000000000000001e99 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around 0 76.7%
Taylor expanded in x1 around 0 76.7%
Taylor expanded in x1 around 0 77.4%
Taylor expanded in x2 around 0 65.9%
*-commutative65.9%
Simplified65.9%
Final simplification46.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -6.2e-186) (not (<= x2 1.4e-178))) (+ x1 (* x2 -6.0)) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.2e-186) || !(x2 <= 1.4e-178)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-6.2d-186)) .or. (.not. (x2 <= 1.4d-178))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.2e-186) || !(x2 <= 1.4e-178)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -6.2e-186) or not (x2 <= 1.4e-178): tmp = x1 + (x2 * -6.0) else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -6.2e-186) || !(x2 <= 1.4e-178)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -6.2e-186) || ~((x2 <= 1.4e-178))) tmp = x1 + (x2 * -6.0); else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -6.2e-186], N[Not[LessEqual[x2, 1.4e-178]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.2 \cdot 10^{-186} \lor \neg \left(x2 \leq 1.4 \cdot 10^{-178}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -6.20000000000000018e-186 or 1.4000000000000001e-178 < x2 Initial program 65.6%
Taylor expanded in x1 around 0 46.9%
Taylor expanded in x1 around 0 61.1%
Taylor expanded in x1 around 0 32.8%
*-commutative32.8%
Simplified32.8%
if -6.20000000000000018e-186 < x2 < 1.4000000000000001e-178Initial program 74.4%
Taylor expanded in x1 around 0 54.2%
Taylor expanded in x1 around 0 63.3%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x2 around 0 47.0%
distribute-rgt1-in47.0%
metadata-eval47.0%
neg-mul-147.0%
Simplified47.0%
Final simplification35.3%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x2 -6.0) (* x1 -2.0))))
double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
def code(x1, x2): return x1 + ((x2 * -6.0) + (x1 * -2.0))
function code(x1, x2) return Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))) end
function tmp = code(x1, x2) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end
code[x1_, x2_] := N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)
\end{array}
Initial program 67.2%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x1 around 0 55.2%
Taylor expanded in x2 around 0 38.6%
*-commutative38.6%
Simplified38.6%
Final simplification38.6%
(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 Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 67.2%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x1 around 0 55.2%
Taylor expanded in x2 around 0 12.0%
distribute-rgt1-in12.0%
metadata-eval12.0%
neg-mul-112.0%
Simplified12.0%
Final simplification12.0%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 67.2%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x1 around inf 22.7%
Taylor expanded in x1 around 0 3.8%
Final simplification3.8%
herbie shell --seed 2024089
(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))))))