
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 14.5%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+ x1 (+ (+ x1 (+ t_0 (+ t_4 (* 3.0 t_1)))) (* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))) tmp = 0 if (x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (6.0 * math.pow(x1, 4.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))); tmp = 0.0; if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (6.0 * (x1 ^ 4.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_4 + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 14.5%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5e+102)
(+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(if (<= x1 5e+153)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5d+102)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else if (x1 <= 5d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5e+102: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) elif x1 <= 5e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); elseif (x1 <= 5e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x2 around 0 100.0%
if -5e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5 (* (- t_4 3.0) (* (* x1 2.0) (+ 3.0 (/ -1.0 x1)))))
(t_6 (* 3.0 (* x2 -2.0))))
(if (<= x1 -5e+102)
(+ x1 t_2)
(if (<= x1 -160.0)
(+
x1
(+
(+ x1 (+ t_1 (+ (* t_3 t_4) (* t_0 (+ (* (* x1 x1) 6.0) t_5)))))
t_6))
(if (<= x1 9.5e+36)
(+
x1
(+
(* x2 -6.0)
(+ t_2 (* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0)))))))
(if (<= x1 5e+153)
(+
x1
(+
t_6
(+
x1
(+
t_1
(+
(* 3.0 t_3)
(* t_0 (+ (* (* x1 x1) (- (* t_4 4.0) 6.0)) t_5)))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = (t_4 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)));
double t_6 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + t_2;
} else if (x1 <= -160.0) {
tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * 6.0) + t_5))))) + t_6);
} else if (x1 <= 9.5e+36) {
tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (t_6 + (x1 + (t_1 + ((3.0 * t_3) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + t_5))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = (t_4 - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1)))
t_6 = 3.0d0 * (x2 * (-2.0d0))
if (x1 <= (-5d+102)) then
tmp = x1 + t_2
else if (x1 <= (-160.0d0)) then
tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * 6.0d0) + t_5))))) + t_6)
else if (x1 <= 9.5d+36) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_2 + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0))))))
else if (x1 <= 5d+153) then
tmp = x1 + (t_6 + (x1 + (t_1 + ((3.0d0 * t_3) + (t_0 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + t_5))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = (t_4 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1)));
double t_6 = 3.0 * (x2 * -2.0);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + t_2;
} else if (x1 <= -160.0) {
tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * 6.0) + t_5))))) + t_6);
} else if (x1 <= 9.5e+36) {
tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else if (x1 <= 5e+153) {
tmp = x1 + (t_6 + (x1 + (t_1 + ((3.0 * t_3) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + t_5))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = (t_4 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))) t_6 = 3.0 * (x2 * -2.0) tmp = 0 if x1 <= -5e+102: tmp = x1 + t_2 elif x1 <= -160.0: tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * 6.0) + t_5))))) + t_6) elif x1 <= 9.5e+36: tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))) elif x1 <= 5e+153: tmp = x1 + (t_6 + (x1 + (t_1 + ((3.0 * t_3) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + t_5)))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1)))) t_6 = Float64(3.0 * Float64(x2 * -2.0)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + t_2); elseif (x1 <= -160.0) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * 6.0) + t_5))))) + t_6)); elseif (x1 <= 9.5e+36) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_2 + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_1 + Float64(Float64(3.0 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + t_5))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = (t_4 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))); t_6 = 3.0 * (x2 * -2.0); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + t_2; elseif (x1 <= -160.0) tmp = x1 + ((x1 + (t_1 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * 6.0) + t_5))))) + t_6); elseif (x1 <= 9.5e+36) tmp = x1 + ((x2 * -6.0) + (t_2 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))); elseif (x1 <= 5e+153) tmp = x1 + (t_6 + (x1 + (t_1 + ((3.0 * t_3) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + t_5)))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, -160.0], N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e+36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$2 + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$1 + N[(N[(3.0 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\\
t_6 := 3 \cdot \left(x2 \cdot -2\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + t\_2\\
\mathbf{elif}\;x1 \leq -160:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_1 + \left(t\_3 \cdot t\_4 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + t\_5\right)\right)\right)\right) + t\_6\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+36}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_2 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_1 + \left(3 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right) + t\_5\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x2 around 0 100.0%
if -5e102 < x1 < -160Initial program 99.2%
Taylor expanded in x1 around inf 80.4%
Taylor expanded in x1 around 0 80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in x1 around inf 80.4%
if -160 < x1 < 9.49999999999999974e36Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 70.9%
Taylor expanded in x2 around 0 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in x2 around 0 96.6%
if 9.49999999999999974e36 < x1 < 5.00000000000000018e153Initial program 99.6%
Taylor expanded in x1 around inf 88.9%
Taylor expanded in x1 around 0 88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x1 around inf 88.9%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification95.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_3)
(*
t_2
(+
(* (* x1 x1) 6.0)
(* (- t_3 3.0) (* (* x1 2.0) (+ 3.0 (/ -1.0 x1)))))))))
(* 3.0 (* x2 -2.0))))))
(if (<= x1 -5e+102)
(+ x1 t_0)
(if (<= x1 -160.0)
t_4
(if (<= x1 9.5e+36)
(+
x1
(+
(* x2 -6.0)
(+ t_0 (* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0)))))))
(if (<= x1 5e+153)
t_4
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + t_0;
} else if (x1 <= -160.0) {
tmp = t_4;
} else if (x1 <= 9.5e+36) {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0d0) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * (3.0d0 + ((-1.0d0) / x1))))))))) + (3.0d0 * (x2 * (-2.0d0))))
if (x1 <= (-5d+102)) then
tmp = x1 + t_0
else if (x1 <= (-160.0d0)) then
tmp = t_4
else if (x1 <= 9.5d+36) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0))))))
else if (x1 <= 5d+153) then
tmp = t_4
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))) + (3.0 * (x2 * -2.0)));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + t_0;
} else if (x1 <= -160.0) {
tmp = t_4;
} else if (x1 <= 9.5e+36) {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))) + (3.0 * (x2 * -2.0))) tmp = 0 if x1 <= -5e+102: tmp = x1 + t_0 elif x1 <= -160.0: tmp = t_4 elif x1 <= 9.5e+36: tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))) elif x1 <= 5e+153: tmp = t_4 else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(3.0 + Float64(-1.0 / x1))))))))) + Float64(3.0 * Float64(x2 * -2.0)))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + t_0); elseif (x1 <= -160.0) tmp = t_4; elseif (x1 <= 9.5e+36) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0))))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * 6.0) + ((t_3 - 3.0) * ((x1 * 2.0) * (3.0 + (-1.0 / x1))))))))) + (3.0 * (x2 * -2.0))); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + t_0; elseif (x1 <= -160.0) tmp = t_4; elseif (x1 <= 9.5e+36) tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, -160.0], t$95$4, If[LessEqual[x1, 9.5e+36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$4, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + t\_0\\
\mathbf{elif}\;x1 \leq -160:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{+36}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x2 around 0 100.0%
if -5e102 < x1 < -160 or 9.49999999999999974e36 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 84.7%
Taylor expanded in x1 around 0 84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in x1 around inf 82.4%
if -160 < x1 < 9.49999999999999974e36Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 70.9%
Taylor expanded in x2 around 0 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in x2 around 0 96.6%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification95.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5e+102)
(+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(if (<= x1 5e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5d+102)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5e+102: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) elif x1 <= 5e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + 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] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + 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 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x2 around 0 100.0%
if -5e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 97.8%
Taylor expanded in x1 around inf 96.5%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
Final simplification97.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0))))
(if (<= x1 -2.5e+68)
(+ x1 (* x2 (- (/ t_0 x2) 6.0)))
(if (<= x1 4.6e+87)
(+
x1
(+
(* x2 -6.0)
(+ t_0 (* x2 (+ (* 8.0 (* x1 x2)) (* x1 (- (* x1 12.0) 12.0)))))))
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x2 * ((t_0 / x2) - 6.0));
} else if (x1 <= 4.6e+87) {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)
if (x1 <= (-2.5d+68)) then
tmp = x1 + (x2 * ((t_0 / x2) - 6.0d0))
else if (x1 <= 4.6d+87) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_0 + (x2 * ((8.0d0 * (x1 * x2)) + (x1 * ((x1 * 12.0d0) - 12.0d0))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0);
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x2 * ((t_0 / x2) - 6.0));
} else if (x1 <= 4.6e+87) {
tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0))))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0) tmp = 0 if x1 <= -2.5e+68: tmp = x1 + (x2 * ((t_0 / x2) - 6.0)) elif x1 <= 4.6e+87: tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) tmp = 0.0 if (x1 <= -2.5e+68) tmp = Float64(x1 + Float64(x2 * Float64(Float64(t_0 / x2) - 6.0))); elseif (x1 <= 4.6e+87) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_0 + Float64(x2 * Float64(Float64(8.0 * Float64(x1 * x2)) + Float64(x1 * Float64(Float64(x1 * 12.0) - 12.0))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0); tmp = 0.0; if (x1 <= -2.5e+68) tmp = x1 + (x2 * ((t_0 / x2) - 6.0)); elseif (x1 <= 4.6e+87) tmp = x1 + ((x2 * -6.0) + (t_0 + (x2 * ((8.0 * (x1 * x2)) + (x1 * ((x1 * 12.0) - 12.0)))))); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.5e+68], N[(x1 + N[(x2 * N[(N[(t$95$0 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.6e+87], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$0 + N[(x2 * N[(N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+68}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{t\_0}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.6 \cdot 10^{+87}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t\_0 + x2 \cdot \left(8 \cdot \left(x1 \cdot x2\right) + x1 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5000000000000002e68Initial program 14.3%
Simplified14.3%
Taylor expanded in x1 around 0 68.2%
Taylor expanded in x2 around 0 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x2 around inf 92.5%
if -2.5000000000000002e68 < x1 < 4.6000000000000003e87Initial program 99.3%
Simplified99.5%
Taylor expanded in x1 around 0 59.2%
Taylor expanded in x2 around 0 75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in x2 around 0 83.2%
if 4.6000000000000003e87 < x1 Initial program 26.1%
Taylor expanded in x1 around inf 26.1%
Taylor expanded in x1 around inf 26.1%
Taylor expanded in x1 around 0 93.9%
Final simplification86.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.2e+64)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 6.2e+88)
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+64) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 6.2e+88) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.2d+64)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 6.2d+88) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+64) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 6.2e+88) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.2e+64: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 6.2e+88: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.2e+64) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 6.2e+88) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.2e+64) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 6.2e+88) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.2e+64], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6.2e+88], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+64}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{+88}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\end{array}
\end{array}
if x1 < -2.20000000000000002e64Initial program 14.3%
Simplified14.3%
Taylor expanded in x1 around 0 68.2%
Taylor expanded in x2 around 0 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x2 around inf 92.5%
if -2.20000000000000002e64 < x1 < 6.2000000000000003e88Initial program 99.3%
Simplified99.5%
Taylor expanded in x1 around 0 74.7%
if 6.2000000000000003e88 < x1 Initial program 26.1%
Taylor expanded in x1 around inf 26.1%
Taylor expanded in x1 around inf 26.1%
Taylor expanded in x1 around 0 93.9%
Final simplification81.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+68)
(+ x1 (* x2 (- (/ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) x2) 6.0)))
(if (<= x1 1.62e+149)
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 1.62e+149) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.5d+68)) then
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) / x2) - 6.0d0))
else if (x1 <= 1.62d+149) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0));
} else if (x1 <= 1.62e+149) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+68: tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)) elif x1 <= 1.62e+149: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+68) tmp = Float64(x1 + Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) / x2) - 6.0))); elseif (x1 <= 1.62e+149) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+68) tmp = x1 + (x2 * (((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) / x2) - 6.0)); elseif (x1 <= 1.62e+149) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+68], N[(x1 + N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.62e+149], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+68}:\\
\;\;\;\;x1 + x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 1.62 \cdot 10^{+149}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -2.5000000000000002e68Initial program 14.3%
Simplified14.3%
Taylor expanded in x1 around 0 68.2%
Taylor expanded in x2 around 0 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x2 around inf 92.5%
if -2.5000000000000002e68 < x1 < 1.62e149Initial program 99.4%
Simplified99.5%
Taylor expanded in x1 around 0 72.7%
if 1.62e149 < x1 Initial program 5.6%
Simplified5.6%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 95.2%
Final simplification79.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+68)
(+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)))
(if (<= x1 1.62e+149)
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 1.62e+149) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.5d+68)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else if (x1 <= 1.62d+149) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+68) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else if (x1 <= 1.62e+149) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+68: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) elif x1 <= 1.62e+149: tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+68) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); elseif (x1 <= 1.62e+149) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+68) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); elseif (x1 <= 1.62e+149) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+68], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.62e+149], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+68}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{elif}\;x1 \leq 1.62 \cdot 10^{+149}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -2.5000000000000002e68Initial program 14.3%
Simplified14.3%
Taylor expanded in x1 around 0 68.2%
Taylor expanded in x2 around 0 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x2 around 0 87.0%
if -2.5000000000000002e68 < x1 < 1.62e149Initial program 99.4%
Simplified99.5%
Taylor expanded in x1 around 0 72.7%
if 1.62e149 < x1 Initial program 5.6%
Simplified5.6%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 95.2%
Final simplification78.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 9.2e+36)
(+ x1 (+ (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0)) (* x2 -6.0)))
(if (<= x1 1.9e+153)
(+ x1 (+ (* x2 -6.0) (* x1 (* x2 (- (* x1 12.0) 12.0)))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 9.2e+36) {
tmp = x1 + ((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.9e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 12.0) - 12.0))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 9.2d+36) then
tmp = x1 + ((x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0)) + (x2 * (-6.0d0)))
else if (x1 <= 1.9d+153) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (x2 * ((x1 * 12.0d0) - 12.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 9.2e+36) {
tmp = x1 + ((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) + (x2 * -6.0));
} else if (x1 <= 1.9e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 12.0) - 12.0))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 9.2e+36: tmp = x1 + ((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) + (x2 * -6.0)) elif x1 <= 1.9e+153: tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 12.0) - 12.0)))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 9.2e+36) tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0)) + Float64(x2 * -6.0))); elseif (x1 <= 1.9e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(x2 * Float64(Float64(x1 * 12.0) - 12.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 9.2e+36) tmp = x1 + ((x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) + (x2 * -6.0)); elseif (x1 <= 1.9e+153) tmp = x1 + ((x2 * -6.0) + (x1 * (x2 * ((x1 * 12.0) - 12.0)))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 9.2e+36], N[(x1 + N[(N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.9e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(x2 * N[(N[(x1 * 12.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 9.2 \cdot 10^{+36}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1.9 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot \left(x1 \cdot 12 - 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < 9.19999999999999986e36Initial program 78.2%
Simplified78.3%
Taylor expanded in x1 around 0 65.3%
Taylor expanded in x2 around 0 69.9%
*-commutative69.9%
Simplified69.9%
if 9.19999999999999986e36 < x1 < 1.89999999999999983e153Initial program 99.6%
Simplified99.6%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 22.6%
*-commutative22.6%
Simplified22.6%
Taylor expanded in x2 around 0 22.9%
Taylor expanded in x2 around inf 28.9%
if 1.89999999999999983e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 97.7%
Final simplification69.8%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.65e-8) (+ x1 (* x1 (- (* x1 (+ 9.0 (* x1 -19.0))) 2.0))) (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.65e-8) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.65d-8)) then
tmp = x1 + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) - 2.0d0))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.65e-8) {
tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.65e-8: tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.65e-8) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) - 2.0))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.65e-8) tmp = x1 + (x1 * ((x1 * (9.0 + (x1 * -19.0))) - 2.0)); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.65e-8], N[(x1 + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.65 \cdot 10^{-8}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) - 2\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1.64999999999999989e-8Initial program 38.8%
Simplified38.7%
Taylor expanded in x1 around 0 52.0%
Taylor expanded in x2 around 0 65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x2 around 0 65.5%
if -1.64999999999999989e-8 < x1 Initial program 81.4%
Simplified81.5%
Taylor expanded in x1 around 0 49.6%
Taylor expanded in x2 around 0 49.4%
*-commutative49.4%
Simplified49.4%
Taylor expanded in x1 around 0 68.3%
Final simplification67.5%
(FPCore (x1 x2) :precision binary64 (if (<= x2 1.1e+249) (* x2 (- (- 6.0) (/ x1 x2))) (* x1 (+ (* -6.0 (/ x2 x1)) -1.0))))
double code(double x1, double x2) {
double tmp;
if (x2 <= 1.1e+249) {
tmp = x2 * (-6.0 - (x1 / x2));
} else {
tmp = x1 * ((-6.0 * (x2 / x1)) + -1.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.1d+249) then
tmp = x2 * (-6.0d0 - (x1 / x2))
else
tmp = x1 * (((-6.0d0) * (x2 / x1)) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= 1.1e+249) {
tmp = x2 * (-6.0 - (x1 / x2));
} else {
tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= 1.1e+249: tmp = x2 * (-6.0 - (x1 / x2)) else: tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= 1.1e+249) tmp = Float64(x2 * Float64(Float64(-6.0) - Float64(x1 / x2))); else tmp = Float64(x1 * Float64(Float64(-6.0 * Float64(x2 / x1)) + -1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= 1.1e+249) tmp = x2 * (-6.0 - (x1 / x2)); else tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, 1.1e+249], N[(x2 * N[((-6.0) - N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(-6.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq 1.1 \cdot 10^{+249}:\\
\;\;\;\;x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-6 \cdot \frac{x2}{x1} + -1\right)\\
\end{array}
\end{array}
if x2 < 1.0999999999999999e249Initial program 69.7%
Simplified69.8%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x2 around 0 56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x1 around 0 40.1%
Taylor expanded in x2 around -inf 47.9%
mul-1-neg47.9%
*-commutative47.9%
distribute-rgt-neg-in47.9%
+-commutative47.9%
Simplified47.9%
if 1.0999999999999999e249 < x2 Initial program 72.2%
Simplified72.2%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 19.9%
*-commutative19.9%
Simplified19.9%
Taylor expanded in x1 around 0 3.3%
Taylor expanded in x1 around inf 33.4%
Final simplification46.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -7.6e-106) (not (<= x1 2.55e-141))) (- x1) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -7.6e-106) || !(x1 <= 2.55e-141)) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-7.6d-106)) .or. (.not. (x1 <= 2.55d-141))) then
tmp = -x1
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -7.6e-106) || !(x1 <= 2.55e-141)) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -7.6e-106) or not (x1 <= 2.55e-141): tmp = -x1 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -7.6e-106) || !(x1 <= 2.55e-141)) tmp = Float64(-x1); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -7.6e-106) || ~((x1 <= 2.55e-141))) tmp = -x1; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -7.6e-106], N[Not[LessEqual[x1, 2.55e-141]], $MachinePrecision]], (-x1), N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -7.6 \cdot 10^{-106} \lor \neg \left(x1 \leq 2.55 \cdot 10^{-141}\right):\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -7.5999999999999999e-106 or 2.54999999999999989e-141 < x1 Initial program 58.9%
Simplified59.0%
Taylor expanded in x1 around 0 39.0%
Taylor expanded in x2 around 0 40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in x1 around 0 18.0%
Taylor expanded in x2 around 0 14.8%
neg-mul-114.8%
Simplified14.8%
if -7.5999999999999999e-106 < x1 < 2.54999999999999989e-141Initial program 99.6%
Simplified99.7%
Taylor expanded in x1 around 0 78.0%
*-commutative78.0%
Simplified78.0%
Final simplification31.8%
(FPCore (x1 x2) :precision binary64 (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))
double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
def code(x1, x2): return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0))
function code(x1, x2) return Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)
\end{array}
Initial program 69.9%
Simplified70.0%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x2 around 0 53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in x1 around 0 63.3%
Final simplification63.3%
(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 69.9%
Simplified70.0%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x2 around 0 53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in x1 around 0 37.5%
Taylor expanded in x2 around -inf 44.7%
mul-1-neg44.7%
*-commutative44.7%
distribute-rgt-neg-in44.7%
+-commutative44.7%
Simplified44.7%
Final simplification44.7%
(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 69.9%
Simplified70.0%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x2 around 0 53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in x1 around 0 37.5%
Final simplification37.5%
(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 69.9%
Simplified70.0%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x2 around 0 53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in x1 around 0 37.5%
Taylor expanded in x2 around 0 15.0%
neg-mul-115.0%
Simplified15.0%
herbie shell --seed 2024125
(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))))))