
(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 21 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))))))
(* 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 = 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(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[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(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 (* 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 = 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 = 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 = 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(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 = 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[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.5%
(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) (- (* t_2 4.0) 6.0)))
(t_5 (* x1 (* x1 x1)))
(t_6 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(if (<= x1 -6.8e+75)
(* 6.0 (pow x1 4.0))
(if (<= x1 0.33)
(+
x1
(+
t_6
(+
x1
(+
t_5
(+
t_3
(*
t_1
(+ t_4 (* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(if (<= x1 1e+153)
(+
x1
(+
t_6
(+
x1
(+
t_5
(+
t_3
(*
t_1
(+
t_4
(*
(* (* x1 2.0) t_2)
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)))))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -6.8e+75) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 0.33) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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) :: 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) * ((t_2 * 4.0d0) - 6.0d0)
t_5 = x1 * (x1 * x1)
t_6 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
if (x1 <= (-6.8d+75)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= 0.33d0) then
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else if (x1 <= 1d+153) then
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0d0) * t_2) * (((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1))))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -6.8e+75) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= 0.33) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = t_0 * t_2 t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_5 = x1 * (x1 * x1) t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) tmp = 0 if x1 <= -6.8e+75: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= 0.33: tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) elif x1 <= 1e+153: tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1)))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(t_0 * t_2) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) tmp = 0.0 if (x1 <= -6.8e+75) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 0.33) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(t_3 + Float64(t_1 * Float64(t_4 + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(t_3 + Float64(t_1 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1))))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = t_0 * t_2; t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_5 = x1 * (x1 * x1); t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); tmp = 0.0; if (x1 <= -6.8e+75) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= 0.33) tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); elseif (x1 <= 1e+153) tmp = x1 + (t_6 + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1)))))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.8e+75], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.33], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(t$95$3 + N[(t$95$1 * N[(t$95$4 + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(t$95$3 + N[(t$95$1 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.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 := t\_0 \cdot t\_2\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -6.8 \cdot 10^{+75}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 0.33:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_5 + \left(t\_3 + t\_1 \cdot \left(t\_4 + \left(t\_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_5 + \left(t\_3 + t\_1 \cdot \left(t\_4 + \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \frac{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -6.80000000000000022e75Initial program 19.1%
Simplified19.1%
Taylor expanded in x1 around inf 97.9%
if -6.80000000000000022e75 < x1 < 0.330000000000000016Initial program 99.3%
Taylor expanded in x1 around 0 97.7%
if 0.330000000000000016 < x1 < 1e153Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification98.2%
(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
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(*
(* (* x1 2.0) t_2)
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)))))))
(* 3.0 (* x2 -2.0))))))
(if (<= x1 -1.2e+76)
(* 6.0 (pow x1 4.0))
(if (<= x1 -3900.0)
t_3
(if (<= x1 1.35)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1e+153)
t_3
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -1.2e+76) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= -3900.0) {
tmp = t_3;
} else if (x1 <= 1.35) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * (((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1))))))) + (3.0d0 * (x2 * (-2.0d0))))
if (x1 <= (-1.2d+76)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= (-3900.0d0)) then
tmp = t_3
else if (x1 <= 1.35d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1d+153) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -1.2e+76) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= -3900.0) {
tmp = t_3;
} else if (x1 <= 1.35) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0))) tmp = 0 if x1 <= -1.2e+76: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= -3900.0: tmp = t_3 elif x1 <= 1.35: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1e+153: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1))))))) + Float64(3.0 * Float64(x2 * -2.0)))) tmp = 0.0 if (x1 <= -1.2e+76) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= -3900.0) tmp = t_3; elseif (x1 <= 1.35) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1e+153) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0))); tmp = 0.0; if (x1 <= -1.2e+76) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= -3900.0) tmp = t_3; elseif (x1 <= 1.35) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1e+153) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * 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[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.2e+76], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3900.0], t$95$3, If[LessEqual[x1, 1.35], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.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(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \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{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+76}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq -3900:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 1.35:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -1.2e76Initial program 19.1%
Simplified19.1%
Taylor expanded in x1 around inf 97.9%
if -1.2e76 < x1 < -3900 or 1.3500000000000001 < x1 < 1e153Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if -3900 < x1 < 1.3500000000000001Initial program 99.3%
Simplified99.6%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 97.7%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification98.3%
(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) (- (* t_2 4.0) 6.0)))
(t_5 (* x1 (* x1 x1))))
(if (<= x1 -6.8e+75)
(* 6.0 (pow x1 4.0))
(if (<= x1 0.33)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
t_5
(+
t_3
(*
t_1
(+ t_4 (* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(if (<= x1 1e+153)
(+
x1
(+
(+
x1
(+
t_5
(+
t_3
(*
t_1
(+
t_4
(*
(* (* x1 2.0) t_2)
(/ (+ (* 2.0 (/ x2 x1)) (- -1.0 (/ 3.0 x1))) x1)))))))
(* 3.0 (* x2 -2.0))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_5 = x1 * (x1 * x1);
double tmp;
if (x1 <= -6.8e+75) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 0.33) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = t_0 * t_2
t_4 = (x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)
t_5 = x1 * (x1 * x1)
if (x1 <= (-6.8d+75)) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else if (x1 <= 0.33d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else if (x1 <= 1d+153) then
tmp = x1 + ((x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0d0) * t_2) * (((2.0d0 * (x2 / x1)) + ((-1.0d0) - (3.0d0 / x1))) / x1))))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = t_0 * t_2;
double t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0);
double t_5 = x1 * (x1 * x1);
double tmp;
if (x1 <= -6.8e+75) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else if (x1 <= 0.33) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else if (x1 <= 1e+153) {
tmp = x1 + ((x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = t_0 * t_2 t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0) t_5 = x1 * (x1 * x1) tmp = 0 if x1 <= -6.8e+75: tmp = 6.0 * math.pow(x1, 4.0) elif x1 <= 0.33: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) elif x1 <= 1e+153: tmp = x1 + ((x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(t_0 * t_2) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) t_5 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -6.8e+75) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 0.33) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_5 + Float64(t_3 + Float64(t_1 * Float64(t_4 + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_5 + Float64(t_3 + Float64(t_1 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(Float64(2.0 * Float64(x2 / x1)) + Float64(-1.0 - Float64(3.0 / x1))) / x1))))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = t_0 * t_2; t_4 = (x1 * x1) * ((t_2 * 4.0) - 6.0); t_5 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -6.8e+75) tmp = 6.0 * (x1 ^ 4.0); elseif (x1 <= 0.33) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_5 + (t_3 + (t_1 * (t_4 + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); elseif (x1 <= 1e+153) tmp = x1 + ((x1 + (t_5 + (t_3 + (t_1 * (t_4 + (((x1 * 2.0) * t_2) * (((2.0 * (x2 / x1)) + (-1.0 - (3.0 / x1))) / x1))))))) + (3.0 * (x2 * -2.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.8e+75], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.33], 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$5 + N[(t$95$3 + N[(t$95$1 * N[(t$95$4 + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(N[(x1 + N[(t$95$5 + N[(t$95$3 + N[(t$95$1 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(N[(2.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.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 := t\_0 \cdot t\_2\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -6.8 \cdot 10^{+75}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 0.33:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(t\_5 + \left(t\_3 + t\_1 \cdot \left(t\_4 + \left(t\_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_5 + \left(t\_3 + t\_1 \cdot \left(t\_4 + \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \frac{2 \cdot \frac{x2}{x1} + \left(-1 - \frac{3}{x1}\right)}{x1}\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -6.80000000000000022e75Initial program 19.1%
Simplified19.1%
Taylor expanded in x1 around inf 97.9%
if -6.80000000000000022e75 < x1 < 0.330000000000000016Initial program 99.3%
Taylor expanded in x1 around 0 97.7%
if 0.330000000000000016 < x1 < 1e153Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 6.0 (pow x1 4.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 (* 2.0 x2)))))))))
(if (<= x1 -1.2e+76)
t_1
(if (<= x1 -3900.0)
t_4
(if (<= x1 0.175)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.62e+77) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 6.0 * pow(x1, 4.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2))))));
double tmp;
if (x1 <= -1.2e+76) {
tmp = t_1;
} else if (x1 <= -3900.0) {
tmp = t_4;
} else if (x1 <= 0.175) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.62e+77) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 6.0d0 * (x1 ** 4.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0d0) * t_3) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (t_0 * (2.0d0 * x2))))))
if (x1 <= (-1.2d+76)) then
tmp = t_1
else if (x1 <= (-3900.0d0)) then
tmp = t_4
else if (x1 <= 0.175d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.62d+77) then
tmp = t_4
else
tmp = 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 = 6.0 * Math.pow(x1, 4.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2))))));
double tmp;
if (x1 <= -1.2e+76) {
tmp = t_1;
} else if (x1 <= -3900.0) {
tmp = t_4;
} else if (x1 <= 0.175) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.62e+77) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 6.0 * math.pow(x1, 4.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2)))))) tmp = 0 if x1 <= -1.2e+76: tmp = t_1 elif x1 <= -3900.0: tmp = t_4 elif x1 <= 0.175: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.62e+77: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(6.0 * (x1 ^ 4.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(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * Float64(2.0 * x2))))))) tmp = 0.0 if (x1 <= -1.2e+76) tmp = t_1; elseif (x1 <= -3900.0) tmp = t_4; elseif (x1 <= 0.175) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.62e+77) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 6.0 * (x1 ^ 4.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * (2.0 * x2)))))); tmp = 0.0; if (x1 <= -1.2e+76) tmp = t_1; elseif (x1 <= -3900.0) tmp = t_4; elseif (x1 <= 0.175) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.62e+77) tmp = t_4; else tmp = 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[(6.0 * N[Power[x1, 4.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[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.2e+76], t$95$1, If[LessEqual[x1, -3900.0], t$95$4, If[LessEqual[x1, 0.175], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.62e+77], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -3900:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 0.175:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.62 \cdot 10^{+77}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.2e76 or 1.62e77 < x1 Initial program 35.5%
Simplified35.5%
Taylor expanded in x1 around inf 98.9%
if -1.2e76 < x1 < -3900 or 0.17499999999999999 < x1 < 1.62e77Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around 0 89.8%
if -3900 < x1 < 0.17499999999999999Initial program 99.3%
Simplified99.6%
Taylor expanded in x1 around 0 86.2%
Taylor expanded in x2 around 0 97.7%
Final simplification97.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 3.0 (* x2 -2.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_1 (* 2.0 x2)) x1) t_4)))
(if (<= x1 -3.1e+102)
(+
x1
(+
t_3
(+
x1
(-
(+ t_0 (* x1 (- (* x1 (+ (* x1 -6.0) (+ t_0 (* x2 6.0)))) 4.0)))
6.0))))
(if (<= x1 -3900.0)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(*
t_4
(+
(* (* (* x1 2.0) t_5) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_1 (* 2.0 x2)))))))
(if (<= x1 14500000000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1e+153)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(* t_1 t_5)
(* t_4 (- (+ t_0 (* x1 (- (* x1 6.0) 4.0))) 6.0)))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -3.1e+102) {
tmp = x1 + (t_3 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= -3900.0) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 14500000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * t_5) + (t_4 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = 4.0d0 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (x1 * x1)
t_3 = 3.0d0 * (x2 * (-2.0d0))
t_4 = (x1 * x1) + 1.0d0
t_5 = ((t_1 + (2.0d0 * x2)) - x1) / t_4
if (x1 <= (-3.1d+102)) then
tmp = x1 + (t_3 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * (-6.0d0)) + (t_0 + (x2 * 6.0d0)))) - 4.0d0))) - 6.0d0)))
else if (x1 <= (-3900.0d0)) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * ((((x1 * 2.0d0) * t_5) * (t_5 - 3.0d0)) + ((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)))) + (t_1 * (2.0d0 * x2))))))
else if (x1 <= 14500000000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1d+153) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * t_5) + (t_4 * ((t_0 + (x1 * ((x1 * 6.0d0) - 4.0d0))) - 6.0d0))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4;
double tmp;
if (x1 <= -3.1e+102) {
tmp = x1 + (t_3 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= -3900.0) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2))))));
} else if (x1 <= 14500000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * t_5) + (t_4 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = x1 * (x1 * x1) t_3 = 3.0 * (x2 * -2.0) t_4 = (x1 * x1) + 1.0 t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4 tmp = 0 if x1 <= -3.1e+102: tmp = x1 + (t_3 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))) elif x1 <= -3900.0: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2)))))) elif x1 <= 14500000000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1e+153: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * t_5) + (t_4 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0)))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(3.0 * Float64(x2 * -2.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_4) tmp = 0.0 if (x1 <= -3.1e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(t_0 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) + Float64(t_0 + Float64(x2 * 6.0)))) - 4.0))) - 6.0)))); elseif (x1 <= -3900.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_1 * Float64(2.0 * x2))))))); elseif (x1 <= 14500000000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1e+153) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_1 * t_5) + Float64(t_4 * Float64(Float64(t_0 + Float64(x1 * Float64(Float64(x1 * 6.0) - 4.0))) - 6.0))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = x1 * (x1 * x1); t_3 = 3.0 * (x2 * -2.0); t_4 = (x1 * x1) + 1.0; t_5 = ((t_1 + (2.0 * x2)) - x1) / t_4; tmp = 0.0; if (x1 <= -3.1e+102) tmp = x1 + (t_3 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))); elseif (x1 <= -3900.0) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_1 * (2.0 * x2)))))); elseif (x1 <= 14500000000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1e+153) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * t_5) + (t_4 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0)))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[x1, -3.1e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(t$95$0 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3900.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 14500000000.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1e+153], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$1 * t$95$5), $MachinePrecision] + N[(t$95$4 * N[(N[(t$95$0 + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2\right)\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_4}\\
\mathbf{if}\;x1 \leq -3.1 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(\left(t\_0 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 + \left(t\_0 + x2 \cdot 6\right)\right) - 4\right)\right) - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3900:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_2 + \left(t\_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(t\_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\right) + t\_1 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 14500000000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_2 + \left(t\_1 \cdot t\_5 + t\_4 \cdot \left(\left(t\_0 + x1 \cdot \left(x1 \cdot 6 - 4\right)\right) - 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.09999999999999987e102Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
*-commutative2.6%
Simplified2.6%
Taylor expanded in x1 around -inf 2.6%
Taylor expanded in x1 around 0 94.9%
if -3.09999999999999987e102 < x1 < -3900Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around 0 99.5%
if -3900 < x1 < 1.45e10Initial program 99.3%
Simplified99.6%
Taylor expanded in x1 around 0 85.6%
Taylor expanded in x2 around 0 97.0%
if 1.45e10 < x1 < 1e153Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around -inf 87.7%
Taylor expanded in x1 around 0 87.8%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (- (* 2.0 x2) 3.0)))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4
(+
x1
(+
t_1
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(* t_3 (- (+ t_0 (* x1 (- (* x1 6.0) 4.0))) 6.0)))))))))
(if (<= x1 -5e+102)
(+
x1
(+
t_1
(+
x1
(-
(+ t_0 (* x1 (- (* x1 (+ (* x1 -6.0) (+ t_0 (* x2 6.0)))) 4.0)))
6.0))))
(if (<= x1 -7.4e+27)
t_4
(if (<= x1 14500000000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1e+153)
t_4
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (t_1 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= -7.4e+27) {
tmp = t_4;
} else if (x1 <= 14500000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = 4.0d0 * ((2.0d0 * x2) - 3.0d0)
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0d0 * x2)) - x1) / t_3)) + (t_3 * ((t_0 + (x1 * ((x1 * 6.0d0) - 4.0d0))) - 6.0d0))))))
if (x1 <= (-5d+102)) then
tmp = x1 + (t_1 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * (-6.0d0)) + (t_0 + (x2 * 6.0d0)))) - 4.0d0))) - 6.0d0)))
else if (x1 <= (-7.4d+27)) then
tmp = t_4
else if (x1 <= 14500000000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1d+153) then
tmp = t_4
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (t_1 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= -7.4e+27) {
tmp = t_4;
} else if (x1 <= 14500000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1e+153) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * ((2.0 * x2) - 3.0) t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0)))))) tmp = 0 if x1 <= -5e+102: tmp = x1 + (t_1 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))) elif x1 <= -7.4e+27: tmp = t_4 elif x1 <= 14500000000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1e+153: tmp = t_4 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3)) + Float64(t_3 * Float64(Float64(t_0 + Float64(x1 * Float64(Float64(x1 * 6.0) - 4.0))) - 6.0))))))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(Float64(t_0 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) + Float64(t_0 + Float64(x2 * 6.0)))) - 4.0))) - 6.0)))); elseif (x1 <= -7.4e+27) tmp = t_4; elseif (x1 <= 14500000000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1e+153) tmp = t_4; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * ((2.0 * x2) - 3.0); t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = x1 + (t_1 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((t_0 + (x1 * ((x1 * 6.0) - 4.0))) - 6.0)))))); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + (t_1 + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))); elseif (x1 <= -7.4e+27) tmp = t_4; elseif (x1 <= 14500000000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1e+153) tmp = t_4; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$1 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(t$95$0 + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(N[(t$95$0 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -7.4e+27], t$95$4, If[LessEqual[x1, 14500000000.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1e+153], t$95$4, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := x1 + \left(t\_1 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3} + t\_3 \cdot \left(\left(t\_0 + x1 \cdot \left(x1 \cdot 6 - 4\right)\right) - 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t\_1 + \left(x1 + \left(\left(t\_0 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 + \left(t\_0 + x2 \cdot 6\right)\right) - 4\right)\right) - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -7.4 \cdot 10^{+27}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 14500000000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
*-commutative2.6%
Simplified2.6%
Taylor expanded in x1 around -inf 2.6%
Taylor expanded in x1 around 0 94.9%
if -5e102 < x1 < -7.40000000000000004e27 or 1.45e10 < x1 < 1e153Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around -inf 90.0%
Taylor expanded in x1 around 0 90.1%
if -7.40000000000000004e27 < x1 < 1.45e10Initial program 99.2%
Simplified99.6%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x2 around 0 95.7%
if 1e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification94.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* 4.0 t_0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (* 3.0 (* x2 -2.0)))
(t_4 (+ (* x1 x1) 1.0)))
(if (<= x1 -2.4e+99)
(+
x1
(+
t_3
(+
x1
(-
(+ t_1 (* x1 (- (* x1 (+ (* x1 -6.0) (+ t_1 (* x2 6.0)))) 4.0)))
6.0))))
(if (<= x1 9.6e+82)
(+ (* x2 -6.0) (- (* x2 (* x2 (+ (* -12.0 (/ x1 x2)) (* x1 8.0)))) x1))
(if (<= x1 4.4e+153)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 (/ (- (+ t_2 (* 2.0 x2)) x1) t_4))
(* t_4 (* 4.0 (* x1 (* x2 t_0)))))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 4.0 * t_0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -2.4e+99) {
tmp = x1 + (t_3 + (x1 + ((t_1 + (x1 * ((x1 * ((x1 * -6.0) + (t_1 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= 9.6e+82) {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
} else if (x1 <= 4.4e+153) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_4)) + (t_4 * (4.0 * (x1 * (x2 * t_0))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = 4.0d0 * t_0
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 * (x2 * (-2.0d0))
t_4 = (x1 * x1) + 1.0d0
if (x1 <= (-2.4d+99)) then
tmp = x1 + (t_3 + (x1 + ((t_1 + (x1 * ((x1 * ((x1 * (-6.0d0)) + (t_1 + (x2 * 6.0d0)))) - 4.0d0))) - 6.0d0)))
else if (x1 <= 9.6d+82) then
tmp = (x2 * (-6.0d0)) + ((x2 * (x2 * (((-12.0d0) * (x1 / x2)) + (x1 * 8.0d0)))) - x1)
else if (x1 <= 4.4d+153) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0d0 * x2)) - x1) / t_4)) + (t_4 * (4.0d0 * (x1 * (x2 * t_0))))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = 4.0 * t_0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 * (x2 * -2.0);
double t_4 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -2.4e+99) {
tmp = x1 + (t_3 + (x1 + ((t_1 + (x1 * ((x1 * ((x1 * -6.0) + (t_1 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= 9.6e+82) {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
} else if (x1 <= 4.4e+153) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_4)) + (t_4 * (4.0 * (x1 * (x2 * t_0))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = 4.0 * t_0 t_2 = x1 * (x1 * 3.0) t_3 = 3.0 * (x2 * -2.0) t_4 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -2.4e+99: tmp = x1 + (t_3 + (x1 + ((t_1 + (x1 * ((x1 * ((x1 * -6.0) + (t_1 + (x2 * 6.0)))) - 4.0))) - 6.0))) elif x1 <= 9.6e+82: tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1) elif x1 <= 4.4e+153: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_4)) + (t_4 * (4.0 * (x1 * (x2 * t_0)))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(4.0 * t_0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 * Float64(x2 * -2.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -2.4e+99) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(t_1 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) + Float64(t_1 + Float64(x2 * 6.0)))) - 4.0))) - 6.0)))); elseif (x1 <= 9.6e+82) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x2 * Float64(x2 * Float64(Float64(-12.0 * Float64(x1 / x2)) + Float64(x1 * 8.0)))) - x1)); elseif (x1 <= 4.4e+153) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_4)) + Float64(t_4 * Float64(4.0 * Float64(x1 * Float64(x2 * t_0))))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = 4.0 * t_0; t_2 = x1 * (x1 * 3.0); t_3 = 3.0 * (x2 * -2.0); t_4 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -2.4e+99) tmp = x1 + (t_3 + (x1 + ((t_1 + (x1 * ((x1 * ((x1 * -6.0) + (t_1 + (x2 * 6.0)))) - 4.0))) - 6.0))); elseif (x1 <= 9.6e+82) tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1); elseif (x1 <= 4.4e+153) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * (((t_2 + (2.0 * x2)) - x1) / t_4)) + (t_4 * (4.0 * (x1 * (x2 * t_0)))))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -2.4e+99], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(t$95$1 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] + N[(t$95$1 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.6e+82], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x2 * N[(x2 * N[(N[(-12.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * N[(4.0 * N[(x1 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := 4 \cdot t\_0\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 \cdot \left(x2 \cdot -2\right)\\
t_4 := x1 \cdot x1 + 1\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+99}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(\left(t\_1 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 + \left(t\_1 + x2 \cdot 6\right)\right) - 4\right)\right) - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9.6 \cdot 10^{+82}:\\
\;\;\;\;x2 \cdot -6 + \left(x2 \cdot \left(x2 \cdot \left(-12 \cdot \frac{x1}{x2} + x1 \cdot 8\right)\right) - x1\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_4} + t\_4 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot t\_0\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.4000000000000001e99Initial program 5.0%
Taylor expanded in x1 around 0 5.0%
*-commutative5.0%
Simplified5.0%
Taylor expanded in x1 around -inf 5.0%
Taylor expanded in x1 around 0 92.8%
if -2.4000000000000001e99 < x1 < 9.59999999999999992e82Initial program 99.3%
Simplified99.5%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x2 around 0 80.2%
Taylor expanded in x2 around inf 82.5%
if 9.59999999999999992e82 < x1 < 4.3999999999999999e153Initial program 100.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around 0 95.7%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification86.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (- (* 2.0 x2) 3.0))))
(if (<= x1 -2.7e+99)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(-
(+ t_0 (* x1 (- (* x1 (+ (* x1 -6.0) (+ t_0 (* x2 6.0)))) 4.0)))
6.0))))
(if (<= x1 4.4e+153)
(+ (* x2 -6.0) (- (* x2 (* x2 (+ (* -12.0 (/ x1 x2)) (* x1 8.0)))) x1))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -2.7e+99) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= 4.4e+153) {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 = 4.0d0 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-2.7d+99)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * (-6.0d0)) + (t_0 + (x2 * 6.0d0)))) - 4.0d0))) - 6.0d0)))
else if (x1 <= 4.4d+153) then
tmp = (x2 * (-6.0d0)) + ((x2 * (x2 * (((-12.0d0) * (x1 / x2)) + (x1 * 8.0d0)))) - x1)
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -2.7e+99) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0)));
} else if (x1 <= 4.4e+153) {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -2.7e+99: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))) elif x1 <= 4.4e+153: tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -2.7e+99) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(t_0 + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * -6.0) + Float64(t_0 + Float64(x2 * 6.0)))) - 4.0))) - 6.0)))); elseif (x1 <= 4.4e+153) tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x2 * Float64(x2 * Float64(Float64(-12.0 * Float64(x1 / x2)) + Float64(x1 * 8.0)))) - x1)); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -2.7e+99) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((t_0 + (x1 * ((x1 * ((x1 * -6.0) + (t_0 + (x2 * 6.0)))) - 4.0))) - 6.0))); elseif (x1 <= 4.4e+153) tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.7e+99], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(t$95$0 + N[(x1 * N[(N[(x1 * N[(N[(x1 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e+153], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x2 * N[(x2 * N[(N[(-12.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -2.7 \cdot 10^{+99}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(\left(t\_0 + x1 \cdot \left(x1 \cdot \left(x1 \cdot -6 + \left(t\_0 + x2 \cdot 6\right)\right) - 4\right)\right) - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + \left(x2 \cdot \left(x2 \cdot \left(-12 \cdot \frac{x1}{x2} + x1 \cdot 8\right)\right) - x1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.69999999999999989e99Initial program 5.0%
Taylor expanded in x1 around 0 5.0%
*-commutative5.0%
Simplified5.0%
Taylor expanded in x1 around -inf 5.0%
Taylor expanded in x1 around 0 92.8%
if -2.69999999999999989e99 < x1 < 4.3999999999999999e153Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 68.2%
Taylor expanded in x2 around 0 76.0%
Taylor expanded in x2 around inf 81.1%
if 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 90.9%
Taylor expanded in x2 around 0 100.0%
Final simplification84.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+125)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))
(if (<= x1 1e-66)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x1 9.0) (* -4.0 (* x2 (+ 3.0 (* x2 -2.0)))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+125) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else if (x1 <= 1e-66) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (-4.0 * (x2 * (3.0 + (x2 * -2.0)))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.5d+125)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else if (x1 <= 1d-66) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x1 * 9.0d0) + ((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+125) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else if (x1 <= 1e-66) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (-4.0 * (x2 * (3.0 + (x2 * -2.0)))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+125: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) elif x1 <= 1e-66: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (-4.0 * (x2 * (3.0 + (x2 * -2.0))))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+125) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); elseif (x1 <= 1e-66) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x1 * 9.0) + Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+125) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); elseif (x1 <= 1e-66) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x1 * 9.0) + (-4.0 * (x2 * (3.0 + (x2 * -2.0))))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+125], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e-66], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x1 * 9.0), $MachinePrecision] + N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+125}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq 10^{-66}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x1 \cdot 9 + -4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.49999999999999981e125Initial program 0.0%
Simplified12.5%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 88.5%
if -2.49999999999999981e125 < x1 < 9.9999999999999998e-67Initial program 95.2%
Simplified95.4%
Taylor expanded in x1 around 0 71.2%
Taylor expanded in x2 around 0 81.8%
if 9.9999999999999998e-67 < x1 Initial program 72.5%
Simplified70.2%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x2 around 0 68.2%
Final simplification78.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -4.6e+126) (not (<= x1 4.4e+153))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (- (* x2 (* x2 (+ (* -12.0 (/ x1 x2)) (* x1 8.0)))) x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.6e+126) || !(x1 <= 4.4e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-4.6d+126)) .or. (.not. (x1 <= 4.4d+153))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + ((x2 * (x2 * (((-12.0d0) * (x1 / x2)) + (x1 * 8.0d0)))) - x1)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.6e+126) || !(x1 <= 4.4e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.6e+126) or not (x1 <= 4.4e+153): tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.6e+126) || !(x1 <= 4.4e+153)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x2 * Float64(x2 * Float64(Float64(-12.0 * Float64(x1 / x2)) + Float64(x1 * 8.0)))) - x1)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.6e+126) || ~((x1 <= 4.4e+153))) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + ((x2 * (x2 * ((-12.0 * (x1 / x2)) + (x1 * 8.0)))) - x1); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.6e+126], N[Not[LessEqual[x1, 4.4e+153]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x2 * N[(x2 * N[(N[(-12.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+126} \lor \neg \left(x1 \leq 4.4 \cdot 10^{+153}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(x2 \cdot \left(x2 \cdot \left(-12 \cdot \frac{x1}{x2} + x1 \cdot 8\right)\right) - x1\right)\\
\end{array}
\end{array}
if x1 < -4.6000000000000001e126 or 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified7.4%
Taylor expanded in x1 around 0 74.3%
Taylor expanded in x2 around 0 93.2%
if -4.6000000000000001e126 < x1 < 4.3999999999999999e153Initial program 96.4%
Simplified96.6%
Taylor expanded in x1 around 0 66.0%
Taylor expanded in x2 around 0 73.5%
Taylor expanded in x2 around inf 78.4%
Final simplification81.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.9e+124) (not (<= x1 4.4e+153))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.9e+124) || !(x1 <= 4.4e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.9d+124)) .or. (.not. (x1 <= 4.4d+153))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.9e+124) || !(x1 <= 4.4e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.9e+124) or not (x1 <= 4.4e+153): tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.9e+124) || !(x1 <= 4.4e+153)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.9e+124) || ~((x1 <= 4.4e+153))) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.9e+124], N[Not[LessEqual[x1, 4.4e+153]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+124} \lor \neg \left(x1 \leq 4.4 \cdot 10^{+153}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\end{array}
\end{array}
if x1 < -2.90000000000000021e124 or 4.3999999999999999e153 < x1 Initial program 0.0%
Simplified7.4%
Taylor expanded in x1 around 0 74.3%
Taylor expanded in x2 around 0 93.2%
if -2.90000000000000021e124 < x1 < 4.3999999999999999e153Initial program 96.4%
Simplified96.6%
Taylor expanded in x1 around 0 66.0%
Taylor expanded in x2 around 0 73.5%
Final simplification77.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3e+124) (not (<= x1 4.2e+153))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3e+124) || !(x1 <= 4.2e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 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 <= (-3d+124)) .or. (.not. (x1 <= 4.2d+153))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3e+124) || !(x1 <= 4.2e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3e+124) or not (x1 <= 4.2e+153): tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3e+124) || !(x1 <= 4.2e+153)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3e+124) || ~((x1 <= 4.2e+153))) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3e+124], N[Not[LessEqual[x1, 4.2e+153]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3 \cdot 10^{+124} \lor \neg \left(x1 \leq 4.2 \cdot 10^{+153}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < -3e124 or 4.20000000000000033e153 < x1 Initial program 0.0%
Simplified7.4%
Taylor expanded in x1 around 0 74.3%
Taylor expanded in x2 around 0 93.2%
if -3e124 < x1 < 4.20000000000000033e153Initial program 96.4%
Simplified96.6%
Taylor expanded in x1 around 0 66.0%
Taylor expanded in x2 around 0 66.0%
Final simplification71.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -2.1e+124) (not (<= x1 4.2e+153))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))) (+ (* x2 -6.0) (- (* x2 (* 8.0 (* x1 x2))) x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.1e+124) || !(x1 <= 4.2e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + ((x2 * (8.0 * (x1 * x2))) - x1);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.1d+124)) .or. (.not. (x1 <= 4.2d+153))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
else
tmp = (x2 * (-6.0d0)) + ((x2 * (8.0d0 * (x1 * x2))) - x1)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.1e+124) || !(x1 <= 4.2e+153)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
} else {
tmp = (x2 * -6.0) + ((x2 * (8.0 * (x1 * x2))) - x1);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.1e+124) or not (x1 <= 4.2e+153): tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) else: tmp = (x2 * -6.0) + ((x2 * (8.0 * (x1 * x2))) - x1) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.1e+124) || !(x1 <= 4.2e+153)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(Float64(x2 * Float64(8.0 * Float64(x1 * x2))) - x1)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.1e+124) || ~((x1 <= 4.2e+153))) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); else tmp = (x2 * -6.0) + ((x2 * (8.0 * (x1 * x2))) - x1); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.1e+124], N[Not[LessEqual[x1, 4.2e+153]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(x2 * N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+124} \lor \neg \left(x1 \leq 4.2 \cdot 10^{+153}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + \left(x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right)\right) - x1\right)\\
\end{array}
\end{array}
if x1 < -2.10000000000000011e124 or 4.20000000000000033e153 < x1 Initial program 0.0%
Simplified7.4%
Taylor expanded in x1 around 0 74.3%
Taylor expanded in x2 around 0 93.2%
if -2.10000000000000011e124 < x1 < 4.20000000000000033e153Initial program 96.4%
Simplified96.6%
Taylor expanded in x1 around 0 66.0%
Taylor expanded in x2 around 0 73.5%
Taylor expanded in x2 around inf 73.3%
*-commutative73.3%
Simplified73.3%
Final simplification77.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.2e+141) (not (<= x2 2.9e+230))) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.2e+141) || !(x2 <= 2.9e+230)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.2d+141)) .or. (.not. (x2 <= 2.9d+230))) then
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.2e+141) || !(x2 <= 2.9e+230)) {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.2e+141) or not (x2 <= 2.9e+230): tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.2e+141) || !(x2 <= 2.9e+230)) tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.2e+141) || ~((x2 <= 2.9e+230))) tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.2e+141], N[Not[LessEqual[x2, 2.9e+230]], $MachinePrecision]], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.2 \cdot 10^{+141} \lor \neg \left(x2 \leq 2.9 \cdot 10^{+230}\right):\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x2 < -1.19999999999999999e141 or 2.8999999999999999e230 < x2 Initial program 87.5%
Simplified87.6%
Taylor expanded in x1 around 0 66.8%
Taylor expanded in x2 around 0 87.9%
Taylor expanded in x1 around inf 64.8%
if -1.19999999999999999e141 < x2 < 2.8999999999999999e230Initial program 73.4%
Simplified76.1%
Taylor expanded in x1 around 0 69.9%
Taylor expanded in x2 around 0 69.9%
Final simplification69.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 2.35e-63) (* x2 (- (- 6.0) (/ x1 x2))) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 2.35e-63) {
tmp = x2 * (-6.0 - (x1 / x2));
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 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 <= 2.35d-63) then
tmp = x2 * (-6.0d0 - (x1 / x2))
else
tmp = x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 2.35e-63) {
tmp = x2 * (-6.0 - (x1 / x2));
} else {
tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 2.35e-63: tmp = x2 * (-6.0 - (x1 / x2)) else: tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 2.35e-63) tmp = Float64(x2 * Float64(Float64(-6.0) - Float64(x1 / x2))); else tmp = Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 2.35e-63) tmp = x2 * (-6.0 - (x1 / x2)); else tmp = x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 2.35e-63], N[(x2 * N[((-6.0) - N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 2.35 \cdot 10^{-63}:\\
\;\;\;\;x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < 2.35e-63Initial program 77.9%
Simplified78.1%
Taylor expanded in x1 around 0 59.1%
Taylor expanded in x2 around 0 55.0%
neg-mul-155.0%
Simplified55.0%
Taylor expanded in x2 around -inf 61.9%
mul-1-neg61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
+-commutative61.9%
Simplified61.9%
if 2.35e-63 < x1 Initial program 72.1%
Simplified72.2%
Taylor expanded in x1 around 0 48.3%
Taylor expanded in x2 around 0 48.2%
Taylor expanded in x1 around inf 45.4%
Final simplification56.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.25e-214) (not (<= x2 1.25e-115))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.25e-214) || !(x2 <= 1.25e-115)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.25d-214)) .or. (.not. (x2 <= 1.25d-115))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.25e-214) || !(x2 <= 1.25e-115)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.25e-214) or not (x2 <= 1.25e-115): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.25e-214) || !(x2 <= 1.25e-115)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.25e-214) || ~((x2 <= 1.25e-115))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.25e-214], N[Not[LessEqual[x2, 1.25e-115]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.25 \cdot 10^{-214} \lor \neg \left(x2 \leq 1.25 \cdot 10^{-115}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -1.2499999999999999e-214 or 1.2500000000000001e-115 < x2 Initial program 76.2%
Simplified76.2%
Taylor expanded in x1 around 0 33.4%
if -1.2499999999999999e-214 < x2 < 1.2500000000000001e-115Initial program 75.8%
Simplified76.5%
Taylor expanded in x1 around 0 53.6%
Taylor expanded in x2 around 0 53.6%
neg-mul-153.6%
Simplified53.6%
Taylor expanded in x2 around 0 44.0%
neg-mul-144.0%
Simplified44.0%
Final simplification35.7%
(FPCore (x1 x2) :precision binary64 (* x2 (- (- 6.0) (/ x1 x2))))
double code(double x1, double x2) {
return x2 * (-6.0 - (x1 / x2));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0 - (x1 / x2))
end function
public static double code(double x1, double x2) {
return x2 * (-6.0 - (x1 / x2));
}
def code(x1, x2): return x2 * (-6.0 - (x1 / x2))
function code(x1, x2) return Float64(x2 * Float64(Float64(-6.0) - Float64(x1 / x2))) end
function tmp = code(x1, x2) tmp = x2 * (-6.0 - (x1 / x2)); end
code[x1_, x2_] := N[(x2 * N[((-6.0) - N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right)
\end{array}
Initial program 76.1%
Simplified76.3%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x2 around 0 41.2%
neg-mul-141.2%
Simplified41.2%
Taylor expanded in x2 around -inf 45.9%
mul-1-neg45.9%
*-commutative45.9%
distribute-rgt-neg-in45.9%
+-commutative45.9%
Simplified45.9%
Final simplification45.9%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 76.1%
Simplified76.3%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x2 around 0 41.2%
neg-mul-141.2%
Simplified41.2%
Taylor expanded in x2 around 0 41.2%
*-commutative41.2%
Simplified41.2%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 76.1%
Simplified76.3%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x2 around 0 41.2%
neg-mul-141.2%
Simplified41.2%
Taylor expanded in x2 around 0 14.8%
neg-mul-114.8%
Simplified14.8%
herbie shell --seed 2024186
(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))))))