
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double 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 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) 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(6.0 * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, 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[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.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 11.7%
Taylor expanded in x1 around inf 96.1%
Final simplification98.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+ x1 (+ (+ x1 (+ t_0 (+ t_4 (* 3.0 t_1)))) (* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))) tmp = 0 if (x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (6.0 * math.pow(x1, 4.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_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)))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))); tmp = 0.0; if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (6.0 * (x1 ^ 4.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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$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]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $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[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_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)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_4 + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Taylor expanded in x1 around inf 98.9%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 11.7%
Taylor expanded in x1 around inf 96.1%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* 3.0 t_1))))
(* 3.0 (* x2 -2.0))))))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -5.6e+102)
(+
x1
(+
t_3
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 -215000000.0)
t_5
(if (<= x1 6.6e-6)
(+
x1
(+ t_3 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+153) t_5 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = t_5;
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_5 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))) + (3.0d0 * (x2 * (-2.0d0))))
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= (-215000000.0d0)) then
tmp = t_5
else if (x1 <= 6.6d-6) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+153) then
tmp = t_5
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = t_5;
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * (x2 * -2.0))) tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -5.6e+102: tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= -215000000.0: tmp = t_5 elif x1 <= 6.6e-6: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+153: tmp = t_5 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))) + Float64(3.0 * Float64(x2 * -2.0)))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= -215000000.0) tmp = t_5; elseif (x1 <= 6.6e-6) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * (x2 * -2.0))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= -215000000.0) tmp = t_5; elseif (x1 <= 6.6e-6) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -215000000.0], t$95$5, If[LessEqual[x1, 6.6e-6], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$5, t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -215000000:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5.60000000000000037e102 < x1 < -2.15e8 or 6.60000000000000034e-6 < x1 < 1e153Initial program 93.6%
Taylor expanded in x1 around inf 93.4%
Taylor expanded in x1 around 0 93.4%
*-commutative93.4%
Simplified93.4%
if -2.15e8 < x1 < 6.60000000000000034e-6Initial program 99.4%
Taylor expanded in x1 around 0 91.5%
Taylor expanded in x2 around 0 99.3%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 t_2))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_4)))
(t_6 (/ (- (+ t_2 (* 2.0 x2)) x1) t_4))
(t_7 (- t_6 3.0)))
(if (<= x1 -4.5e+153)
t_1
(if (<= x1 -5.6e+102)
(+
x1
(+
t_5
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 -215000000.0)
(+
x1
(+
9.0
(+
x1
(+
t_0
(+
t_3
(* t_4 (+ (* (* (* x1 2.0) t_6) t_7) (* (* x1 x1) 6.0))))))))
(if (<= x1 115.0)
(+
x1
(+ t_5 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+153)
(+
x1
(+
t_5
(+
x1
(+
t_0
(+
t_3
(*
t_4
(+
(* (* x1 x1) (- (* t_6 4.0) 6.0))
(* t_7 (* (* x1 2.0) 3.0)))))))))
t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4);
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_7 = t_6 - 3.0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_5 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = x1 + (9.0 + (x1 + (t_0 + (t_3 + (t_4 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 115.0) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_3 + (t_4 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + (t_7 * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * t_2
t_4 = (x1 * x1) + 1.0d0
t_5 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_4)
t_6 = ((t_2 + (2.0d0 * x2)) - x1) / t_4
t_7 = t_6 - 3.0d0
if (x1 <= (-4.5d+153)) then
tmp = t_1
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_5 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= (-215000000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + (t_3 + (t_4 * ((((x1 * 2.0d0) * t_6) * t_7) + ((x1 * x1) * 6.0d0)))))))
else if (x1 <= 115.0d0) then
tmp = x1 + (t_5 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_5 + (x1 + (t_0 + (t_3 + (t_4 * (((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)) + (t_7 * ((x1 * 2.0d0) * 3.0d0))))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4);
double t_6 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_7 = t_6 - 3.0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_5 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = x1 + (9.0 + (x1 + (t_0 + (t_3 + (t_4 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * 6.0)))))));
} else if (x1 <= 115.0) {
tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_5 + (x1 + (t_0 + (t_3 + (t_4 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + (t_7 * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * t_2 t_4 = (x1 * x1) + 1.0 t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4) t_6 = ((t_2 + (2.0 * x2)) - x1) / t_4 t_7 = t_6 - 3.0 tmp = 0 if x1 <= -4.5e+153: tmp = t_1 elif x1 <= -5.6e+102: tmp = x1 + (t_5 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= -215000000.0: tmp = x1 + (9.0 + (x1 + (t_0 + (t_3 + (t_4 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * 6.0))))))) elif x1 <= 115.0: tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+153: tmp = x1 + (t_5 + (x1 + (t_0 + (t_3 + (t_4 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + (t_7 * ((x1 * 2.0) * 3.0)))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * t_2) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_4)) t_6 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_4) t_7 = Float64(t_6 - 3.0) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= -215000000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(t_3 + Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * t_7) + Float64(Float64(x1 * x1) * 6.0)))))))); elseif (x1 <= 115.0) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_0 + Float64(t_3 + Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)) + Float64(t_7 * Float64(Float64(x1 * 2.0) * 3.0))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * t_2; t_4 = (x1 * x1) + 1.0; t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4); t_6 = ((t_2 + (2.0 * x2)) - x1) / t_4; t_7 = t_6 - 3.0; tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5.6e+102) tmp = x1 + (t_5 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= -215000000.0) tmp = x1 + (9.0 + (x1 + (t_0 + (t_3 + (t_4 * ((((x1 * 2.0) * t_6) * t_7) + ((x1 * x1) * 6.0))))))); elseif (x1 <= 115.0) tmp = x1 + (t_5 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+153) tmp = x1 + (t_5 + (x1 + (t_0 + (t_3 + (t_4 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + (t_7 * ((x1 * 2.0) * 3.0)))))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$1, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$5 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -215000000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(t$95$3 + N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * t$95$7), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 115.0], N[(x1 + N[(t$95$5 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$0 + N[(t$95$3 + N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot t\_2\\
t_4 := x1 \cdot x1 + 1\\
t_5 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_4}\\
t_6 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_4}\\
t_7 := t\_6 - 3\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -215000000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_3 + t\_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot t\_7 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 115:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_0 + \left(t\_3 + t\_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right) + t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5.60000000000000037e102 < x1 < -2.15e8Initial program 99.4%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around inf 86.8%
if -2.15e8 < x1 < 115Initial program 99.4%
Taylor expanded in x1 around 0 91.4%
Taylor expanded in x2 around 0 99.1%
if 115 < x1 < 1e153Initial program 90.6%
Taylor expanded in x1 around inf 90.3%
Taylor expanded in x1 around inf 87.3%
Final simplification96.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* 3.0 t_1))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)))
(t_5 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_6 (- t_5 3.0))
(t_7 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_8 (* (* x1 x1) (- (* t_5 4.0) 6.0))))
(if (<= x1 -4.5e+153)
t_7
(if (<= x1 -2e+103)
(+
x1
(+
t_4
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 6.6e-6)
(+
x1
(+
t_4
(+
x1
(+
t_0
(+
t_2
(* t_3 (+ t_8 (* t_6 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(if (<= x1 1e+153)
(+
x1
(+
(+ x1 (+ t_0 (+ (* t_3 (+ (* (* (* x1 2.0) t_5) t_6) t_8)) t_2)))
(* 3.0 (* x2 -2.0))))
t_7))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_5 - 3.0;
double t_7 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_8 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_7;
} else if (x1 <= -2e+103) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_4 + (x1 + (t_0 + (t_2 + (t_3 * (t_8 + (t_6 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + t_8)) + t_2))) + (3.0 * (x2 * -2.0)));
} else {
tmp = t_7;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = 3.0d0 * t_1
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
t_5 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_6 = t_5 - 3.0d0
t_7 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_8 = (x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)
if (x1 <= (-4.5d+153)) then
tmp = t_7
else if (x1 <= (-2d+103)) then
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= 6.6d-6) then
tmp = x1 + (t_4 + (x1 + (t_0 + (t_2 + (t_3 * (t_8 + (t_6 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else if (x1 <= 1d+153) then
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((((x1 * 2.0d0) * t_5) * t_6) + t_8)) + t_2))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = t_7
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 3.0 * t_1;
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_5 - 3.0;
double t_7 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_8 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_7;
} else if (x1 <= -2e+103) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_4 + (x1 + (t_0 + (t_2 + (t_3 * (t_8 + (t_6 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + t_8)) + t_2))) + (3.0 * (x2 * -2.0)));
} else {
tmp = t_7;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = 3.0 * t_1 t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) t_5 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_6 = t_5 - 3.0 t_7 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_8 = (x1 * x1) * ((t_5 * 4.0) - 6.0) tmp = 0 if x1 <= -4.5e+153: tmp = t_7 elif x1 <= -2e+103: tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= 6.6e-6: tmp = x1 + (t_4 + (x1 + (t_0 + (t_2 + (t_3 * (t_8 + (t_6 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) elif x1 <= 1e+153: tmp = x1 + ((x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + t_8)) + t_2))) + (3.0 * (x2 * -2.0))) else: tmp = t_7 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(3.0 * t_1) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_6 = Float64(t_5 - 3.0) t_7 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_7; elseif (x1 <= -2e+103) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= 6.6e-6) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(t_2 + Float64(t_3 * Float64(t_8 + Float64(t_6 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_6) + t_8)) + t_2))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = t_7; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = 3.0 * t_1; t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); t_5 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_6 = t_5 - 3.0; t_7 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_8 = (x1 * x1) * ((t_5 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_7; elseif (x1 <= -2e+103) tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= 6.6e-6) tmp = x1 + (t_4 + (x1 + (t_0 + (t_2 + (t_3 * (t_8 + (t_6 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); elseif (x1 <= 1e+153) tmp = x1 + ((x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + t_8)) + t_2))) + (3.0 * (x2 * -2.0))); else tmp = t_7; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - 3.0), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$7, If[LessEqual[x1, -2e+103], N[(x1 + N[(t$95$4 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.6e-6], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(t$95$2 + N[(t$95$3 * N[(t$95$8 + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$6), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$7]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 3 \cdot t\_1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := t\_5 - 3\\
t_7 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq -2 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(t\_2 + t\_3 \cdot \left(t\_8 + t\_6 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot t\_6 + t\_8\right) + t\_2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_7\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -2e103Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -2e103 < x1 < 6.60000000000000034e-6Initial program 99.4%
Taylor expanded in x1 around inf 98.9%
Taylor expanded in x1 around 0 96.9%
+-commutative96.9%
mul-1-neg96.9%
sub-neg96.9%
Simplified96.9%
if 6.60000000000000034e-6 < x1 < 1e153Initial program 91.2%
Taylor expanded in x1 around inf 90.9%
Taylor expanded in x1 around 0 90.9%
*-commutative90.9%
Simplified90.9%
Final simplification96.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3)))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_6 (- t_5 3.0)))
(if (<= x1 -4.5e+153)
t_1
(if (<= x1 -5e+80)
(+
x1
(+
t_4
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 34000.0)
(+
x1
(+
t_4
(+
x1
(+
t_0
(+
(* t_3 (+ (* (* (* x1 2.0) t_5) t_6) (* (* x1 x1) 6.0)))
(* t_2 (* 2.0 x2)))))))
(if (<= x1 1e+153)
(+
x1
(+
t_4
(+
x1
(+
t_0
(+
(* 3.0 t_2)
(*
t_3
(+
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(* t_6 (* (* x1 2.0) 3.0)))))))))
t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_5 - 3.0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5e+80) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 34000.0) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((x1 * x1) * 6.0))) + (t_2 * (2.0 * x2))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_2) + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_6 * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)
t_5 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_6 = t_5 - 3.0d0
if (x1 <= (-4.5d+153)) then
tmp = t_1
else if (x1 <= (-5d+80)) then
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= 34000.0d0) then
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0d0) * t_5) * t_6) + ((x1 * x1) * 6.0d0))) + (t_2 * (2.0d0 * x2))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0d0 * t_2) + (t_3 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + (t_6 * ((x1 * 2.0d0) * 3.0d0))))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_5 - 3.0;
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5e+80) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 34000.0) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((x1 * x1) * 6.0))) + (t_2 * (2.0 * x2))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_2) + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_6 * ((x1 * 2.0) * 3.0))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3) t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_6 = t_5 - 3.0 tmp = 0 if x1 <= -4.5e+153: tmp = t_1 elif x1 <= -5e+80: tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= 34000.0: tmp = x1 + (t_4 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((x1 * x1) * 6.0))) + (t_2 * (2.0 * x2)))))) elif x1 <= 1e+153: tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_2) + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_6 * ((x1 * 2.0) * 3.0)))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_6 = Float64(t_5 - 3.0) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5e+80) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= 34000.0) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_6) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_2 * Float64(2.0 * x2))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_2) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(t_6 * Float64(Float64(x1 * 2.0) * 3.0))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3); t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_6 = t_5 - 3.0; tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5e+80) tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= 34000.0) tmp = x1 + (t_4 + (x1 + (t_0 + ((t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((x1 * x1) * 6.0))) + (t_2 * (2.0 * x2)))))); elseif (x1 <= 1e+153) tmp = x1 + (t_4 + (x1 + (t_0 + ((3.0 * t_2) + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + (t_6 * ((x1 * 2.0) * 3.0)))))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - 3.0), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$1, If[LessEqual[x1, -5e+80], N[(x1 + N[(t$95$4 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 34000.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$6), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$2), $MachinePrecision] + N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := t\_5 - 3\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+80}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 34000:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot t\_6 + \left(x1 \cdot x1\right) \cdot 6\right) + t\_2 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_2 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + t\_6 \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -4.99999999999999961e80Initial program 10.0%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x2 around 0 80.0%
*-commutative80.0%
Simplified80.0%
if -4.99999999999999961e80 < x1 < 34000Initial program 99.4%
Taylor expanded in x1 around inf 98.3%
Taylor expanded in x1 around 0 97.0%
if 34000 < x1 < 1e153Initial program 90.6%
Taylor expanded in x1 around inf 90.3%
Taylor expanded in x1 around inf 87.3%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3)))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_6 (* t_3 (+ (* (* (* x1 2.0) t_5) (- t_5 3.0)) (* (* x1 x1) 6.0)))))
(if (<= x1 -4.5e+153)
t_1
(if (<= x1 -5e+102)
(+
x1
(+
t_4
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 -215000000.0)
(+ x1 (+ 9.0 (+ x1 (+ t_0 (+ (* 3.0 t_2) t_6)))))
(if (<= x1 6.6e-6)
(+
x1
(+ t_4 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+153)
(+ x1 (+ 9.0 (+ x1 (+ t_0 (+ (* t_2 t_5) t_6)))))
t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_3 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * 6.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((3.0 * t_2) + t_6))));
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_2 * t_5) + t_6))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)
t_5 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_6 = t_3 * ((((x1 * 2.0d0) * t_5) * (t_5 - 3.0d0)) + ((x1 * x1) * 6.0d0))
if (x1 <= (-4.5d+153)) then
tmp = t_1
else if (x1 <= (-5d+102)) then
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= (-215000000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((3.0d0 * t_2) + t_6))))
else if (x1 <= 6.6d-6) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+153) then
tmp = x1 + (9.0d0 + (x1 + (t_0 + ((t_2 * t_5) + t_6))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_3 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * 6.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_1;
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((3.0 * t_2) + t_6))));
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (9.0 + (x1 + (t_0 + ((t_2 * t_5) + t_6))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3) t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_6 = t_3 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * 6.0)) tmp = 0 if x1 <= -4.5e+153: tmp = t_1 elif x1 <= -5e+102: tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= -215000000.0: tmp = x1 + (9.0 + (x1 + (t_0 + ((3.0 * t_2) + t_6)))) elif x1 <= 6.6e-6: tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+153: tmp = x1 + (9.0 + (x1 + (t_0 + ((t_2 * t_5) + t_6)))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_6 = Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= -215000000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_2) + t_6))))); elseif (x1 <= 6.6e-6) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_0 + Float64(Float64(t_2 * t_5) + t_6))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3); t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_6 = t_3 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * 6.0)); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_1; elseif (x1 <= -5e+102) tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= -215000000.0) tmp = x1 + (9.0 + (x1 + (t_0 + ((3.0 * t_2) + t_6)))); elseif (x1 <= 6.6e-6) tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+153) tmp = x1 + (9.0 + (x1 + (t_0 + ((t_2 * t_5) + t_6)))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$1, If[LessEqual[x1, -5e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -215000000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$2), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.6e-6], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$0 + N[(N[(t$95$2 * t$95$5), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -215000000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(3 \cdot t\_2 + t\_6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_0 + \left(t\_2 \cdot t\_5 + t\_6\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5e102 < x1 < -2.15e8Initial program 99.4%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around inf 86.8%
Taylor expanded in x1 around inf 86.8%
if -2.15e8 < x1 < 6.60000000000000034e-6Initial program 99.4%
Taylor expanded in x1 around 0 91.5%
Taylor expanded in x2 around 0 99.3%
if 6.60000000000000034e-6 < x1 < 1e153Initial program 91.2%
Taylor expanded in x1 around inf 76.0%
Taylor expanded in x1 around inf 76.0%
Final simplification95.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -5.6e+102)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 1e+153)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* 3.0 t_1))))
(* 3.0 (- (* x2 -2.0) x1))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-5.6d+102)) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= 1d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -5.6e+102: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= 1e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 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) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + 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(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= 1e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + 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[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \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) + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5.60000000000000037e102 < x1 < 1e153Initial program 97.8%
Taylor expanded in x1 around inf 97.3%
Taylor expanded in x1 around 0 97.8%
mul-1-neg97.8%
unsub-neg97.8%
*-commutative97.8%
Simplified97.8%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 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 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_5
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_3)
(*
t_2
(+ (* (* x1 x1) 6.0) (* (- t_3 3.0) (* (* x1 2.0) 3.0)))))))))))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -5.6e+102)
(+
x1
(+
t_4
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 -1.4e+30)
t_5
(if (<= x1 3.9e+34)
(+
x1
(+ t_4 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+153) t_5 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * 3.0))))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -1.4e+30) {
tmp = t_5;
} else if (x1 <= 3.9e+34) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 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 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0d0) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * 3.0d0))))))))
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= (-1.4d+30)) then
tmp = t_5
else if (x1 <= 3.9d+34) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+153) then
tmp = t_5
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * 3.0))))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -1.4e+30) {
tmp = t_5;
} else if (x1 <= 3.9e+34) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * 3.0)))))))) tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -5.6e+102: tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= -1.4e+30: tmp = t_5 elif x1 <= 3.9e+34: tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+153: tmp = t_5 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 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(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * 3.0))))))))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= -1.4e+30) tmp = t_5; elseif (x1 <= 3.9e+34) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * 3.0)))))))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = x1 + (t_4 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= -1.4e+30) tmp = t_5; elseif (x1 <= 3.9e+34) tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.4e+30], t$95$5, If[LessEqual[x1, 3.9e+34], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$5, t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\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 \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.4 \cdot 10^{+30}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5.60000000000000037e102 < x1 < -1.39999999999999992e30 or 3.90000000000000019e34 < x1 < 1e153Initial program 91.7%
Taylor expanded in x1 around inf 79.9%
Taylor expanded in x1 around inf 79.9%
Taylor expanded in x1 around inf 80.1%
if -1.39999999999999992e30 < x1 < 3.90000000000000019e34Initial program 99.4%
Taylor expanded in x1 around 0 88.2%
Taylor expanded in x2 around 0 95.4%
Final simplification94.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0)))))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_2
(+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -4.5e+153)
t_0
(if (<= x1 -5.6e+102)
(+
x1
(+
t_3
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 -215000000.0)
t_5
(if (<= x1 6.6e-6)
(+
x1
(+ t_3 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+153) t_5 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = t_5;
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_2 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-4.5d+153)) then
tmp = t_0
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= (-215000000.0d0)) then
tmp = t_5
else if (x1 <= 6.6d-6) then
tmp = x1 + (t_3 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+153) then
tmp = t_5
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -4.5e+153) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= -215000000.0) {
tmp = t_5;
} else if (x1 <= 6.6e-6) {
tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+153) {
tmp = t_5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -4.5e+153: tmp = t_0 elif x1 <= -5.6e+102: tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= -215000000.0: tmp = t_5 elif x1 <= 6.6e-6: tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+153: tmp = t_5 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= -215000000.0) tmp = t_5; elseif (x1 <= 6.6e-6) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -4.5e+153) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = x1 + (t_3 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= -215000000.0) tmp = t_5; elseif (x1 <= 6.6e-6) tmp = x1 + (t_3 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+153) tmp = t_5; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -215000000.0], t$95$5, If[LessEqual[x1, 6.6e-6], N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$5, t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_1 + t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -215000000:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153 or 1e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.2%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 88.9%
Taylor expanded in x2 around 0 88.9%
*-commutative88.9%
Simplified88.9%
if -5.60000000000000037e102 < x1 < -2.15e8 or 6.60000000000000034e-6 < x1 < 1e153Initial program 93.6%
Taylor expanded in x1 around inf 79.2%
Taylor expanded in x1 around inf 79.2%
Taylor expanded in x1 around inf 79.2%
if -2.15e8 < x1 < 6.60000000000000034e-6Initial program 99.4%
Taylor expanded in x1 around 0 91.5%
Taylor expanded in x2 around 0 99.3%
Final simplification95.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 -4.5e+153)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -1.4e+30)
(+
x1
(+
t_0
(+
x1
(* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) (* x1 (* x1 -22.0)))))))
(if (<= x1 3.8e+34)
(+ x1 (+ t_0 (+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(+
x1
(+
(* x2 -6.0)
(*
x1
(- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.4e+30) {
tmp = x1 + (t_0 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 3.8e+34) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
if (x1 <= (-4.5d+153)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= (-1.4d+30)) then
tmp = x1 + (t_0 + (x1 + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x1 * (x1 * (-22.0d0)))))))
else if (x1 <= 3.8d+34) then
tmp = x1 + (t_0 + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.4e+30) {
tmp = x1 + (t_0 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0))))));
} else if (x1 <= 3.8e+34) {
tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) tmp = 0 if x1 <= -4.5e+153: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= -1.4e+30: tmp = x1 + (t_0 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))) elif x1 <= 3.8e+34: tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) tmp = 0.0 if (x1 <= -4.5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= -1.4e+30) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x1 * Float64(x1 * -22.0))))))); elseif (x1 <= 3.8e+34) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); tmp = 0.0; if (x1 <= -4.5e+153) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= -1.4e+30) tmp = x1 + (t_0 + (x1 + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x1 * (x1 * -22.0)))))); elseif (x1 <= 3.8e+34) tmp = x1 + (t_0 + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.4e+30], N[(x1 + N[(t$95$0 + N[(x1 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * -22.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e+34], N[(x1 + N[(t$95$0 + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.4 \cdot 10^{+30}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x1 \cdot \left(x1 \cdot -22\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -4.5000000000000001e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -4.5000000000000001e153 < x1 < -1.39999999999999992e30Initial program 54.6%
Taylor expanded in x1 around 0 43.0%
Taylor expanded in x2 around 0 52.7%
*-commutative52.7%
Simplified52.7%
if -1.39999999999999992e30 < x1 < 3.8000000000000001e34Initial program 99.4%
Taylor expanded in x1 around 0 88.2%
Taylor expanded in x2 around 0 95.4%
if 3.8000000000000001e34 < x1 Initial program 37.8%
Taylor expanded in x1 around inf 31.0%
Taylor expanded in x1 around 0 78.7%
Final simplification88.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(+
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(* x2 (+ (* x1 6.0) (* 9.0 (/ x1 x2)))))
2.0))))))
(if (<= x1 -6.5e+189)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -1.2e-226)
t_0
(if (<= x1 9.5e-195)
(+
x1
(+
(* x2 -6.0)
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 1e+87)
t_0
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0)))))
2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2))))) - 2.0)));
double tmp;
if (x1 <= -6.5e+189) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.2e-226) {
tmp = t_0;
} else if (x1 <= 9.5e-195) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+87) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * (((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (x2 * ((x1 * 6.0d0) + (9.0d0 * (x1 / x2))))) - 2.0d0)))
if (x1 <= (-6.5d+189)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= (-1.2d-226)) then
tmp = t_0
else if (x1 <= 9.5d-195) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 1d+87) then
tmp = t_0
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2))))) - 2.0)));
double tmp;
if (x1 <= -6.5e+189) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.2e-226) {
tmp = t_0;
} else if (x1 <= 9.5e-195) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 1e+87) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2))))) - 2.0))) tmp = 0 if x1 <= -6.5e+189: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= -1.2e-226: tmp = t_0 elif x1 <= 9.5e-195: tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 1e+87: tmp = t_0 else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + Float64(x2 * Float64(Float64(x1 * 6.0) + Float64(9.0 * Float64(x1 / x2))))) - 2.0)))) tmp = 0.0 if (x1 <= -6.5e+189) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= -1.2e-226) tmp = t_0; elseif (x1 <= 9.5e-195) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 1e+87) tmp = t_0; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * (((4.0 * (x2 * ((2.0 * x2) - 3.0))) + (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2))))) - 2.0))); tmp = 0.0; if (x1 <= -6.5e+189) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= -1.2e-226) tmp = t_0; elseif (x1 <= 9.5e-195) tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 1e+87) tmp = t_0; else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(N[(x1 * 6.0), $MachinePrecision] + N[(9.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.5e+189], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.2e-226], t$95$0, If[LessEqual[x1, 9.5e-195], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+87], t$95$0, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + x2 \cdot \left(x1 \cdot 6 + 9 \cdot \frac{x1}{x2}\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+189}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-195}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -6.50000000000000027e189Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 58.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -6.50000000000000027e189 < x1 < -1.2e-226 or 9.5000000000000007e-195 < x1 < 9.9999999999999996e86Initial program 90.1%
Taylor expanded in x1 around 0 71.0%
Taylor expanded in x1 around 0 73.7%
Taylor expanded in x2 around inf 77.2%
if -1.2e-226 < x1 < 9.5000000000000007e-195Initial program 99.7%
Taylor expanded in x1 around 0 84.8%
Taylor expanded in x2 around 0 99.7%
Taylor expanded in x1 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 9.9999999999999996e86 < x1 Initial program 29.3%
Taylor expanded in x1 around inf 25.9%
Taylor expanded in x1 around 0 86.8%
Final simplification84.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- 3.0 (* x2 -2.0))) (t_1 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(if (<= x1 -1.05e+63)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -3e-226)
(+ x1 (+ (* x2 -6.0) (* x1 (- t_1 2.0))))
(if (<= x1 1e-194)
(+
x1
(+
(* x2 -6.0)
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 2.05e+29)
(+ x1 (+ (* x2 -6.0) (* x1 (- (+ t_1 (* 3.0 (* x1 t_0))) 2.0))))
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 t_0))) 2.0))))))))))
double code(double x1, double x2) {
double t_0 = 3.0 - (x2 * -2.0);
double t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -1.05e+63) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -3e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 1e-194) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 2.05e+29) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 + (3.0 * (x1 * t_0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * t_0))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 3.0d0 - (x2 * (-2.0d0))
t_1 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
if (x1 <= (-1.05d+63)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= (-3d-226)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_1 - 2.0d0)))
else if (x1 <= 1d-194) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 2.05d+29) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((t_1 + (3.0d0 * (x1 * t_0))) - 2.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * t_0))) - 2.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 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double tmp;
if (x1 <= -1.05e+63) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -3e-226) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 1e-194) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 2.05e+29) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 + (3.0 * (x1 * t_0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * t_0))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 - (x2 * -2.0) t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) tmp = 0 if x1 <= -1.05e+63: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= -3e-226: tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))) elif x1 <= 1e-194: tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 2.05e+29: tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 + (3.0 * (x1 * t_0))) - 2.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * t_0))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(3.0 - Float64(x2 * -2.0)) t_1 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) tmp = 0.0 if (x1 <= -1.05e+63) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= -3e-226) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_1 - 2.0)))); elseif (x1 <= 1e-194) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 2.05e+29) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(t_1 + Float64(3.0 * Float64(x1 * t_0))) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * t_0))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 - (x2 * -2.0); t_1 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); tmp = 0.0; if (x1 <= -1.05e+63) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= -3e-226) tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))); elseif (x1 <= 1e-194) tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 2.05e+29) tmp = x1 + ((x2 * -6.0) + (x1 * ((t_1 + (3.0 * (x1 * t_0))) - 2.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * t_0))) - 2.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[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.05e+63], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3e-226], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$1 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-194], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.05e+29], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(t$95$1 + N[(3.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 - x2 \cdot -2\\
t_1 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{+63}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{-226}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{-194}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.05 \cdot 10^{+29}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(\left(t\_1 + 3 \cdot \left(x1 \cdot t\_0\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot t\_0\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -1.0500000000000001e63Initial program 9.9%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 44.5%
Taylor expanded in x2 around 0 69.7%
*-commutative69.7%
Simplified69.7%
if -1.0500000000000001e63 < x1 < -2.99999999999999995e-226Initial program 99.4%
Taylor expanded in x1 around 0 82.9%
Taylor expanded in x1 around 0 83.3%
if -2.99999999999999995e-226 < x1 < 1.00000000000000002e-194Initial program 99.7%
Taylor expanded in x1 around 0 84.8%
Taylor expanded in x2 around 0 99.7%
Taylor expanded in x1 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 1.00000000000000002e-194 < x1 < 2.0500000000000002e29Initial program 99.1%
Taylor expanded in x1 around 0 89.0%
Taylor expanded in x1 around 0 89.5%
if 2.0500000000000002e29 < x1 Initial program 37.8%
Taylor expanded in x1 around inf 31.0%
Taylor expanded in x1 around 0 78.7%
Final simplification83.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.05e+63)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 3.8e+34)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+63) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= 3.8e+34) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.05d+63)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= 3.8d+34) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+63) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= 3.8e+34) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.05e+63: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= 3.8e+34: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.05e+63) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= 3.8e+34) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.05e+63) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= 3.8e+34) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.05e+63], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e+34], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{+63}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+34}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -1.0500000000000001e63Initial program 9.9%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 44.5%
Taylor expanded in x2 around 0 69.7%
*-commutative69.7%
Simplified69.7%
if -1.0500000000000001e63 < x1 < 3.8000000000000001e34Initial program 99.4%
Taylor expanded in x1 around 0 85.4%
Taylor expanded in x2 around 0 92.3%
if 3.8000000000000001e34 < x1 Initial program 37.8%
Taylor expanded in x1 around inf 31.0%
Taylor expanded in x1 around 0 78.7%
Final simplification85.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -1.6e+62)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))
(if (<= x1 -1.2e-230)
t_0
(if (<= x1 9e-195)
(+
x1
(+
(* x2 -6.0)
(+ x1 (* 4.0 (* x2 (+ (* x1 -3.0) (* 2.0 (* x1 x2))))))))
(if (<= x1 3.8e+34)
t_0
(+
x1
(+
(* x2 -6.0)
(*
x1
(-
(* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0)))))
2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.6e+62) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.2e-230) {
tmp = t_0;
} else if (x1 <= 9e-195) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 3.8e+34) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-1.6d+62)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
else if (x1 <= (-1.2d-230)) then
tmp = t_0
else if (x1 <= 9d-195) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 + (4.0d0 * (x2 * ((x1 * (-3.0d0)) + (2.0d0 * (x1 * x2)))))))
else if (x1 <= 3.8d+34) then
tmp = t_0
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.6e+62) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
} else if (x1 <= -1.2e-230) {
tmp = t_0;
} else if (x1 <= 9e-195) {
tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2)))))));
} else if (x1 <= 3.8e+34) {
tmp = t_0;
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -1.6e+62: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) elif x1 <= -1.2e-230: tmp = t_0 elif x1 <= 9e-195: tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))) elif x1 <= 3.8e+34: tmp = t_0 else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -1.6e+62) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); elseif (x1 <= -1.2e-230) tmp = t_0; elseif (x1 <= 9e-195) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(Float64(x1 * -3.0) + Float64(2.0 * Float64(x1 * x2)))))))); elseif (x1 <= 3.8e+34) tmp = t_0; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -1.6e+62) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); elseif (x1 <= -1.2e-230) tmp = t_0; elseif (x1 <= 9e-195) tmp = x1 + ((x2 * -6.0) + (x1 + (4.0 * (x2 * ((x1 * -3.0) + (2.0 * (x1 * x2))))))); elseif (x1 <= 3.8e+34) tmp = t_0; else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+62], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.2e-230], t$95$0, If[LessEqual[x1, 9e-195], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(N[(x1 * -3.0), $MachinePrecision] + N[(2.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.8e+34], t$95$0, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+62}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -1.2 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-195}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3 + 2 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.8 \cdot 10^{+34}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999992e62Initial program 9.9%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 44.5%
Taylor expanded in x2 around 0 69.7%
*-commutative69.7%
Simplified69.7%
if -1.59999999999999992e62 < x1 < -1.2000000000000001e-230 or 9e-195 < x1 < 3.8000000000000001e34Initial program 99.3%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x1 around 0 85.3%
if -1.2000000000000001e-230 < x1 < 9e-195Initial program 99.7%
Taylor expanded in x1 around 0 84.8%
Taylor expanded in x2 around 0 99.7%
Taylor expanded in x1 around 0 94.7%
*-commutative94.7%
Simplified94.7%
if 3.8000000000000001e34 < x1 Initial program 37.8%
Taylor expanded in x1 around inf 31.0%
Taylor expanded in x1 around 0 78.7%
Final simplification82.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.1e+66)
(+ x1 (+ x1 (* (* x1 x2) -12.0)))
(if (or (<= x1 -1.5e-10) (not (<= x1 2.7e-22)))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(+ x1 (+ (* x2 -6.0) (* x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.1e+66) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else if ((x1 <= -1.5e-10) || !(x1 <= 2.7e-22)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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 <= (-1.1d+66)) then
tmp = x1 + (x1 + ((x1 * x2) * (-12.0d0)))
else if ((x1 <= (-1.5d-10)) .or. (.not. (x1 <= 2.7d-22))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.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 <= -1.1e+66) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else if ((x1 <= -1.5e-10) || !(x1 <= 2.7e-22)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.1e+66: tmp = x1 + (x1 + ((x1 * x2) * -12.0)) elif (x1 <= -1.5e-10) or not (x1 <= 2.7e-22): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.1e+66) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * x2) * -12.0))); elseif ((x1 <= -1.5e-10) || !(x1 <= 2.7e-22)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.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 <= -1.1e+66) tmp = x1 + (x1 + ((x1 * x2) * -12.0)); elseif ((x1 <= -1.5e-10) || ~((x1 <= 2.7e-22))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.1e+66], N[(x1 + N[(x1 + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.5e-10], N[Not[LessEqual[x1, 2.7e-22]], $MachinePrecision]], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $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 -1.1 \cdot 10^{+66}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{elif}\;x1 \leq -1.5 \cdot 10^{-10} \lor \neg \left(x1 \leq 2.7 \cdot 10^{-22}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -1.0999999999999999e66Initial program 7.6%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around inf 0.1%
Taylor expanded in x2 around 0 24.5%
*-commutative24.5%
*-commutative24.5%
Simplified24.5%
if -1.0999999999999999e66 < x1 < -1.5e-10 or 2.7000000000000002e-22 < x1 Initial program 55.7%
Taylor expanded in x1 around 0 21.8%
Taylor expanded in x1 around inf 40.6%
Taylor expanded in x1 around 0 40.6%
if -1.5e-10 < x1 < 2.7000000000000002e-22Initial program 99.4%
Taylor expanded in x1 around inf 77.0%
Taylor expanded in x1 around 0 77.1%
Final simplification55.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3.1e+64) (not (<= x2 6.8e+117))) (+ (* x1 2.0) (* x2 (- (+ (* x1 -12.0) (* (* x1 x2) 8.0)) 6.0))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.1e+64) || !(x2 <= 6.8e+117)) {
tmp = (x1 * 2.0) + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-3.1d+64)) .or. (.not. (x2 <= 6.8d+117))) then
tmp = (x1 * 2.0d0) + (x2 * (((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)) - 6.0d0))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.1e+64) || !(x2 <= 6.8e+117)) {
tmp = (x1 * 2.0) + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3.1e+64) or not (x2 <= 6.8e+117): tmp = (x1 * 2.0) + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3.1e+64) || !(x2 <= 6.8e+117)) tmp = Float64(Float64(x1 * 2.0) + Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)) - 6.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3.1e+64) || ~((x2 <= 6.8e+117))) tmp = (x1 * 2.0) + (x2 * (((x1 * -12.0) + ((x1 * x2) * 8.0)) - 6.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3.1e+64], N[Not[LessEqual[x2, 6.8e+117]], $MachinePrecision]], N[(N[(x1 * 2.0), $MachinePrecision] + N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.1 \cdot 10^{+64} \lor \neg \left(x2 \leq 6.8 \cdot 10^{+117}\right):\\
\;\;\;\;x1 \cdot 2 + x2 \cdot \left(\left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -3.0999999999999999e64 or 6.8000000000000002e117 < x2 Initial program 69.4%
Taylor expanded in x1 around 0 50.1%
Taylor expanded in x2 around 0 61.3%
Taylor expanded in x1 around 0 78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in x2 around 0 78.7%
if -3.0999999999999999e64 < x2 < 6.8000000000000002e117Initial program 69.6%
Taylor expanded in x1 around 0 53.1%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 78.6%
*-commutative78.6%
Simplified78.6%
Final simplification78.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -8e+171) (not (<= x2 6.6e+143))) (+ (* x1 2.0) (* x2 (+ (* x1 -12.0) (* (* x1 x2) 8.0)))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -8e+171) || !(x2 <= 6.6e+143)) {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) + ((x1 * x2) * 8.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-8d+171)) .or. (.not. (x2 <= 6.6d+143))) then
tmp = (x1 * 2.0d0) + (x2 * ((x1 * (-12.0d0)) + ((x1 * x2) * 8.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -8e+171) || !(x2 <= 6.6e+143)) {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) + ((x1 * x2) * 8.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -8e+171) or not (x2 <= 6.6e+143): tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) + ((x1 * x2) * 8.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -8e+171) || !(x2 <= 6.6e+143)) tmp = Float64(Float64(x1 * 2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(Float64(x1 * x2) * 8.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -8e+171) || ~((x2 <= 6.6e+143))) tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) + ((x1 * x2) * 8.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -8e+171], N[Not[LessEqual[x2, 6.6e+143]], $MachinePrecision]], N[(N[(x1 * 2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(N[(x1 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8 \cdot 10^{+171} \lor \neg \left(x2 \leq 6.6 \cdot 10^{+143}\right):\\
\;\;\;\;x1 \cdot 2 + x2 \cdot \left(x1 \cdot -12 + \left(x1 \cdot x2\right) \cdot 8\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -7.99999999999999963e171 or 6.6e143 < x2 Initial program 66.1%
Taylor expanded in x1 around 0 45.8%
Taylor expanded in x1 around inf 62.7%
Taylor expanded in x2 around 0 71.9%
if -7.99999999999999963e171 < x2 < 6.6e143Initial program 70.7%
Taylor expanded in x1 around 0 54.2%
Taylor expanded in x1 around 0 75.4%
Taylor expanded in x2 around 0 75.6%
*-commutative75.6%
Simplified75.6%
Final simplification74.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -6e+63)
(+ x1 (+ x1 (* (* x1 x2) -12.0)))
(if (<= x1 9e-6)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(+ (* x1 2.0) (* x2 (- (* x1 -12.0) 6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -6e+63) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else if (x1 <= 9e-6) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-6d+63)) then
tmp = x1 + (x1 + ((x1 * x2) * (-12.0d0)))
else if (x1 <= 9d-6) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = (x1 * 2.0d0) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -6e+63) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else if (x1 <= 9e-6) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -6e+63: tmp = x1 + (x1 + ((x1 * x2) * -12.0)) elif x1 <= 9e-6: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -6e+63) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * x2) * -12.0))); elseif (x1 <= 9e-6) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(Float64(x1 * 2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -6e+63) tmp = x1 + (x1 + ((x1 * x2) * -12.0)); elseif (x1 <= 9e-6) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = (x1 * 2.0) + (x2 * ((x1 * -12.0) - 6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -6e+63], N[(x1 + N[(x1 + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e-6], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * 2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6 \cdot 10^{+63}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-6}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\end{array}
\end{array}
if x1 < -5.99999999999999998e63Initial program 7.6%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around inf 0.1%
Taylor expanded in x2 around 0 24.5%
*-commutative24.5%
*-commutative24.5%
Simplified24.5%
if -5.99999999999999998e63 < x1 < 9.00000000000000023e-6Initial program 99.4%
Taylor expanded in x1 around inf 71.4%
Taylor expanded in x1 around 0 67.4%
if 9.00000000000000023e-6 < x1 Initial program 42.9%
Taylor expanded in x1 around 0 10.3%
Taylor expanded in x2 around 0 10.3%
Taylor expanded in x1 around 0 37.3%
*-commutative37.3%
Simplified37.3%
Taylor expanded in x2 around 0 16.1%
Final simplification46.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -8.5e-57) (not (<= x1 1.3e+152))) (+ x1 (+ x1 (* (* x1 x2) -12.0))) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.5e-57) || !(x1 <= 1.3e+152)) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-8.5d-57)) .or. (.not. (x1 <= 1.3d+152))) then
tmp = x1 + (x1 + ((x1 * x2) * (-12.0d0)))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -8.5e-57) || !(x1 <= 1.3e+152)) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -8.5e-57) or not (x1 <= 1.3e+152): tmp = x1 + (x1 + ((x1 * x2) * -12.0)) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -8.5e-57) || !(x1 <= 1.3e+152)) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * x2) * -12.0))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -8.5e-57) || ~((x1 <= 1.3e+152))) tmp = x1 + (x1 + ((x1 * x2) * -12.0)); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -8.5e-57], N[Not[LessEqual[x1, 1.3e+152]], $MachinePrecision]], N[(x1 + N[(x1 + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -8.5 \cdot 10^{-57} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+152}\right):\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -8.49999999999999955e-57 or 1.3e152 < x1 Initial program 26.6%
Taylor expanded in x1 around 0 16.0%
Taylor expanded in x1 around inf 31.4%
Taylor expanded in x2 around 0 20.5%
*-commutative20.5%
*-commutative20.5%
Simplified20.5%
if -8.49999999999999955e-57 < x1 < 1.3e152Initial program 97.5%
Taylor expanded in x1 around 0 75.5%
Taylor expanded in x2 around 0 82.2%
Taylor expanded in x1 around 0 45.4%
*-commutative45.4%
Simplified45.4%
Final simplification35.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.45e+63) (not (<= x1 1.35))) (+ x1 (+ x1 (* (* x1 x2) -12.0))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.45e+63) || !(x1 <= 1.35)) {
tmp = x1 + (x1 + ((x1 * x2) * -12.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 <= (-2.45d+63)) .or. (.not. (x1 <= 1.35d0))) then
tmp = x1 + (x1 + ((x1 * x2) * (-12.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 <= -2.45e+63) || !(x1 <= 1.35)) {
tmp = x1 + (x1 + ((x1 * x2) * -12.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.45e+63) or not (x1 <= 1.35): tmp = x1 + (x1 + ((x1 * x2) * -12.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.45e+63) || !(x1 <= 1.35)) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * x2) * -12.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 <= -2.45e+63) || ~((x1 <= 1.35))) tmp = x1 + (x1 + ((x1 * x2) * -12.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.45e+63], N[Not[LessEqual[x1, 1.35]], $MachinePrecision]], N[(x1 + N[(x1 + N[(N[(x1 * x2), $MachinePrecision] * -12.0), $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 -2.45 \cdot 10^{+63} \lor \neg \left(x1 \leq 1.35\right):\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot x2\right) \cdot -12\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -2.4499999999999998e63 or 1.3500000000000001 < x1 Initial program 29.9%
Taylor expanded in x1 around 0 5.9%
Taylor expanded in x1 around inf 23.5%
Taylor expanded in x2 around 0 19.2%
*-commutative19.2%
*-commutative19.2%
Simplified19.2%
if -2.4499999999999998e63 < x1 < 1.3500000000000001Initial program 99.4%
Taylor expanded in x1 around inf 71.0%
Taylor expanded in x1 around 0 67.0%
Final simplification46.4%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -4.6e+173) (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x1 9.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -4.6e+173) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-4.6d+173)) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -4.6e+173) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -4.6e+173: tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -4.6e+173) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -4.6e+173) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * 9.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -4.6e+173], N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.6 \cdot 10^{+173}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -4.5999999999999999e173Initial program 72.6%
Taylor expanded in x1 around 0 55.4%
Taylor expanded in x1 around inf 67.5%
Taylor expanded in x1 around 0 67.5%
if -4.5999999999999999e173 < x2 Initial program 69.1%
Taylor expanded in x1 around 0 51.5%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x2 around 0 71.4%
*-commutative71.4%
Simplified71.4%
Final simplification70.9%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 52.0%
Taylor expanded in x2 around 0 56.1%
Taylor expanded in x1 around 0 29.1%
*-commutative29.1%
Simplified29.1%
Final simplification29.1%
(FPCore (x1 x2) :precision binary64 (+ x1 x1))
double code(double x1, double x2) {
return x1 + x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + x1
end function
public static double code(double x1, double x2) {
return x1 + x1;
}
def code(x1, x2): return x1 + x1
function code(x1, x2) return Float64(x1 + x1) end
function tmp = code(x1, x2) tmp = x1 + x1; end
code[x1_, x2_] := N[(x1 + x1), $MachinePrecision]
\begin{array}{l}
\\
x1 + x1
\end{array}
Initial program 69.5%
Taylor expanded in x1 around 0 52.0%
Taylor expanded in x1 around inf 24.6%
Taylor expanded in x2 around 0 3.4%
Final simplification3.4%
herbie shell --seed 2024067
(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))))))