
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(x1 + 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[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.5%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4 (* t_0 t_3))
(t_5 (- t_3 3.0))
(t_6 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(t_7 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -1e+57)
t_6
(if (<= x1 -0.0024)
(+
x1
(+
(+ x1 (+ (+ (* t_2 (+ (* (* (* x1 2.0) t_3) t_5) t_7)) t_4) t_1))
9.0))
(if (<= x1 1e+77)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+
x1
(+
t_1
(+
t_4
(* t_2 (+ t_7 (* t_5 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
t_6)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_0 * t_3;
double t_5 = t_3 - 3.0;
double t_6 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
double t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -1e+57) {
tmp = t_6;
} else if (x1 <= -0.0024) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0);
} else if (x1 <= 1e+77) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + (t_4 + (t_2 * (t_7 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = t_6;
}
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 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = t_0 * t_3
t_5 = t_3 - 3.0d0
t_6 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
t_7 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-1d+57)) then
tmp = t_6
else if (x1 <= (-0.0024d0)) then
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0d0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0d0)
else if (x1 <= 1d+77) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_1 + (t_4 + (t_2 * (t_7 + (t_5 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = t_6
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_0 * t_3;
double t_5 = t_3 - 3.0;
double t_6 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
double t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -1e+57) {
tmp = t_6;
} else if (x1 <= -0.0024) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0);
} else if (x1 <= 1e+77) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + (t_4 + (t_2 * (t_7 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = t_6;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = t_0 * t_3 t_5 = t_3 - 3.0 t_6 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -1e+57: tmp = t_6 elif x1 <= -0.0024: tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0) elif x1 <= 1e+77: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + (t_4 + (t_2 * (t_7 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = t_6 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_0 * t_3) t_5 = Float64(t_3 - 3.0) t_6 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -1e+57) tmp = t_6; elseif (x1 <= -0.0024) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0)); elseif (x1 <= 1e+77) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_1 + Float64(t_4 + Float64(t_2 * Float64(t_7 + Float64(t_5 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = t_6; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = t_0 * t_3; t_5 = t_3 - 3.0; t_6 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); t_7 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -1e+57) tmp = t_6; elseif (x1 <= -0.0024) tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * t_5) + t_7)) + t_4) + t_1)) + 9.0); elseif (x1 <= 1e+77) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_1 + (t_4 + (t_2 * (t_7 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = t_6; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 - 3.0), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+57], t$95$6, If[LessEqual[x1, -0.0024], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$5), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+77], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$1 + N[(t$95$4 + N[(t$95$2 * N[(t$95$7 + N[(t$95$5 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$6]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_0 \cdot t\_3\\
t_5 := t\_3 - 3\\
t_6 := x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq -0.0024:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot t\_5 + t\_7\right) + t\_4\right) + t\_1\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 10^{+77}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(t\_1 + \left(t\_4 + t\_2 \cdot \left(t\_7 + t\_5 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_6\\
\end{array}
\end{array}
if x1 < -1.00000000000000005e57 or 9.99999999999999983e76 < x1 Initial program 25.2%
Taylor expanded in x1 around 0 25.2%
*-commutative25.2%
Simplified25.2%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
if -1.00000000000000005e57 < x1 < -0.00239999999999999979Initial program 98.8%
Taylor expanded in x1 around inf 98.8%
if -0.00239999999999999979 < x1 < 9.99999999999999983e76Initial program 99.4%
Taylor expanded in x1 around 0 97.7%
+-commutative38.9%
neg-mul-138.9%
unsub-neg38.9%
Simplified97.7%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (* t_0 t_2))
(t_4 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(t_5 (* (* x1 x1) (- (* t_2 4.0) 6.0)))
(t_6 (* (* x1 2.0) t_2))
(t_7 (* x1 (* x1 x1))))
(if (<= x1 -1e+57)
t_4
(if (<= x1 -0.0022)
(+
x1
(+ (+ x1 (+ (+ (* t_1 (+ (* t_6 (- t_2 3.0)) t_5)) t_3) t_7)) 9.0))
(if (<= x1 7.8e+74)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (+ t_7 (+ t_3 (* t_1 (+ t_5 (* t_6 (- (* 2.0 x2) 3.0)))))))))
t_4)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_2;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1e+57) {
tmp = t_4;
} else if (x1 <= -0.0022) {
tmp = x1 + ((x1 + (((t_1 * ((t_6 * (t_2 - 3.0)) + t_5)) + t_3) + t_7)) + 9.0);
} else if (x1 <= 7.8e+74) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_7 + (t_3 + (t_1 * (t_5 + (t_6 * ((2.0 * x2) - 3.0))))))));
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = t_0 * t_2
t_4 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
t_5 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
t_6 = (x1 * 2.0d0) * t_2
t_7 = x1 * (x1 * x1)
if (x1 <= (-1d+57)) then
tmp = t_4
else if (x1 <= (-0.0022d0)) then
tmp = x1 + ((x1 + (((t_1 * ((t_6 * (t_2 - 3.0d0)) + t_5)) + t_3) + t_7)) + 9.0d0)
else if (x1 <= 7.8d+74) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_7 + (t_3 + (t_1 * (t_5 + (t_6 * ((2.0d0 * x2) - 3.0d0))))))))
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = (x1 * 2.0) * t_2;
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -1e+57) {
tmp = t_4;
} else if (x1 <= -0.0022) {
tmp = x1 + ((x1 + (((t_1 * ((t_6 * (t_2 - 3.0)) + t_5)) + t_3) + t_7)) + 9.0);
} else if (x1 <= 7.8e+74) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_7 + (t_3 + (t_1 * (t_5 + (t_6 * ((2.0 * x2) - 3.0))))))));
} else {
tmp = t_4;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = t_0 * t_2 t_4 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_6 = (x1 * 2.0) * t_2 t_7 = x1 * (x1 * x1) tmp = 0 if x1 <= -1e+57: tmp = t_4 elif x1 <= -0.0022: tmp = x1 + ((x1 + (((t_1 * ((t_6 * (t_2 - 3.0)) + t_5)) + t_3) + t_7)) + 9.0) elif x1 <= 7.8e+74: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_7 + (t_3 + (t_1 * (t_5 + (t_6 * ((2.0 * x2) - 3.0)))))))) else: tmp = t_4 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(t_0 * t_2) t_4 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_6 = Float64(Float64(x1 * 2.0) * t_2) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -1e+57) tmp = t_4; elseif (x1 <= -0.0022) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(t_6 * Float64(t_2 - 3.0)) + t_5)) + t_3) + t_7)) + 9.0)); elseif (x1 <= 7.8e+74) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_7 + Float64(t_3 + Float64(t_1 * Float64(t_5 + Float64(t_6 * Float64(Float64(2.0 * x2) - 3.0))))))))); else tmp = t_4; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = t_0 * t_2; t_4 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_6 = (x1 * 2.0) * t_2; t_7 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -1e+57) tmp = t_4; elseif (x1 <= -0.0022) tmp = x1 + ((x1 + (((t_1 * ((t_6 * (t_2 - 3.0)) + t_5)) + t_3) + t_7)) + 9.0); elseif (x1 <= 7.8e+74) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_7 + (t_3 + (t_1 * (t_5 + (t_6 * ((2.0 * x2) - 3.0)))))))); else tmp = t_4; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1e+57], t$95$4, If[LessEqual[x1, -0.0022], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(t$95$6 * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.8e+74], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$7 + N[(t$95$3 + N[(t$95$1 * N[(t$95$5 + N[(t$95$6 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := t\_0 \cdot t\_2\\
t_4 := x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_2\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq -0.0022:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(t\_6 \cdot \left(t\_2 - 3\right) + t\_5\right) + t\_3\right) + t\_7\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 7.8 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(t\_7 + \left(t\_3 + t\_1 \cdot \left(t\_5 + t\_6 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if x1 < -1.00000000000000005e57 or 7.80000000000000015e74 < x1 Initial program 25.2%
Taylor expanded in x1 around 0 25.2%
*-commutative25.2%
Simplified25.2%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
if -1.00000000000000005e57 < x1 < -0.00220000000000000013Initial program 98.8%
Taylor expanded in x1 around inf 98.8%
if -0.00220000000000000013 < x1 < 7.80000000000000015e74Initial program 99.4%
Taylor expanded in x1 around 0 96.8%
Final simplification98.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -1e+57)
t_2
(if (<= x1 -0.00325)
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
9.0))
(if (<= x1 98000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))
t_2)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1e+57) {
tmp = t_2;
} else if (x1 <= -0.00325) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
} else if (x1 <= 98000.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-1d+57)) then
tmp = t_2
else if (x1 <= (-0.00325d0)) then
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0d0)
else if (x1 <= 98000.0d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1e+57) {
tmp = t_2;
} else if (x1 <= -0.00325) {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0);
} else if (x1 <= 98000.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -1e+57: tmp = t_2 elif x1 <= -0.00325: tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0) elif x1 <= 98000.0: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -1e+57) tmp = t_2; elseif (x1 <= -0.00325) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + 9.0)); elseif (x1 <= 98000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -1e+57) tmp = t_2; elseif (x1 <= -0.00325) tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + 9.0); elseif (x1 <= 98000.0) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1e+57], t$95$2, If[LessEqual[x1, -0.00325], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 98000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -0.00325:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 98000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -1.00000000000000005e57 or 98000 < x1 Initial program 34.4%
Taylor expanded in x1 around 0 34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in x1 around inf 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x1 around inf 97.0%
if -1.00000000000000005e57 < x1 < -0.00324999999999999985Initial program 98.8%
Taylor expanded in x1 around inf 98.8%
if -0.00324999999999999985 < x1 < 98000Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
Final simplification94.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* x1 (* x1 x1)))
(t_5 (- t_3 3.0))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_7 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -0.00225)
(+
x1
(+
t_1
(+
x1
(+
t_4
(+
(* t_0 (+ (* (* (* x1 2.0) t_3) t_5) t_6))
(* t_2 (* 2.0 x2)))))))
(if (<= x1 1.9)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_7)))))
(if (<= x1 3.4e+130)
(+
x1
(+
(+
x1
(+
t_4
(+
(* t_2 t_3)
(* t_0 (+ t_6 (* t_5 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))
t_1))
(* x1 (+ 2.0 (* 4.0 t_7)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 * (x1 * x1);
double t_5 = t_3 - 3.0;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00225) {
tmp = x1 + (t_1 + (x1 + (t_4 + ((t_0 * ((((x1 * 2.0) * t_3) * t_5) + t_6)) + (t_2 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_7))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + ((x1 + (t_4 + ((t_2 * t_3) + (t_0 * (t_6 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + t_1);
} else {
tmp = x1 * (2.0 + (4.0 * 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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 * (x1 * x1)
t_5 = t_3 - 3.0d0
t_6 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_7 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-0.00225d0)) then
tmp = x1 + (t_1 + (x1 + (t_4 + ((t_0 * ((((x1 * 2.0d0) * t_3) * t_5) + t_6)) + (t_2 * (2.0d0 * x2))))))
else if (x1 <= 1.9d0) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_7))))
else if (x1 <= 3.4d+130) then
tmp = x1 + ((x1 + (t_4 + ((t_2 * t_3) + (t_0 * (t_6 + (t_5 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))) + t_1)
else
tmp = x1 * (2.0d0 + (4.0d0 * t_7))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 * (x1 * x1);
double t_5 = t_3 - 3.0;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00225) {
tmp = x1 + (t_1 + (x1 + (t_4 + ((t_0 * ((((x1 * 2.0) * t_3) * t_5) + t_6)) + (t_2 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_7))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + ((x1 + (t_4 + ((t_2 * t_3) + (t_0 * (t_6 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + t_1);
} else {
tmp = x1 * (2.0 + (4.0 * t_7));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 * (x1 * x1) t_5 = t_3 - 3.0 t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_7 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -0.00225: tmp = x1 + (t_1 + (x1 + (t_4 + ((t_0 * ((((x1 * 2.0) * t_3) * t_5) + t_6)) + (t_2 * (2.0 * x2)))))) elif x1 <= 1.9: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_7)))) elif x1 <= 3.4e+130: tmp = x1 + ((x1 + (t_4 + ((t_2 * t_3) + (t_0 * (t_6 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + t_1) else: tmp = x1 * (2.0 + (4.0 * t_7)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 * Float64(x1 * x1)) t_5 = Float64(t_3 - 3.0) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_7 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -0.00225) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_4 + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * t_5) + t_6)) + Float64(t_2 * Float64(2.0 * x2))))))); elseif (x1 <= 1.9) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_7))))); elseif (x1 <= 3.4e+130) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_4 + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(t_6 + Float64(t_5 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))) + t_1)); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_7))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 * (x1 * x1); t_5 = t_3 - 3.0; t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_7 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -0.00225) tmp = x1 + (t_1 + (x1 + (t_4 + ((t_0 * ((((x1 * 2.0) * t_3) * t_5) + t_6)) + (t_2 * (2.0 * x2)))))); elseif (x1 <= 1.9) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_7)))); elseif (x1 <= 3.4e+130) tmp = x1 + ((x1 + (t_4 + ((t_2 * t_3) + (t_0 * (t_6 + (t_5 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + t_1); else tmp = x1 * (2.0 + (4.0 * t_7)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 - 3.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00225], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$4 + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$5), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], N[(x1 + N[(N[(x1 + N[(t$95$4 + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(t$95$6 + N[(t$95$5 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
t_5 := t\_3 - 3\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_7 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -0.00225:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(t\_4 + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot t\_5 + t\_6\right) + t\_2 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_7\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_4 + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(t\_6 + t\_5 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_7\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -0.00224999999999999983Initial program 99.1%
Taylor expanded in x1 around 0 97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x1 around 0 89.7%
if -0.00224999999999999983 < x1 < 1.8999999999999999Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
if 1.8999999999999999 < x1 < 3.4000000000000001e130Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around 0 92.8%
+-commutative92.8%
neg-mul-192.8%
unsub-neg92.8%
Simplified92.8%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (- (* 2.0 x2) x1))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* x1 (* x1 x1)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- (+ t_3 (* 2.0 x2)) x1) t_5))
(t_7 (- t_6 3.0))
(t_8 (* (* x1 x1) (- (* t_6 4.0) 6.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -0.00245)
(+
x1
(+
(+
x1
(+ t_4 (+ (* t_5 (+ (* (* (* x1 2.0) t_6) t_7) t_8)) (* t_3 t_1))))
t_2))
(if (<= x1 1.9)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_5))
(+ x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 3.4e+130)
(+
x1
(+
(+
x1
(+
t_4
(+ (* t_3 t_6) (* t_5 (+ t_8 (* t_7 (* (* x1 2.0) t_1)))))))
t_2))
(* x1 (+ 2.0 (* 4.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = (2.0 * x2) - x1;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 * (x1 * x1);
double t_5 = (x1 * x1) + 1.0;
double t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5;
double t_7 = t_6 - 3.0;
double t_8 = (x1 * x1) * ((t_6 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00245) {
tmp = x1 + ((x1 + (t_4 + ((t_5 * ((((x1 * 2.0) * t_6) * t_7) + t_8)) + (t_3 * t_1)))) + t_2);
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + ((x1 + (t_4 + ((t_3 * t_6) + (t_5 * (t_8 + (t_7 * ((x1 * 2.0) * t_1))))))) + t_2);
} else {
tmp = x1 * (2.0 + (4.0 * t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = (2.0d0 * x2) - x1
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = x1 * (x1 * 3.0d0)
t_4 = x1 * (x1 * x1)
t_5 = (x1 * x1) + 1.0d0
t_6 = ((t_3 + (2.0d0 * x2)) - x1) / t_5
t_7 = t_6 - 3.0d0
t_8 = (x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-0.00245d0)) then
tmp = x1 + ((x1 + (t_4 + ((t_5 * ((((x1 * 2.0d0) * t_6) * t_7) + t_8)) + (t_3 * t_1)))) + t_2)
else if (x1 <= 1.9d0) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_5)) + (x1 + (4.0d0 * (x1 * t_0))))
else if (x1 <= 3.4d+130) then
tmp = x1 + ((x1 + (t_4 + ((t_3 * t_6) + (t_5 * (t_8 + (t_7 * ((x1 * 2.0d0) * t_1))))))) + t_2)
else
tmp = x1 * (2.0d0 + (4.0d0 * t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = (2.0 * x2) - x1;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = x1 * (x1 * x1);
double t_5 = (x1 * x1) + 1.0;
double t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5;
double t_7 = t_6 - 3.0;
double t_8 = (x1 * x1) * ((t_6 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00245) {
tmp = x1 + ((x1 + (t_4 + ((t_5 * ((((x1 * 2.0) * t_6) * t_7) + t_8)) + (t_3 * t_1)))) + t_2);
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + ((x1 + (t_4 + ((t_3 * t_6) + (t_5 * (t_8 + (t_7 * ((x1 * 2.0) * t_1))))))) + t_2);
} else {
tmp = x1 * (2.0 + (4.0 * t_0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = (2.0 * x2) - x1 t_2 = 3.0 * (x2 * -2.0) t_3 = x1 * (x1 * 3.0) t_4 = x1 * (x1 * x1) t_5 = (x1 * x1) + 1.0 t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5 t_7 = t_6 - 3.0 t_8 = (x1 * x1) * ((t_6 * 4.0) - 6.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -0.00245: tmp = x1 + ((x1 + (t_4 + ((t_5 * ((((x1 * 2.0) * t_6) * t_7) + t_8)) + (t_3 * t_1)))) + t_2) elif x1 <= 1.9: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (4.0 * (x1 * t_0)))) elif x1 <= 3.4e+130: tmp = x1 + ((x1 + (t_4 + ((t_3 * t_6) + (t_5 * (t_8 + (t_7 * ((x1 * 2.0) * t_1))))))) + t_2) else: tmp = x1 * (2.0 + (4.0 * t_0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(Float64(2.0 * x2) - x1) t_2 = Float64(3.0 * Float64(x2 * -2.0)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(x1 * Float64(x1 * x1)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_5) t_7 = Float64(t_6 - 3.0) t_8 = Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -0.00245) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_4 + Float64(Float64(t_5 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_6) * t_7) + t_8)) + Float64(t_3 * t_1)))) + t_2)); elseif (x1 <= 1.9) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_5)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 3.4e+130) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_4 + Float64(Float64(t_3 * t_6) + Float64(t_5 * Float64(t_8 + Float64(t_7 * Float64(Float64(x1 * 2.0) * t_1))))))) + t_2)); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = (2.0 * x2) - x1; t_2 = 3.0 * (x2 * -2.0); t_3 = x1 * (x1 * 3.0); t_4 = x1 * (x1 * x1); t_5 = (x1 * x1) + 1.0; t_6 = ((t_3 + (2.0 * x2)) - x1) / t_5; t_7 = t_6 - 3.0; t_8 = (x1 * x1) * ((t_6 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -0.00245) tmp = x1 + ((x1 + (t_4 + ((t_5 * ((((x1 * 2.0) * t_6) * t_7) + t_8)) + (t_3 * t_1)))) + t_2); elseif (x1 <= 1.9) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_5)) + (x1 + (4.0 * (x1 * t_0)))); elseif (x1 <= 3.4e+130) tmp = x1 + ((x1 + (t_4 + ((t_3 * t_6) + (t_5 * (t_8 + (t_7 * ((x1 * 2.0) * t_1))))))) + t_2); else tmp = x1 * (2.0 + (4.0 * t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 - 3.0), $MachinePrecision]}, Block[{t$95$8 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00245], N[(x1 + N[(N[(x1 + N[(t$95$4 + N[(N[(t$95$5 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * t$95$7), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], N[(x1 + N[(N[(x1 + N[(t$95$4 + N[(N[(t$95$3 * t$95$6), $MachinePrecision] + N[(t$95$5 * N[(t$95$8 + N[(t$95$7 * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := 2 \cdot x2 - x1\\
t_2 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_5}\\
t_7 := t\_6 - 3\\
t_8 := \left(x1 \cdot x1\right) \cdot \left(t\_6 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -0.00245:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_4 + \left(t\_5 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot t\_7 + t\_8\right) + t\_3 \cdot t\_1\right)\right)\right) + t\_2\right)\\
\mathbf{elif}\;x1 \leq 1.9:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_5} + \left(x1 + 4 \cdot \left(x1 \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_4 + \left(t\_3 \cdot t\_6 + t\_5 \cdot \left(t\_8 + t\_7 \cdot \left(\left(x1 \cdot 2\right) \cdot t\_1\right)\right)\right)\right)\right) + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -0.0024499999999999999Initial program 99.1%
Taylor expanded in x1 around 0 97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x1 around 0 89.7%
+-commutative76.6%
neg-mul-176.6%
unsub-neg76.6%
Simplified89.7%
if -0.0024499999999999999 < x1 < 1.8999999999999999Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
if 1.8999999999999999 < x1 < 3.4000000000000001e130Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around 0 92.8%
+-commutative92.8%
neg-mul-192.8%
unsub-neg92.8%
Simplified92.8%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.8%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -30000.0) (not (<= x1 14200000.0)))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0))))
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -30000.0) || !(x1 <= 14200000.0)) {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-30000.0d0)) .or. (.not. (x1 <= 14200000.0d0))) then
tmp = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
else
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -30000.0) || !(x1 <= 14200000.0)) {
tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
} else {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -30000.0) or not (x1 <= 14200000.0): tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) else: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -30000.0) || !(x1 <= 14200000.0)) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); else 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(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -30000.0) || ~((x1 <= 14200000.0))) tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0))); else tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -30000.0], N[Not[LessEqual[x1, 14200000.0]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -30000 \lor \neg \left(x1 \leq 14200000\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;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(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3e4 or 1.42e7 < x1 Initial program 38.8%
Taylor expanded in x1 around 0 38.8%
*-commutative38.8%
Simplified38.8%
Taylor expanded in x1 around inf 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in x1 around inf 95.2%
if -3e4 < x1 < 1.42e7Initial program 99.4%
Taylor expanded in x1 around 0 90.6%
Final simplification93.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3 (* x1 (* x1 x1)))
(t_4 (- t_2 3.0))
(t_5 (* (* x1 x1) (- (* t_2 4.0) 6.0)))
(t_6 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -0.00275)
(+
x1
(+
9.0
(+
x1
(+
t_3
(+
(* t_0 (+ (* (* (* x1 2.0) t_2) t_4) t_5))
(* t_1 (* 2.0 x2)))))))
(if (<= x1 1.9)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_6)))))
(if (<= x1 3.4e+130)
(+
x1
(+
9.0
(+
x1
(+
t_3
(+
(* t_1 t_2)
(* t_0 (+ t_5 (* t_4 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(* x1 (+ 2.0 (* 4.0 t_6)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = t_2 - 3.0;
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00275) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 * (x1 * x1)
t_4 = t_2 - 3.0d0
t_5 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-0.00275d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0d0) * t_2) * t_4) + t_5)) + (t_1 * (2.0d0 * x2))))))
else if (x1 <= 1.9d0) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_6))))
else if (x1 <= 3.4d+130) then
tmp = x1 + (9.0d0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_6))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = t_2 - 3.0;
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00275) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 * (x1 * x1) t_4 = t_2 - 3.0 t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_6 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -0.00275: tmp = x1 + (9.0 + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2)))))) elif x1 <= 1.9: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))) elif x1 <= 3.4e+130: tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 * (2.0 + (4.0 * t_6)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(t_2 - 3.0) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -0.00275) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_3 + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * t_4) + t_5)) + Float64(t_1 * Float64(2.0 * x2))))))); elseif (x1 <= 1.9) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_6))))); elseif (x1 <= 3.4e+130) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_3 + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(t_5 + Float64(t_4 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_6))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 * (x1 * x1); t_4 = t_2 - 3.0; t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_6 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -0.00275) tmp = x1 + (9.0 + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2)))))); elseif (x1 <= 1.9) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))); elseif (x1 <= 3.4e+130) tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 * (2.0 + (4.0 * t_6)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 - 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00275], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$3 + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$4), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$3 + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + N[(t$95$4 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := t\_2 - 3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -0.00275:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_3 + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot t\_4 + t\_5\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_3 + \left(t\_1 \cdot t\_2 + t\_0 \cdot \left(t\_5 + t\_4 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_6\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -0.0027499999999999998Initial program 99.1%
Taylor expanded in x1 around inf 99.1%
Taylor expanded in x1 around 0 89.7%
if -0.0027499999999999998 < x1 < 1.8999999999999999Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
if 1.8999999999999999 < x1 < 3.4000000000000001e130Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
Taylor expanded in x1 around 0 92.8%
+-commutative92.8%
neg-mul-192.8%
unsub-neg92.8%
Simplified92.8%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3 (* x1 (* x1 x1)))
(t_4 (- t_2 3.0))
(t_5 (* (* x1 x1) (- (* t_2 4.0) 6.0)))
(t_6 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -0.00145)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
t_3
(+
(* t_0 (+ (* (* (* x1 2.0) t_2) t_4) t_5))
(* t_1 (* 2.0 x2)))))))
(if (<= x1 1.9)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_6)))))
(if (<= x1 3.4e+130)
(+
x1
(+
9.0
(+
x1
(+
t_3
(+
(* t_1 t_2)
(* t_0 (+ t_5 (* t_4 (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(* x1 (+ 2.0 (* 4.0 t_6)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = t_2 - 3.0;
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00145) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 * (x1 * x1)
t_4 = t_2 - 3.0d0
t_5 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-0.00145d0)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0d0) * t_2) * t_4) + t_5)) + (t_1 * (2.0d0 * x2))))))
else if (x1 <= 1.9d0) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_6))))
else if (x1 <= 3.4d+130) then
tmp = x1 + (9.0d0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_6))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 * (x1 * x1);
double t_4 = t_2 - 3.0;
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00145) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 1.9) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 * (x1 * x1) t_4 = t_2 - 3.0 t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_6 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -0.00145: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2)))))) elif x1 <= 1.9: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))) elif x1 <= 3.4e+130: tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = x1 * (2.0 + (4.0 * t_6)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 * Float64(x1 * x1)) t_4 = Float64(t_2 - 3.0) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -0.00145) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(t_3 + Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * t_4) + t_5)) + Float64(t_1 * Float64(2.0 * x2))))))); elseif (x1 <= 1.9) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_6))))); elseif (x1 <= 3.4e+130) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_3 + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(t_5 + Float64(t_4 * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_6))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 * (x1 * x1); t_4 = t_2 - 3.0; t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_6 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -0.00145) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_3 + ((t_0 * ((((x1 * 2.0) * t_2) * t_4) + t_5)) + (t_1 * (2.0 * x2)))))); elseif (x1 <= 1.9) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))); elseif (x1 <= 3.4e+130) tmp = x1 + (9.0 + (x1 + (t_3 + ((t_1 * t_2) + (t_0 * (t_5 + (t_4 * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = x1 * (2.0 + (4.0 * t_6)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 - 3.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00145], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$3 + N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$4), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$3 + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + N[(t$95$4 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 \cdot \left(x1 \cdot x1\right)\\
t_4 := t\_2 - 3\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -0.00145:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(t\_3 + \left(t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot t\_4 + t\_5\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.9:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_3 + \left(t\_1 \cdot t\_2 + t\_0 \cdot \left(t\_5 + t\_4 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_6\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -0.00145Initial program 99.1%
Taylor expanded in x1 around 0 97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x1 around 0 89.7%
if -0.00145 < x1 < 1.8999999999999999Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
if 1.8999999999999999 < x1 < 3.4000000000000001e130Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
Taylor expanded in x1 around 0 92.8%
+-commutative92.8%
neg-mul-192.8%
unsub-neg92.8%
Simplified92.8%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_3)
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (* (* x1 2.0) t_3) (/ -1.0 x1)))))))))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -245.0)
t_4
(if (<= x1 186.0)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x1 t_1)))))
(if (<= x1 3.4e+130) t_4 (* x1 (+ 2.0 (* 4.0 t_1)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -245.0) {
tmp = t_4;
} else if (x1 <= 186.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 3.4e+130) {
tmp = t_4;
} else {
tmp = x1 * (2.0 + (4.0 * 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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_3) * ((-1.0d0) / x1))))))))
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-245.0d0)) then
tmp = t_4
else if (x1 <= 186.0d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x1 * t_1))))
else if (x1 <= 3.4d+130) then
tmp = t_4
else
tmp = x1 * (2.0d0 + (4.0d0 * t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -245.0) {
tmp = t_4;
} else if (x1 <= 186.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 3.4e+130) {
tmp = t_4;
} else {
tmp = x1 * (2.0 + (4.0 * t_1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -245.0: tmp = t_4 elif x1 <= 186.0: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_1)))) elif x1 <= 3.4e+130: tmp = t_4 else: tmp = x1 * (2.0 + (4.0 * t_1)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(-1.0 / x1))))))))) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -245.0) tmp = t_4; elseif (x1 <= 186.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_1))))); elseif (x1 <= 3.4e+130) tmp = t_4; else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (((x1 * 2.0) * t_3) * (-1.0 / x1)))))))); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -245.0) tmp = t_4; elseif (x1 <= 186.0) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * t_1)))); elseif (x1 <= 3.4e+130) tmp = t_4; else tmp = x1 * (2.0 + (4.0 * t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 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$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -245.0], t$95$4, If[LessEqual[x1, 186.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], t$95$4, N[(x1 * N[(2.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -245:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 186:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -245 or 186 < x1 < 3.4000000000000001e130Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 88.7%
if -245 < x1 < 186Initial program 99.4%
Taylor expanded in x1 around 0 91.3%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3 (* (* x1 2.0) t_2))
(t_4 (* x1 (* x1 x1)))
(t_5 (* (* x1 x1) (- (* t_2 4.0) 6.0)))
(t_6 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -0.00082)
(+
x1
(+
9.0
(+
x1
(+ t_4 (+ (* t_0 (+ (* t_3 (- t_2 3.0)) t_5)) (* t_1 (* 2.0 x2)))))))
(if (<= x1 150.0)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_6)))))
(if (<= x1 3.4e+130)
(+
x1
(+
9.0
(+
x1
(+ t_4 (+ (* t_1 t_2) (* t_0 (+ t_5 (* t_3 (/ -1.0 x1)))))))))
(* x1 (+ 2.0 (* 4.0 t_6)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = (x1 * 2.0) * t_2;
double t_4 = x1 * (x1 * x1);
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00082) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_0 * ((t_3 * (t_2 - 3.0)) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 150.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_1 * t_2) + (t_0 * (t_5 + (t_3 * (-1.0 / x1))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = (x1 * 2.0d0) * t_2
t_4 = x1 * (x1 * x1)
t_5 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
t_6 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-0.00082d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_4 + ((t_0 * ((t_3 * (t_2 - 3.0d0)) + t_5)) + (t_1 * (2.0d0 * x2))))))
else if (x1 <= 150.0d0) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_6))))
else if (x1 <= 3.4d+130) then
tmp = x1 + (9.0d0 + (x1 + (t_4 + ((t_1 * t_2) + (t_0 * (t_5 + (t_3 * ((-1.0d0) / x1))))))))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_6))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = (x1 * 2.0) * t_2;
double t_4 = x1 * (x1 * x1);
double t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_6 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -0.00082) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_0 * ((t_3 * (t_2 - 3.0)) + t_5)) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 150.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6))));
} else if (x1 <= 3.4e+130) {
tmp = x1 + (9.0 + (x1 + (t_4 + ((t_1 * t_2) + (t_0 * (t_5 + (t_3 * (-1.0 / x1))))))));
} else {
tmp = x1 * (2.0 + (4.0 * t_6));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = (x1 * 2.0) * t_2 t_4 = x1 * (x1 * x1) t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_6 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -0.00082: tmp = x1 + (9.0 + (x1 + (t_4 + ((t_0 * ((t_3 * (t_2 - 3.0)) + t_5)) + (t_1 * (2.0 * x2)))))) elif x1 <= 150.0: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))) elif x1 <= 3.4e+130: tmp = x1 + (9.0 + (x1 + (t_4 + ((t_1 * t_2) + (t_0 * (t_5 + (t_3 * (-1.0 / x1)))))))) else: tmp = x1 * (2.0 + (4.0 * t_6)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(Float64(x1 * 2.0) * t_2) t_4 = Float64(x1 * Float64(x1 * x1)) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_6 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -0.00082) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_4 + Float64(Float64(t_0 * Float64(Float64(t_3 * Float64(t_2 - 3.0)) + t_5)) + Float64(t_1 * Float64(2.0 * x2))))))); elseif (x1 <= 150.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_6))))); elseif (x1 <= 3.4e+130) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_4 + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(t_5 + Float64(t_3 * Float64(-1.0 / x1))))))))); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_6))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = (x1 * 2.0) * t_2; t_4 = x1 * (x1 * x1); t_5 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_6 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -0.00082) tmp = x1 + (9.0 + (x1 + (t_4 + ((t_0 * ((t_3 * (t_2 - 3.0)) + t_5)) + (t_1 * (2.0 * x2)))))); elseif (x1 <= 150.0) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_6)))); elseif (x1 <= 3.4e+130) tmp = x1 + (9.0 + (x1 + (t_4 + ((t_1 * t_2) + (t_0 * (t_5 + (t_3 * (-1.0 / x1)))))))); else tmp = x1 * (2.0 + (4.0 * t_6)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00082], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$4 + N[(N[(t$95$0 * N[(N[(t$95$3 * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 150.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$4 + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(t$95$5 + N[(t$95$3 * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := \left(x1 \cdot 2\right) \cdot t\_2\\
t_4 := x1 \cdot \left(x1 \cdot x1\right)\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_6 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -0.00082:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_4 + \left(t\_0 \cdot \left(t\_3 \cdot \left(t\_2 - 3\right) + t\_5\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 150:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_4 + \left(t\_1 \cdot t\_2 + t\_0 \cdot \left(t\_5 + t\_3 \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_6\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -8.1999999999999998e-4Initial program 99.1%
Taylor expanded in x1 around inf 99.1%
Taylor expanded in x1 around 0 89.7%
if -8.1999999999999998e-4 < x1 < 150Initial program 99.5%
Taylor expanded in x1 around 0 91.8%
if 150 < x1 < 3.4000000000000001e130Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
Taylor expanded in x1 around inf 87.4%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification71.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (* 2.0 x2))
(*
t_0
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) t_2) (/ -1.0 x1))))))))))
(t_4 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -114.0)
t_3
(if (<= x1 14500.0)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_4)))))
(if (<= x1 3.4e+130) t_3 (* x1 (+ 2.0 (* 4.0 t_4)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1))))))));
double t_4 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -114.0) {
tmp = t_3;
} else if (x1 <= 14500.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_4))));
} else if (x1 <= 3.4e+130) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * t_4));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0d0 * x2)) + (t_0 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * ((-1.0d0) / x1))))))))
t_4 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= (-114.0d0)) then
tmp = t_3
else if (x1 <= 14500.0d0) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_4))))
else if (x1 <= 3.4d+130) then
tmp = t_3
else
tmp = x1 * (2.0d0 + (4.0d0 * t_4))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1))))))));
double t_4 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= -114.0) {
tmp = t_3;
} else if (x1 <= 14500.0) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_4))));
} else if (x1 <= 3.4e+130) {
tmp = t_3;
} else {
tmp = x1 * (2.0 + (4.0 * t_4));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1)))))))) t_4 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= -114.0: tmp = t_3 elif x1 <= 14500.0: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_4)))) elif x1 <= 3.4e+130: tmp = t_3 else: tmp = x1 * (2.0 + (4.0 * t_4)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(2.0 * x2)) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(-1.0 / x1))))))))) t_4 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= -114.0) tmp = t_3; elseif (x1 <= 14500.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_4))))); elseif (x1 <= 3.4e+130) tmp = t_3; else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_4))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (2.0 * x2)) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (-1.0 / x1)))))))); t_4 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= -114.0) tmp = t_3; elseif (x1 <= 14500.0) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_4)))); elseif (x1 <= 3.4e+130) tmp = t_3; else tmp = x1 * (2.0 + (4.0 * t_4)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -114.0], t$95$3, If[LessEqual[x1, 14500.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.4e+130], t$95$3, N[(x1 * N[(2.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(2 \cdot x2\right) + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
t_4 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq -114:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 14500:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_4\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_4\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 4.7%
*-commutative4.7%
*-commutative4.7%
associate-*l*4.7%
Simplified4.7%
Taylor expanded in x1 around 0 17.9%
neg-mul-117.9%
unsub-neg17.9%
*-commutative17.9%
Simplified17.9%
if -5.8000000000000005e102 < x1 < -114 or 14500 < x1 < 3.4000000000000001e130Initial program 99.4%
Taylor expanded in x1 around 0 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x1 around 0 84.3%
Taylor expanded in x1 around inf 80.3%
if -114 < x1 < 14500Initial program 99.4%
Taylor expanded in x1 around 0 91.3%
if 3.4000000000000001e130 < x1 Initial program 9.3%
Taylor expanded in x1 around 0 9.3%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x1 around inf 59.0%
Final simplification69.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -9e-57) (not (<= x2 2.05e+35))) (+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))) (* x2 -6.0))) (+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -9e-57) || !(x2 <= 2.05e+35)) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-9d-57)) .or. (.not. (x2 <= 2.05d+35))) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * (-6.0d0)))
else
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -9e-57) || !(x2 <= 2.05e+35)) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -9e-57) or not (x2 <= 2.05e+35): tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)) else: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -9e-57) || !(x2 <= 2.05e+35)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * -6.0))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -9e-57) || ~((x2 <= 2.05e+35))) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)); else tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -9e-57], N[Not[LessEqual[x2, 2.05e+35]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -9 \cdot 10^{-57} \lor \neg \left(x2 \leq 2.05 \cdot 10^{+35}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x2 < -8.99999999999999945e-57 or 2.0499999999999999e35 < x2 Initial program 61.9%
Taylor expanded in x1 around 0 43.1%
Taylor expanded in x1 around 0 58.6%
*-commutative58.6%
Simplified58.6%
if -8.99999999999999945e-57 < x2 < 2.0499999999999999e35Initial program 68.0%
Taylor expanded in x1 around 0 47.0%
Taylor expanded in x2 around 0 46.2%
*-commutative46.2%
*-commutative46.2%
associate-*l*46.2%
Simplified46.2%
Taylor expanded in x1 around 0 47.2%
neg-mul-147.2%
unsub-neg47.2%
*-commutative47.2%
Simplified47.2%
Final simplification53.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.4e+31)
(* -12.0 (* x1 x2))
(if (or (<= x1 -5.5e-112) (not (<= x1 2.45e-26)))
(* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))
(+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else if ((x1 <= -5.5e-112) || !(x1 <= 2.45e-26)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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 <= (-3.4d+31)) then
tmp = (-12.0d0) * (x1 * x2)
else if ((x1 <= (-5.5d-112)) .or. (.not. (x1 <= 2.45d-26))) then
tmp = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.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 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else if ((x1 <= -5.5e-112) || !(x1 <= 2.45e-26)) {
tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+31: tmp = -12.0 * (x1 * x2) elif (x1 <= -5.5e-112) or not (x1 <= 2.45e-26): tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+31) tmp = Float64(-12.0 * Float64(x1 * x2)); elseif ((x1 <= -5.5e-112) || !(x1 <= 2.45e-26)) tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.4e+31) tmp = -12.0 * (x1 * x2); elseif ((x1 <= -5.5e-112) || ~((x1 <= 2.45e-26))) tmp = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+31], N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -5.5e-112], N[Not[LessEqual[x1, 2.45e-26]], $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[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+31}:\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-112} \lor \neg \left(x1 \leq 2.45 \cdot 10^{-26}\right):\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -3.3999999999999998e31Initial program 27.3%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x2 around 0 3.8%
*-commutative3.8%
*-commutative3.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x1 around inf 11.2%
associate-*r/11.2%
metadata-eval11.2%
Simplified11.2%
Taylor expanded in x2 around inf 12.4%
if -3.3999999999999998e31 < x1 < -5.5e-112 or 2.45e-26 < x1 Initial program 64.5%
Taylor expanded in x1 around 0 42.0%
Taylor expanded in x1 around inf 48.2%
Taylor expanded in x1 around inf 47.9%
if -5.5e-112 < x1 < 2.45e-26Initial program 99.6%
Taylor expanded in x1 around 0 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in x1 around inf 59.9%
*-commutative59.9%
Simplified59.9%
Taylor expanded in x1 around 0 60.0%
Final simplification41.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -3.4e+31)
(* -12.0 (* x1 x2))
(if (<= x1 -2.4e-111)
(+ x1 (+ 9.0 (+ x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 2.45e-26) (+ x1 (* x2 -6.0)) (* x1 (+ 2.0 (* 4.0 t_0))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else if (x1 <= -2.4e-111) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 2.45e-26) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 * (2.0 + (4.0 * t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-3.4d+31)) then
tmp = (-12.0d0) * (x1 * x2)
else if (x1 <= (-2.4d-111)) then
tmp = x1 + (9.0d0 + (x1 + (4.0d0 * (x1 * t_0))))
else if (x1 <= 2.45d-26) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 * (2.0d0 + (4.0d0 * t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else if (x1 <= -2.4e-111) {
tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 2.45e-26) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 * (2.0 + (4.0 * t_0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -3.4e+31: tmp = -12.0 * (x1 * x2) elif x1 <= -2.4e-111: tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0)))) elif x1 <= 2.45e-26: tmp = x1 + (x2 * -6.0) else: tmp = x1 * (2.0 + (4.0 * t_0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -3.4e+31) tmp = Float64(-12.0 * Float64(x1 * x2)); elseif (x1 <= -2.4e-111) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 2.45e-26) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 * Float64(2.0 + Float64(4.0 * t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -3.4e+31) tmp = -12.0 * (x1 * x2); elseif (x1 <= -2.4e-111) tmp = x1 + (9.0 + (x1 + (4.0 * (x1 * t_0)))); elseif (x1 <= 2.45e-26) tmp = x1 + (x2 * -6.0); else tmp = x1 * (2.0 + (4.0 * t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.4e+31], N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.4e-111], N[(x1 + N[(9.0 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.45e-26], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+31}:\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{-111}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + 4 \cdot \left(x1 \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.45 \cdot 10^{-26}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + 4 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -3.3999999999999998e31Initial program 27.3%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x2 around 0 3.8%
*-commutative3.8%
*-commutative3.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x1 around inf 11.2%
associate-*r/11.2%
metadata-eval11.2%
Simplified11.2%
Taylor expanded in x2 around inf 12.4%
if -3.3999999999999998e31 < x1 < -2.4000000000000001e-111Initial program 99.2%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x1 around inf 47.5%
if -2.4000000000000001e-111 < x1 < 2.45e-26Initial program 99.6%
Taylor expanded in x1 around 0 78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in x1 around inf 59.9%
*-commutative59.9%
Simplified59.9%
Taylor expanded in x1 around 0 60.0%
if 2.45e-26 < x1 Initial program 53.9%
Taylor expanded in x1 around 0 28.5%
Taylor expanded in x1 around inf 48.4%
Taylor expanded in x1 around inf 48.4%
Final simplification42.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 -3.4e+31)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 -3.0)))) t_0))
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))) t_0)))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -3.4e+31) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + t_0);
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + t_0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
if (x1 <= (-3.4d+31)) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * (-3.0d0))))) + t_0)
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + t_0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double tmp;
if (x1 <= -3.4e+31) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + t_0);
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + t_0);
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x2 * -2.0) - x1) tmp = 0 if x1 <= -3.4e+31: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + t_0) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + t_0) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) tmp = 0.0 if (x1 <= -3.4e+31) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * -3.0)))) + t_0)); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + t_0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * ((x2 * -2.0) - x1); tmp = 0.0; if (x1 <= -3.4e+31) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * -3.0)))) + t_0); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + t_0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.4e+31], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+31}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot -3\right)\right)\right) + t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + t\_0\right)\\
\end{array}
\end{array}
if x1 < -3.3999999999999998e31Initial program 27.3%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x2 around 0 3.8%
*-commutative3.8%
*-commutative3.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x1 around 0 14.2%
neg-mul-114.2%
unsub-neg14.2%
*-commutative14.2%
Simplified14.2%
if -3.3999999999999998e31 < x1 Initial program 78.8%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x1 around 0 71.2%
neg-mul-147.3%
unsub-neg47.3%
*-commutative47.3%
Simplified71.2%
Final simplification55.8%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -3.4e+31) (* -12.0 (* x1 x2)) (+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))) (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.4d+31)) then
tmp = (-12.0d0) * (x1 * x2)
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.4e+31) {
tmp = -12.0 * (x1 * x2);
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.4e+31: tmp = -12.0 * (x1 * x2) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.4e+31) tmp = Float64(-12.0 * Float64(x1 * x2)); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.4e+31) tmp = -12.0 * (x1 * x2); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.4e+31], N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{+31}:\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot -6\right)\\
\end{array}
\end{array}
if x1 < -3.3999999999999998e31Initial program 27.3%
Taylor expanded in x1 around 0 0.3%
Taylor expanded in x2 around 0 3.8%
*-commutative3.8%
*-commutative3.8%
associate-*l*3.8%
Simplified3.8%
Taylor expanded in x1 around inf 11.2%
associate-*r/11.2%
metadata-eval11.2%
Simplified11.2%
Taylor expanded in x2 around inf 12.4%
if -3.3999999999999998e31 < x1 Initial program 78.8%
Taylor expanded in x1 around 0 61.5%
Taylor expanded in x1 around 0 58.3%
*-commutative58.3%
Simplified58.3%
Final simplification45.9%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.3e-26) (* -12.0 (* x1 x2)) (if (<= x1 1.95e+46) (+ x1 (* x2 -6.0)) (* x1 (+ 2.0 (* x2 -12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.3e-26) {
tmp = -12.0 * (x1 * x2);
} else if (x1 <= 1.95e+46) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 * (2.0 + (x2 * -12.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.3d-26)) then
tmp = (-12.0d0) * (x1 * x2)
else if (x1 <= 1.95d+46) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 * (2.0d0 + (x2 * (-12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.3e-26) {
tmp = -12.0 * (x1 * x2);
} else if (x1 <= 1.95e+46) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 * (2.0 + (x2 * -12.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.3e-26: tmp = -12.0 * (x1 * x2) elif x1 <= 1.95e+46: tmp = x1 + (x2 * -6.0) else: tmp = x1 * (2.0 + (x2 * -12.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.3e-26) tmp = Float64(-12.0 * Float64(x1 * x2)); elseif (x1 <= 1.95e+46) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 * Float64(2.0 + Float64(x2 * -12.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.3e-26) tmp = -12.0 * (x1 * x2); elseif (x1 <= 1.95e+46) tmp = x1 + (x2 * -6.0); else tmp = x1 * (2.0 + (x2 * -12.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.3e-26], N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.95e+46], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(2.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{-26}:\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{elif}\;x1 \leq 1.95 \cdot 10^{+46}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(2 + x2 \cdot -12\right)\\
\end{array}
\end{array}
if x1 < -1.30000000000000005e-26Initial program 35.5%
Taylor expanded in x1 around 0 7.4%
Taylor expanded in x2 around 0 4.9%
*-commutative4.9%
*-commutative4.9%
associate-*l*4.9%
Simplified4.9%
Taylor expanded in x1 around inf 10.6%
associate-*r/10.6%
metadata-eval10.6%
Simplified10.6%
Taylor expanded in x2 around inf 11.6%
if -1.30000000000000005e-26 < x1 < 1.94999999999999997e46Initial program 99.4%
Taylor expanded in x1 around 0 75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in x1 around inf 50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in x1 around 0 44.4%
if 1.94999999999999997e46 < x1 Initial program 40.9%
Taylor expanded in x1 around 0 20.8%
Taylor expanded in x2 around 0 5.9%
*-commutative5.9%
*-commutative5.9%
associate-*l*5.9%
Simplified5.9%
Taylor expanded in x1 around inf 21.7%
associate-*r/21.7%
metadata-eval21.7%
Simplified21.7%
Taylor expanded in x1 around inf 21.7%
*-commutative21.7%
Simplified21.7%
Final simplification28.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -7.8e-26) (not (<= x1 3.4e+52))) (* -12.0 (* x1 x2)) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -7.8e-26) || !(x1 <= 3.4e+52)) {
tmp = -12.0 * (x1 * x2);
} 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 <= (-7.8d-26)) .or. (.not. (x1 <= 3.4d+52))) then
tmp = (-12.0d0) * (x1 * x2)
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -7.8e-26) || !(x1 <= 3.4e+52)) {
tmp = -12.0 * (x1 * x2);
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -7.8e-26) or not (x1 <= 3.4e+52): tmp = -12.0 * (x1 * x2) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -7.8e-26) || !(x1 <= 3.4e+52)) tmp = Float64(-12.0 * Float64(x1 * x2)); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -7.8e-26) || ~((x1 <= 3.4e+52))) tmp = -12.0 * (x1 * x2); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -7.8e-26], N[Not[LessEqual[x1, 3.4e+52]], $MachinePrecision]], N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.8 \cdot 10^{-26} \lor \neg \left(x1 \leq 3.4 \cdot 10^{+52}\right):\\
\;\;\;\;-12 \cdot \left(x1 \cdot x2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -7.79999999999999973e-26 or 3.4e52 < x1 Initial program 37.1%
Taylor expanded in x1 around 0 13.6%
Taylor expanded in x2 around 0 5.3%
*-commutative5.3%
*-commutative5.3%
associate-*l*5.3%
Simplified5.3%
Taylor expanded in x1 around inf 15.9%
associate-*r/15.9%
metadata-eval15.9%
Simplified15.9%
Taylor expanded in x2 around inf 15.8%
if -7.79999999999999973e-26 < x1 < 3.4e52Initial program 99.4%
Taylor expanded in x1 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in x1 around inf 51.6%
*-commutative51.6%
Simplified51.6%
Taylor expanded in x1 around 0 43.7%
Final simplification28.2%
(FPCore (x1 x2) :precision binary64 (* -12.0 (* x1 x2)))
double code(double x1, double x2) {
return -12.0 * (x1 * x2);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (-12.0d0) * (x1 * x2)
end function
public static double code(double x1, double x2) {
return -12.0 * (x1 * x2);
}
def code(x1, x2): return -12.0 * (x1 * x2)
function code(x1, x2) return Float64(-12.0 * Float64(x1 * x2)) end
function tmp = code(x1, x2) tmp = -12.0 * (x1 * x2); end
code[x1_, x2_] := N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-12 \cdot \left(x1 \cdot x2\right)
\end{array}
Initial program 64.9%
Taylor expanded in x1 around 0 45.0%
Taylor expanded in x2 around 0 32.8%
*-commutative32.8%
*-commutative32.8%
associate-*l*32.8%
Simplified32.8%
Taylor expanded in x1 around inf 10.3%
associate-*r/10.3%
metadata-eval10.3%
Simplified10.3%
Taylor expanded in x2 around inf 10.4%
Final simplification10.4%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 64.9%
Taylor expanded in x1 around 0 45.0%
Taylor expanded in x1 around inf 25.7%
Taylor expanded in x1 around 0 3.4%
Final simplification3.4%
herbie shell --seed 2024031
(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))))))