
(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 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_2 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_1 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_4 4.0 -6.0)) (* (* x1 (* 2.0 t_4)) (+ t_4 -3.0)))
(fma t_1 t_4 (pow x1 3.0))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_0 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_2 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_4, 4.0, -6.0)), ((x1 * (2.0 * t_4)) * (t_4 + -3.0))), fma(t_1, t_4, pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_2 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_1 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_4, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_4)) * Float64(t_4 + -3.0))), fma(t_1, t_4, (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $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$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$1 - 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$4 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$4), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4 + 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 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(\left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_2 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_1 - \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\_4, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_4\right)\right) \cdot \left(t\_4 + -3\right)\right), \mathsf{fma}\left(t\_1, t\_4, {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 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5 (* (* t_4 (* x1 2.0)) (- t_4 3.0)))
(t_6 (* t_1 t_4)))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))) t_6) t_0))
t_3))
INFINITY)
(+
x1
(+
t_3
(+
x1
(+
t_0
(+
t_6
(*
t_2
(+
t_5
(*
(* x1 x1)
(-
(* 4.0 (/ (- (+ (* 2.0 x2) (* 3.0 (pow x1 2.0))) x1) t_2))
6.0)))))))))
(* 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0);
double t_6 = t_1 * t_4;
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * pow(x1, 2.0))) - x1) / t_2)) - 6.0))))))));
} else {
tmp = 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0);
double t_6 = t_1 * t_4;
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Double.POSITIVE_INFINITY) {
tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * Math.pow(x1, 2.0))) - x1) / t_2)) - 6.0))))))));
} else {
tmp = 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0) t_6 = t_1 * t_4 tmp = 0 if (x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= math.inf: tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * math.pow(x1, 2.0))) - x1) / t_2)) - 6.0)))))))) else: tmp = 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(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) t_6 = Float64(t_1 * t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(t_6 + Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(Float64(2.0 * x2) + Float64(3.0 * (x1 ^ 2.0))) - x1) / t_2)) - 6.0))))))))); else tmp = 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 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0); t_6 = t_1 * t_4; tmp = 0.0; if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Inf) tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 + (t_2 * (t_5 + ((x1 * x1) * ((4.0 * ((((2.0 * x2) + (3.0 * (x1 ^ 2.0))) - x1) / t_2)) - 6.0)))))))); else tmp = 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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(t$95$6 + N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $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 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := \left(t\_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_4 - 3\right)\\
t_6 := t\_1 \cdot t\_4\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_6\right) + t\_0\right)\right) + t\_3\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_0 + \left(t\_6 + t\_2 \cdot \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(2 \cdot x2 + 3 \cdot {x1}^{2}\right) - x1}{t\_2} - 6\right)\right)\right)\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%
Taylor expanded in x1 around 0 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) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY) t_3 (* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
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) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
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) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) 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(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) 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) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); 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[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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$1 * t$95$2), $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$0), $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 x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\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) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -5e+102) (not (<= x1 1.2e+53)))
(* 6.0 (pow x1 4.0))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_1))))
(+ (* x2 -6.0) (* x1 -3.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 1.2e+53)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))) + ((x2 * -6.0) + (x1 * -3.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-5d+102)) .or. (.not. (x1 <= 1.2d+53))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))) + ((x2 * (-6.0d0)) + (x1 * (-3.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 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5e+102) || !(x1 <= 1.2e+53)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))) + ((x2 * -6.0) + (x1 * -3.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -5e+102) or not (x1 <= 1.2e+53): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))) + ((x2 * -6.0) + (x1 * -3.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -5e+102) || !(x1 <= 1.2e+53)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))) + Float64(Float64(x2 * -6.0) + Float64(x1 * -3.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -5e+102) || ~((x1 <= 1.2e+53))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))) + ((x2 * -6.0) + (x1 * -3.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 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+102], N[Not[LessEqual[x1, 1.2e+53]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $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$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.2 \cdot 10^{+53}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right) + \left(x2 \cdot -6 + x1 \cdot -3\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102 or 1.2e53 < x1 Initial program 12.2%
Simplified12.2%
Taylor expanded in x1 around inf 100.0%
if -5e102 < x1 < 1.2e53Initial program 99.3%
Taylor expanded in x1 around inf 97.1%
Taylor expanded in x1 around 0 99.2%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1))
(t_4
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* 3.0 t_2))))
9.0))))
(if (<= x1 -5.8e+102)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 -5.5e-6)
t_4
(if (<= x1 0.034)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.35e+154)
t_4
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + 9.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -5.5e-6) {
tmp = t_4;
} else if (x1 <= 0.034) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_2)))) + 9.0d0)
if (x1 <= (-5.8d+102)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= (-5.5d-6)) then
tmp = t_4
else if (x1 <= 0.034d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + 9.0);
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -5.5e-6) {
tmp = t_4;
} else if (x1 <= 0.034) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1 t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + 9.0) tmp = 0 if x1 <= -5.8e+102: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= -5.5e-6: tmp = t_4 elif x1 <= 0.034: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.35e+154: tmp = t_4 else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(3.0 * t_2)))) + 9.0)) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= -5.5e-6) tmp = t_4; elseif (x1 <= 0.034) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1; t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + 9.0); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= -5.5e-6) tmp = t_4; elseif (x1 <= 0.034) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5.5e-6], t$95$4, If[LessEqual[x1, 0.034], 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.35e+154], t$95$4, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_1}\\
t_4 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + 3 \cdot t\_2\right)\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-6}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 0.034:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 34.1%
Taylor expanded in x1 around inf 95.1%
if -5.8000000000000005e102 < x1 < -5.4999999999999999e-6 or 0.034000000000000002 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 95.0%
Taylor expanded in x1 around inf 94.9%
if -5.4999999999999999e-6 < x1 < 0.034000000000000002Initial program 99.4%
Simplified91.3%
Taylor expanded in x1 around 0 89.8%
fma-define90.0%
*-commutative90.0%
fmm-def90.0%
metadata-eval90.0%
cancel-sign-sub-inv90.0%
cancel-sign-sub-inv90.0%
metadata-eval90.0%
*-commutative90.0%
metadata-eval90.0%
Simplified90.0%
Taylor expanded in x2 around 0 98.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification94.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5e+102)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* 3.0 t_2))))
(+ (* x2 -6.0) (* x1 -3.0))))
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0)))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + ((x2 * -6.0) + (x1 * -3.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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) :: tmp
t_0 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5d+102)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_2)))) + ((x2 * (-6.0d0)) + (x1 * (-3.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + ((x2 * -6.0) + (x1 * -3.0)));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5e+102: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + ((x2 * -6.0) + (x1 * -3.0))) else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(3.0 * t_2)))) + Float64(Float64(x2 * -6.0) + Float64(x1 * -3.0)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (3.0 * t_2)))) + ((x2 * -6.0) + (x1 * -3.0))); else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + 3 \cdot t\_2\right)\right)\right) + \left(x2 \cdot -6 + x1 \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 34.1%
Taylor expanded in x1 around inf 95.1%
if -5e102 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 97.3%
Taylor expanded in x1 around 0 99.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification95.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (+ (* x2 6.0) (* x2 8.0)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5e+102)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_2) 6.0))))) 9.0))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0))))))))
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_2 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.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 = (x2 * 6.0) + (x2 * 8.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_2) - 6.0))))) + 9.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_2 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5d+102)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_2) - 6.0d0))))) + 9.0d0)
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_2 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.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 = (x2 * 6.0) + (x2 * 8.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_2) - 6.0))))) + 9.0);
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_2 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (x2 * 6.0) + (x2 * 8.0) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5e+102: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_2) - 6.0))))) + 9.0) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_2 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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(x2 * 6.0) + Float64(x2 * 8.0)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_2) - 6.0))))) + 9.0)); elseif (x1 <= 1.35e+154) 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(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_2 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.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 = (x2 * 6.0) + (x2 * 8.0); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_2) - 6.0))))) + 9.0); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_2 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 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[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $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 := x2 \cdot 6 + x2 \cdot 8\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_2\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;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(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_2 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 34.1%
Taylor expanded in x1 around inf 95.1%
if -5e102 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 97.3%
Taylor expanded in x1 around inf 95.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification92.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_2
(+
(* (* x1 x1) (- (* (/ (- (+ t_1 (* 2.0 x2)) x1) t_2) 4.0) 6.0))
(* x1 2.0))))))))))
(if (<= x1 -5e+102)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 -1000000.0)
t_3
(if (<= x1 255000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.35e+154)
t_3
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -1000000.0) {
tmp = t_3;
} else if (x1 <= 255000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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) :: tmp
t_0 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0d0 * x2)) - x1) / t_2) * 4.0d0) - 6.0d0)) + (x1 * 2.0d0)))))))
if (x1 <= (-5d+102)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= (-1000000.0d0)) then
tmp = t_3
else if (x1 <= 255000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -1000000.0) {
tmp = t_3;
} else if (x1 <= 255000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (x1 * 2.0))))))) tmp = 0 if x1 <= -5e+102: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= -1000000.0: tmp = t_3 elif x1 <= 255000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.35e+154: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + Float64(x1 * 2.0)))))))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= -1000000.0) tmp = t_3; elseif (x1 <= 255000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_2 * (((x1 * x1) * (((((t_1 + (2.0 * x2)) - x1) / t_2) * 4.0) - 6.0)) + (x1 * 2.0))))))); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= -1000000.0) tmp = t_3; elseif (x1 <= 255000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.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[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1000000.0], t$95$3, If[LessEqual[x1, 255000.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, 1.35e+154], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_1 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2} \cdot 4 - 6\right) + x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq -1000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 255000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 34.1%
Taylor expanded in x1 around inf 95.1%
if -5e102 < x1 < -1e6 or 255000 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 81.6%
Taylor expanded in x1 around inf 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x1 around inf 81.3%
if -1e6 < x1 < 255000Initial program 99.3%
Simplified91.7%
Taylor expanded in x1 around 0 87.7%
fma-define87.8%
*-commutative87.8%
fmm-def87.8%
metadata-eval87.8%
cancel-sign-sub-inv87.8%
cancel-sign-sub-inv87.8%
metadata-eval87.8%
*-commutative87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in x2 around 0 95.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification91.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(* t_2 (+ (* (* x1 x1) 6.0) (* x1 2.0))))))))))
(if (<= x1 -4e+102)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 -1620000.0)
t_3
(if (<= x1 150000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.35e+154)
t_3
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (((x1 * x1) * 6.0) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -4e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -1620000.0) {
tmp = t_3;
} else if (x1 <= 150000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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) :: tmp
t_0 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0d0 * x2)) - x1) / t_2)) + (t_2 * (((x1 * x1) * 6.0d0) + (x1 * 2.0d0)))))))
if (x1 <= (-4d+102)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= (-1620000.0d0)) then
tmp = t_3
else if (x1 <= 150000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (((x1 * x1) * 6.0) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -4e+102) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -1620000.0) {
tmp = t_3;
} else if (x1 <= 150000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (((x1 * x1) * 6.0) + (x1 * 2.0))))))) tmp = 0 if x1 <= -4e+102: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= -1620000.0: tmp = t_3 elif x1 <= 150000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.35e+154: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2)) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(x1 * 2.0)))))))) tmp = 0.0 if (x1 <= -4e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= -1620000.0) tmp = t_3; elseif (x1 <= 150000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_2)) + (t_2 * (((x1 * x1) * 6.0) + (x1 * 2.0))))))); tmp = 0.0; if (x1 <= -4e+102) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= -1620000.0) tmp = t_3; elseif (x1 <= 150000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.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[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4e+102], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1620000.0], t$95$3, If[LessEqual[x1, 150000.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, 1.35e+154], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2} + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq -1620000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 150000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -3.99999999999999991e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 34.1%
Taylor expanded in x1 around inf 95.1%
if -3.99999999999999991e102 < x1 < -1.62e6 or 1.5e5 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 81.6%
Taylor expanded in x1 around inf 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x1 around inf 78.4%
if -1.62e6 < x1 < 1.5e5Initial program 99.3%
Simplified91.7%
Taylor expanded in x1 around 0 87.7%
fma-define87.8%
*-commutative87.8%
fmm-def87.8%
metadata-eval87.8%
cancel-sign-sub-inv87.8%
cancel-sign-sub-inv87.8%
metadata-eval87.8%
*-commutative87.8%
metadata-eval87.8%
Simplified87.8%
Taylor expanded in x2 around 0 95.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification90.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0)))
(t_1 (- 3.0 (* 2.0 x2)))
(t_2
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 -7.5e+93)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 -6000000.0)
(+
x1
(+
t_2
(+
x1
(*
x1
(+
2.0
(*
x1
(-
(+
(* x2 6.0)
(+
(* x2 8.0)
(*
x1
(-
(* x1 (- (+ (* 3.0 t_1) (+ (* x2 8.0) (* 4.0 t_1))) 6.0))
4.0))))
6.0)))))))
(if (<= x1 2.7e+102)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.35e+154)
(+ x1 (+ t_2 (+ x1 (+ (* x1 (* x1 x1)) (* x1 2.0)))))
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = 3.0 - (2.0 * x2);
double t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -7.5e+93) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -6000000.0) {
tmp = x1 + (t_2 + (x1 + (x1 * (2.0 + (x1 * (((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((x1 * (((3.0 * t_1) + ((x2 * 8.0) + (4.0 * t_1))) - 6.0)) - 4.0)))) - 6.0))))));
} else if (x1 <= 2.7e+102) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.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 = (x2 * 6.0d0) + (x2 * 8.0d0)
t_1 = 3.0d0 - (2.0d0 * x2)
t_2 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
if (x1 <= (-7.5d+93)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= (-6000000.0d0)) then
tmp = x1 + (t_2 + (x1 + (x1 * (2.0d0 + (x1 * (((x2 * 6.0d0) + ((x2 * 8.0d0) + (x1 * ((x1 * (((3.0d0 * t_1) + ((x2 * 8.0d0) + (4.0d0 * t_1))) - 6.0d0)) - 4.0d0)))) - 6.0d0))))))
else if (x1 <= 2.7d+102) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double t_1 = 3.0 - (2.0 * x2);
double t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -7.5e+93) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= -6000000.0) {
tmp = x1 + (t_2 + (x1 + (x1 * (2.0 + (x1 * (((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((x1 * (((3.0 * t_1) + ((x2 * 8.0) + (4.0 * t_1))) - 6.0)) - 4.0)))) - 6.0))))));
} else if (x1 <= 2.7e+102) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) t_1 = 3.0 - (2.0 * x2) t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) tmp = 0 if x1 <= -7.5e+93: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= -6000000.0: tmp = x1 + (t_2 + (x1 + (x1 * (2.0 + (x1 * (((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((x1 * (((3.0 * t_1) + ((x2 * 8.0) + (4.0 * t_1))) - 6.0)) - 4.0)))) - 6.0)))))) elif x1 <= 2.7e+102: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.35e+154: tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0)))) else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) t_1 = Float64(3.0 - Float64(2.0 * x2)) t_2 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) tmp = 0.0 if (x1 <= -7.5e+93) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= -6000000.0) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x2 * 6.0) + Float64(Float64(x2 * 8.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(Float64(3.0 * t_1) + Float64(Float64(x2 * 8.0) + Float64(4.0 * t_1))) - 6.0)) - 4.0)))) - 6.0))))))); elseif (x1 <= 2.7e+102) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(x1 * 2.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); t_1 = 3.0 - (2.0 * x2); t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); tmp = 0.0; if (x1 <= -7.5e+93) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= -6000000.0) tmp = x1 + (t_2 + (x1 + (x1 * (2.0 + (x1 * (((x2 * 6.0) + ((x2 * 8.0) + (x1 * ((x1 * (((3.0 * t_1) + ((x2 * 8.0) + (4.0 * t_1))) - 6.0)) - 4.0)))) - 6.0)))))); elseif (x1 <= 2.7e+102) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.35e+154) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0)))); else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.5e+93], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6000000.0], N[(x1 + N[(t$95$2 + N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x2 * 6.0), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(N[(x2 * 8.0), $MachinePrecision] + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.7e+102], 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.35e+154], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
t_1 := 3 - 2 \cdot x2\\
t_2 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -7.5 \cdot 10^{+93}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq -6000000:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x2 \cdot 6 + \left(x2 \cdot 8 + x1 \cdot \left(x1 \cdot \left(\left(3 \cdot t\_1 + \left(x2 \cdot 8 + 4 \cdot t\_1\right)\right) - 6\right) - 4\right)\right)\right) - 6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + x1 \cdot 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -7.5000000000000002e93Initial program 4.7%
Taylor expanded in x1 around 0 4.7%
Taylor expanded in x1 around inf 4.7%
*-commutative4.7%
Simplified4.7%
Taylor expanded in x1 around 0 35.1%
Taylor expanded in x1 around inf 93.2%
if -7.5000000000000002e93 < x1 < -6e6Initial program 99.4%
Taylor expanded in x1 around 0 70.1%
Taylor expanded in x1 around inf 72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in x1 around 0 47.4%
if -6e6 < x1 < 2.7000000000000001e102Initial program 99.3%
Simplified91.5%
Taylor expanded in x1 around 0 84.6%
fma-define84.7%
*-commutative84.7%
fmm-def84.7%
metadata-eval84.7%
cancel-sign-sub-inv84.7%
cancel-sign-sub-inv84.7%
metadata-eval84.7%
*-commutative84.7%
metadata-eval84.7%
Simplified84.7%
Taylor expanded in x2 around 0 92.1%
if 2.7000000000000001e102 < x1 < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x1 around 0 100.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification87.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x2 6.0) (* x2 8.0))))
(if (<= x1 -6e+80)
(+ x1 (+ (+ x1 (* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) t_0) 6.0))))) 9.0))
(if (<= x1 5.5e+102)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 1.35e+154)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) (* x1 2.0)))))
(+
(* x2 -6.0)
(*
x1
(+
(+
(* -4.0 (* x2 (+ 3.0 (* x2 -2.0))))
(*
x1
(-
(+
(* 2.0 (+ 3.0 (* x2 -4.0)))
(+ t_0 (* 3.0 (- 3.0 (* x2 -2.0)))))
6.0)))
-1.0))))))))
double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double tmp;
if (x1 <= -6e+80) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= 5.5e+102) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = (x2 * 6.0d0) + (x2 * 8.0d0)
if (x1 <= (-6d+80)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + t_0) - 6.0d0))))) + 9.0d0)
else if (x1 <= 5.5d+102) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (x1 * (((2.0d0 * (3.0d0 + (x2 * (-4.0d0)))) + (t_0 + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 6.0d0))) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x2 * 6.0) + (x2 * 8.0);
double tmp;
if (x1 <= -6e+80) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0);
} else if (x1 <= 5.5e+102) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x2 * 6.0) + (x2 * 8.0) tmp = 0 if x1 <= -6e+80: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0) elif x1 <= 5.5e+102: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0)))) else: tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0)) tmp = 0.0 if (x1 <= -6e+80) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + t_0) - 6.0))))) + 9.0)); elseif (x1 <= 5.5e+102) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(x1 * 2.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(Float64(2.0 * Float64(3.0 + Float64(x2 * -4.0))) + Float64(t_0 + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 6.0))) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x2 * 6.0) + (x2 * 8.0); tmp = 0.0; if (x1 <= -6e+80) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + t_0) - 6.0))))) + 9.0); elseif (x1 <= 5.5e+102) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x1 * 2.0)))); else tmp = (x2 * -6.0) + (x1 * (((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + (x1 * (((2.0 * (3.0 + (x2 * -4.0))) + (t_0 + (3.0 * (3.0 - (x2 * -2.0))))) - 6.0))) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6e+80], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + t$95$0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.5e+102], 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.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(N[(2.0 * N[(3.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot 6 + x2 \cdot 8\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+80}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + t\_0\right) - 6\right)\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + x1 \cdot 2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + x1 \cdot \left(\left(2 \cdot \left(3 + x2 \cdot -4\right) + \left(t\_0 + 3 \cdot \left(3 - x2 \cdot -2\right)\right)\right) - 6\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5.99999999999999974e80Initial program 14.6%
Taylor expanded in x1 around 0 12.5%
Taylor expanded in x1 around inf 14.6%
*-commutative14.6%
Simplified14.6%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around inf 84.1%
if -5.99999999999999974e80 < x1 < 5.49999999999999981e102Initial program 99.3%
Simplified91.3%
Taylor expanded in x1 around 0 80.5%
fma-define80.6%
*-commutative80.6%
fmm-def80.6%
metadata-eval80.6%
cancel-sign-sub-inv80.6%
cancel-sign-sub-inv80.6%
metadata-eval80.6%
*-commutative80.6%
metadata-eval80.6%
Simplified80.6%
Taylor expanded in x2 around 0 87.6%
if 5.49999999999999981e102 < x1 < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x1 around 0 100.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.2%
Final simplification85.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -8.2e+80)
(+
x1
(+
(+
x1
(* x1 (+ 2.0 (* x1 (- (+ (* x1 -4.0) (+ (* x2 6.0) (* x2 8.0))) 6.0)))))
9.0))
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -8.2e+80) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + ((x2 * 6.0) + (x2 * 8.0))) - 6.0))))) + 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 <= (-8.2d+80)) then
tmp = x1 + ((x1 + (x1 * (2.0d0 + (x1 * (((x1 * (-4.0d0)) + ((x2 * 6.0d0) + (x2 * 8.0d0))) - 6.0d0))))) + 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 <= -8.2e+80) {
tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + ((x2 * 6.0) + (x2 * 8.0))) - 6.0))))) + 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 <= -8.2e+80: tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + ((x2 * 6.0) + (x2 * 8.0))) - 6.0))))) + 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 <= -8.2e+80) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(Float64(Float64(x1 * -4.0) + Float64(Float64(x2 * 6.0) + Float64(x2 * 8.0))) - 6.0))))) + 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 <= -8.2e+80) tmp = x1 + ((x1 + (x1 * (2.0 + (x1 * (((x1 * -4.0) + ((x2 * 6.0) + (x2 * 8.0))) - 6.0))))) + 9.0); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -8.2e+80], N[(x1 + N[(N[(x1 + N[(x1 * N[(2.0 + N[(x1 * N[(N[(N[(x1 * -4.0), $MachinePrecision] + N[(N[(x2 * 6.0), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $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 -8.2 \cdot 10^{+80}:\\
\;\;\;\;x1 + \left(\left(x1 + x1 \cdot \left(2 + x1 \cdot \left(\left(x1 \cdot -4 + \left(x2 \cdot 6 + x2 \cdot 8\right)\right) - 6\right)\right)\right) + 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 < -8.20000000000000003e80Initial program 14.6%
Taylor expanded in x1 around 0 12.5%
Taylor expanded in x1 around inf 14.6%
*-commutative14.6%
Simplified14.6%
Taylor expanded in x1 around 0 32.0%
Taylor expanded in x1 around inf 84.1%
if -8.20000000000000003e80 < x1 Initial program 84.5%
Simplified78.0%
Taylor expanded in x1 around 0 74.6%
fma-define74.7%
*-commutative74.7%
fmm-def74.7%
metadata-eval74.7%
cancel-sign-sub-inv74.7%
cancel-sign-sub-inv74.7%
metadata-eval74.7%
*-commutative74.7%
metadata-eval74.7%
Simplified74.7%
Taylor expanded in x2 around 0 80.4%
Final simplification81.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -5.4e+81) (and (not (<= x1 -4.2e-120)) (<= x1 1.02e-46))) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (* x1 (+ (* -4.0 (* x2 (+ 3.0 (* x2 -2.0)))) -1.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.4e+81) || (!(x1 <= -4.2e-120) && (x1 <= 1.02e-46))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * ((-4.0 * (x2 * (3.0 + (x2 * -2.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 <= (-5.4d+81)) .or. (.not. (x1 <= (-4.2d-120))) .and. (x1 <= 1.02d-46)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else
tmp = x1 * (((-4.0d0) * (x2 * (3.0d0 + (x2 * (-2.0d0))))) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -5.4e+81) || (!(x1 <= -4.2e-120) && (x1 <= 1.02e-46))) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = x1 * ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + -1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -5.4e+81) or (not (x1 <= -4.2e-120) and (x1 <= 1.02e-46)): tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = x1 * ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + -1.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -5.4e+81) || (!(x1 <= -4.2e-120) && (x1 <= 1.02e-46))) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); else tmp = Float64(x1 * Float64(Float64(-4.0 * Float64(x2 * Float64(3.0 + Float64(x2 * -2.0)))) + -1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -5.4e+81) || (~((x1 <= -4.2e-120)) && (x1 <= 1.02e-46))) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = x1 * ((-4.0 * (x2 * (3.0 + (x2 * -2.0)))) + -1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -5.4e+81], And[N[Not[LessEqual[x1, -4.2e-120]], $MachinePrecision], LessEqual[x1, 1.02e-46]]], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(N[(-4.0 * N[(x2 * N[(3.0 + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.4 \cdot 10^{+81} \lor \neg \left(x1 \leq -4.2 \cdot 10^{-120}\right) \land x1 \leq 1.02 \cdot 10^{-46}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(-4 \cdot \left(x2 \cdot \left(3 + x2 \cdot -2\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -5.3999999999999999e81 or -4.2000000000000001e-120 < x1 < 1.02e-46Initial program 70.6%
Simplified73.5%
Taylor expanded in x1 around 0 58.6%
fma-define58.7%
*-commutative58.7%
fmm-def58.7%
metadata-eval58.7%
cancel-sign-sub-inv58.7%
cancel-sign-sub-inv58.7%
metadata-eval58.7%
*-commutative58.7%
metadata-eval58.7%
Simplified58.7%
Taylor expanded in x2 around 0 62.5%
if -5.3999999999999999e81 < x1 < -4.2000000000000001e-120 or 1.02e-46 < x1 Initial program 72.4%
Simplified70.2%
Taylor expanded in x1 around 0 63.9%
fma-define63.9%
*-commutative63.9%
fmm-def63.9%
metadata-eval63.9%
cancel-sign-sub-inv63.9%
cancel-sign-sub-inv63.9%
metadata-eval63.9%
*-commutative63.9%
metadata-eval63.9%
Simplified63.9%
Taylor expanded in x1 around inf 59.1%
Final simplification61.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.55e+81) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.55e+81) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.55d+81)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.55e+81) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.55e+81: tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.55e+81) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.55e+81) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.55e+81], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.55 \cdot 10^{+81}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.55e81Initial program 14.6%
Simplified45.8%
Taylor expanded in x1 around 0 1.9%
fma-define1.9%
*-commutative1.9%
fmm-def1.9%
metadata-eval1.9%
cancel-sign-sub-inv1.9%
cancel-sign-sub-inv1.9%
metadata-eval1.9%
*-commutative1.9%
metadata-eval1.9%
Simplified1.9%
Taylor expanded in x2 around 0 31.7%
if -1.55e81 < x1 Initial program 84.5%
Simplified84.8%
Taylor expanded in x1 around 0 74.6%
Final simplification66.5%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -5e+81) (- (* x2 (- (* x1 -12.0) 6.0)) x1) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -5e+81) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} 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 <= (-5d+81)) then
tmp = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
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 <= -5e+81) {
tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1;
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -5e+81: tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1 else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -5e+81) tmp = Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1); 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 <= -5e+81) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -5e+81], N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $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 -5 \cdot 10^{+81}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right) - x1\\
\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 < -4.9999999999999998e81Initial program 14.6%
Simplified45.8%
Taylor expanded in x1 around 0 1.9%
fma-define1.9%
*-commutative1.9%
fmm-def1.9%
metadata-eval1.9%
cancel-sign-sub-inv1.9%
cancel-sign-sub-inv1.9%
metadata-eval1.9%
*-commutative1.9%
metadata-eval1.9%
Simplified1.9%
Taylor expanded in x2 around 0 31.7%
if -4.9999999999999998e81 < x1 Initial program 84.5%
Simplified78.0%
Taylor expanded in x1 around 0 74.6%
fma-define74.7%
*-commutative74.7%
fmm-def74.7%
metadata-eval74.7%
cancel-sign-sub-inv74.7%
cancel-sign-sub-inv74.7%
metadata-eval74.7%
*-commutative74.7%
metadata-eval74.7%
Simplified74.7%
Taylor expanded in x2 around 0 80.4%
Final simplification71.2%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -6.5e-167) (* x2 -6.0) (if (<= x2 5.4e-182) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -6.5e-167) {
tmp = x2 * -6.0;
} else if (x2 <= 5.4e-182) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-6.5d-167)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 5.4d-182) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -6.5e-167) {
tmp = x2 * -6.0;
} else if (x2 <= 5.4e-182) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -6.5e-167: tmp = x2 * -6.0 elif x2 <= 5.4e-182: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -6.5e-167) tmp = Float64(x2 * -6.0); elseif (x2 <= 5.4e-182) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -6.5e-167) tmp = x2 * -6.0; elseif (x2 <= 5.4e-182) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -6.5e-167], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 5.4e-182], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.5 \cdot 10^{-167}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 5.4 \cdot 10^{-182}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -6.49999999999999973e-167Initial program 73.3%
Simplified73.3%
Taylor expanded in x1 around 0 21.9%
if -6.49999999999999973e-167 < x2 < 5.39999999999999999e-182Initial program 76.4%
Simplified79.5%
Taylor expanded in x1 around 0 68.7%
fma-define68.7%
*-commutative68.7%
fmm-def68.7%
metadata-eval68.7%
cancel-sign-sub-inv68.7%
cancel-sign-sub-inv68.7%
metadata-eval68.7%
*-commutative68.7%
metadata-eval68.7%
Simplified68.7%
Taylor expanded in x2 around 0 56.7%
neg-mul-156.7%
Simplified56.7%
if 5.39999999999999999e-182 < x2 Initial program 67.8%
Taylor expanded in x1 around 0 64.4%
Taylor expanded in x1 around inf 38.9%
*-commutative38.9%
Simplified38.9%
Taylor expanded in x1 around 0 30.2%
*-commutative30.2%
Simplified30.2%
Final simplification32.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3e-157) (not (<= x2 5.8e-182))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3e-157) || !(x2 <= 5.8e-182)) {
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 <= (-3d-157)) .or. (.not. (x2 <= 5.8d-182))) 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 <= -3e-157) || !(x2 <= 5.8e-182)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3e-157) or not (x2 <= 5.8e-182): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3e-157) || !(x2 <= 5.8e-182)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3e-157) || ~((x2 <= 5.8e-182))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3e-157], N[Not[LessEqual[x2, 5.8e-182]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3 \cdot 10^{-157} \lor \neg \left(x2 \leq 5.8 \cdot 10^{-182}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -3e-157 or 5.79999999999999974e-182 < x2 Initial program 70.2%
Simplified70.2%
Taylor expanded in x1 around 0 26.1%
if -3e-157 < x2 < 5.79999999999999974e-182Initial program 76.4%
Simplified79.5%
Taylor expanded in x1 around 0 68.7%
fma-define68.7%
*-commutative68.7%
fmm-def68.7%
metadata-eval68.7%
cancel-sign-sub-inv68.7%
cancel-sign-sub-inv68.7%
metadata-eval68.7%
*-commutative68.7%
metadata-eval68.7%
Simplified68.7%
Taylor expanded in x2 around 0 56.7%
neg-mul-156.7%
Simplified56.7%
Final simplification32.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.85e-186) (- x1) (* x2 (- (/ x1 x2) 6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.85e-186) {
tmp = -x1;
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.85d-186)) then
tmp = -x1
else
tmp = x2 * ((x1 / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.85e-186) {
tmp = -x1;
} else {
tmp = x2 * ((x1 / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.85e-186: tmp = -x1 else: tmp = x2 * ((x1 / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.85e-186) tmp = Float64(-x1); else tmp = Float64(x2 * Float64(Float64(x1 / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.85e-186) tmp = -x1; else tmp = x2 * ((x1 / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.85e-186], (-x1), N[(x2 * N[(N[(x1 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.85 \cdot 10^{-186}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < -1.8500000000000001e-186Initial program 64.5%
Simplified73.6%
Taylor expanded in x1 around 0 46.5%
fma-define46.5%
*-commutative46.5%
fmm-def46.5%
metadata-eval46.5%
cancel-sign-sub-inv46.5%
cancel-sign-sub-inv46.5%
metadata-eval46.5%
*-commutative46.5%
metadata-eval46.5%
Simplified46.5%
Taylor expanded in x2 around 0 21.3%
neg-mul-121.3%
Simplified21.3%
if -1.8500000000000001e-186 < x1 Initial program 77.2%
Taylor expanded in x1 around 0 74.8%
Taylor expanded in x1 around inf 44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in x1 around 0 37.0%
*-commutative37.0%
Simplified37.0%
Taylor expanded in x2 around inf 43.7%
(FPCore (x1 x2) :precision binary64 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
def code(x1, x2): return (x2 * ((x1 * -12.0) - 6.0)) - x1
function code(x1, x2) return Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) end
function tmp = code(x1, x2) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; end
code[x1_, x2_] := N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(x1 \cdot -12 - 6\right) - x1
\end{array}
Initial program 71.4%
Simplified72.0%
Taylor expanded in x1 around 0 61.0%
fma-define61.0%
*-commutative61.0%
fmm-def61.0%
metadata-eval61.0%
cancel-sign-sub-inv61.0%
cancel-sign-sub-inv61.0%
metadata-eval61.0%
*-commutative61.0%
metadata-eval61.0%
Simplified61.0%
Taylor expanded in x2 around 0 47.5%
Final simplification47.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 71.4%
Simplified72.0%
Taylor expanded in x1 around 0 61.0%
fma-define61.0%
*-commutative61.0%
fmm-def61.0%
metadata-eval61.0%
cancel-sign-sub-inv61.0%
cancel-sign-sub-inv61.0%
metadata-eval61.0%
*-commutative61.0%
metadata-eval61.0%
Simplified61.0%
Taylor expanded in x2 around 0 16.3%
neg-mul-116.3%
Simplified16.3%
(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 x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 71.4%
Taylor expanded in x1 around 0 67.4%
Taylor expanded in x1 around inf 32.8%
*-commutative32.8%
Simplified32.8%
Taylor expanded in x1 around 0 23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in x1 around inf 3.4%
herbie shell --seed 2024165
(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))))))