
(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 25 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 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
(fma t_0 t_3 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), fma(t_0, t_3, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), fma(t_0, t_3, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - 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$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \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_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), \mathsf{fma}\left(t_0, t_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.7%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.7%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* t_1 t_3))
(t_5 (* (* (* x1 2.0) t_3) (- t_3 3.0)))
(t_6 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_3 4.0) 6.0)))) t_4) t_0))
t_6))
INFINITY)
(+
x1
(+
t_6
(+
x1
(+
t_0
(-
t_4
(*
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(-
(/ (fma (* x1 3.0) x1 (+ x2 x2)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))
6.0)))
(- -1.0 (* x1 x1))))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_1 * t_3;
double t_5 = ((x1 * 2.0) * t_3) * (t_3 - 3.0);
double t_6 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (t_0 + (t_4 - ((t_5 + ((x1 * x1) * ((4.0 * ((fma((x1 * 3.0), x1, (x2 + x2)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))) - 6.0))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_1 * t_3) t_5 = Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + t_4) + t_0)) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_0 + Float64(t_4 - Float64(Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.0)))) - 6.0))) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $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$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$0 + N[(t$95$4 - N[(N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.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 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
t_4 := t_1 \cdot t_3\\
t_5 := \left(\left(x1 \cdot 2\right) \cdot t_3\right) \cdot \left(t_3 - 3\right)\\
t_6 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\right) + t_4\right) + t_0\right)\right) + t_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_0 + \left(t_4 - \left(t_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\frac{\mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
fma-def99.4%
div-sub99.4%
fma-def99.4%
count-299.4%
Applied egg-rr99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.7%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 98.7%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -1100000000.0) (not (<= x1 24.0)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- (* x1 (* x1 3.0)) (* 2.0 x2))) (+ (* x1 x1) 1.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1100000000.0) || !(x1 <= 24.0)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1100000000.0d0)) .or. (.not. (x1 <= 24.0d0))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - ((x1 * (x1 * 3.0d0)) - (2.0d0 * x2))) / ((x1 * x1) + 1.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1100000000.0) || !(x1 <= 24.0)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1100000000.0) or not (x1 <= 24.0): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1100000000.0) || !(x1 <= 24.0)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1100000000.0) || ~((x1 <= 24.0))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1100000000.0], N[Not[LessEqual[x1, 24.0]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1100000000 \lor \neg \left(x1 \leq 24\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\
\end{array}
\end{array}
if x1 < -1.1e9 or 24 < x1 Initial program 36.6%
Taylor expanded in x1 around inf 34.1%
Taylor expanded in x1 around inf 34.1%
Taylor expanded in x1 around inf 34.1%
Taylor expanded in x1 around inf 92.5%
if -1.1e9 < x1 < 24Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
Final simplification95.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_1) t_2)))
(if (or (<= x1 -9.5e+105) (not (<= x1 4e+75)))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) 9.0))
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(-
(-
(+
(* t_0 t_3)
(*
t_2
(-
(* (* (* x1 2.0) (/ (- t_1 x1) t_2)) (+ 3.0 t_3))
(* (* x1 x1) 6.0))))
(* x1 (* x1 x1)))
x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double tmp;
if ((x1 <= -9.5e+105) || !(x1 <= 4e+75)) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) - ((((t_0 * t_3) + (t_2 * ((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))) - x1));
}
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 = t_0 + (2.0d0 * x2)
t_2 = (x1 * x1) + 1.0d0
t_3 = (x1 - t_1) / t_2
if ((x1 <= (-9.5d+105)) .or. (.not. (x1 <= 4d+75))) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + 9.0d0)
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) - ((((t_0 * t_3) + (t_2 * ((((x1 * 2.0d0) * ((t_1 - x1) / t_2)) * (3.0d0 + t_3)) - ((x1 * x1) * 6.0d0)))) - (x1 * (x1 * x1))) - x1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_1) / t_2;
double tmp;
if ((x1 <= -9.5e+105) || !(x1 <= 4e+75)) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + 9.0);
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) - ((((t_0 * t_3) + (t_2 * ((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))) - x1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = (x1 * x1) + 1.0 t_3 = (x1 - t_1) / t_2 tmp = 0 if (x1 <= -9.5e+105) or not (x1 <= 4e+75): tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + 9.0) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) - ((((t_0 * t_3) + (t_2 * ((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))) - x1)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_1) / t_2) tmp = 0.0 if ((x1 <= -9.5e+105) || !(x1 <= 4e+75)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + 9.0)); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) - Float64(Float64(Float64(Float64(t_0 * t_3) + Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(t_1 - x1) / t_2)) * Float64(3.0 + t_3)) - Float64(Float64(x1 * x1) * 6.0)))) - Float64(x1 * Float64(x1 * x1))) - x1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = (x1 * x1) + 1.0; t_3 = (x1 - t_1) / t_2; tmp = 0.0; if ((x1 <= -9.5e+105) || ~((x1 <= 4e+75))) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + 9.0); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) - ((((t_0 * t_3) + (t_2 * ((((x1 * 2.0) * ((t_1 - x1) / t_2)) * (3.0 + t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))) - x1)); 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[x1, -9.5e+105], N[Not[LessEqual[x1, 4e+75]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t_0 + 2 \cdot x2\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t_1}{t_2}\\
\mathbf{if}\;x1 \leq -9.5 \cdot 10^{+105} \lor \neg \left(x1 \leq 4 \cdot 10^{+75}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} - \left(\left(\left(t_0 \cdot t_3 + t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot \frac{t_1 - x1}{t_2}\right) \cdot \left(3 + t_3\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -9.4999999999999995e105 or 3.99999999999999971e75 < x1 Initial program 11.5%
Taylor expanded in x1 around inf 11.5%
Taylor expanded in x1 around inf 11.5%
Taylor expanded in x1 around inf 11.5%
Taylor expanded in x1 around inf 100.0%
if -9.4999999999999995e105 < x1 < 3.99999999999999971e75Initial program 98.8%
Taylor expanded in x1 around inf 97.0%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (/ 1.0 x1) 3.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 x1)))
(t_3
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_4 (+ t_1 (* 2.0 x2)))
(t_5 (+ (* x1 x1) 1.0))
(t_6 (/ (- t_4 x1) t_5))
(t_7 (* (* x1 2.0) t_0)))
(if (<= x1 -6e+108)
t_3
(if (<= x1 -7400000.0)
(+
x1
(+
9.0
(+
x1
(+
t_2
(+
(* t_5 (+ (* (* x1 x1) (- (* t_6 4.0) 6.0)) (* (/ 1.0 x1) t_7)))
(* t_1 (+ 3.0 (/ -1.0 x1))))))))
(if (<= x1 75.0)
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) t_5))))
(if (<= x1 5e+153)
(+
x1
(-
(- 9.0 (/ 3.0 x1))
(-
(-
(+
(* t_1 t_0)
(*
t_5
(+
(* (- t_6 3.0) t_7)
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_4) t_5)))))))
t_2)
x1)))
t_3))))))
double code(double x1, double x2) {
double t_0 = (1.0 / x1) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_4 = t_1 + (2.0 * x2);
double t_5 = (x1 * x1) + 1.0;
double t_6 = (t_4 - x1) / t_5;
double t_7 = (x1 * 2.0) * t_0;
double tmp;
if (x1 <= -6e+108) {
tmp = t_3;
} else if (x1 <= -7400000.0) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_5 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + ((1.0 / x1) * t_7))) + (t_1 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 75.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_5)));
} else if (x1 <= 5e+153) {
tmp = x1 + ((9.0 - (3.0 / x1)) - ((((t_1 * t_0) + (t_5 * (((t_6 - 3.0) * t_7) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_5))))))) - t_2) - x1));
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = (1.0d0 / x1) - 3.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (x1 * x1)
t_3 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_4 = t_1 + (2.0d0 * x2)
t_5 = (x1 * x1) + 1.0d0
t_6 = (t_4 - x1) / t_5
t_7 = (x1 * 2.0d0) * t_0
if (x1 <= (-6d+108)) then
tmp = t_3
else if (x1 <= (-7400000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_2 + ((t_5 * (((x1 * x1) * ((t_6 * 4.0d0) - 6.0d0)) + ((1.0d0 / x1) * t_7))) + (t_1 * (3.0d0 + ((-1.0d0) / x1)))))))
else if (x1 <= 75.0d0) then
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - (t_1 - (2.0d0 * x2))) / t_5)))
else if (x1 <= 5d+153) then
tmp = x1 + ((9.0d0 - (3.0d0 / x1)) - ((((t_1 * t_0) + (t_5 * (((t_6 - 3.0d0) * t_7) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_4) / t_5))))))) - t_2) - x1))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (1.0 / x1) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_4 = t_1 + (2.0 * x2);
double t_5 = (x1 * x1) + 1.0;
double t_6 = (t_4 - x1) / t_5;
double t_7 = (x1 * 2.0) * t_0;
double tmp;
if (x1 <= -6e+108) {
tmp = t_3;
} else if (x1 <= -7400000.0) {
tmp = x1 + (9.0 + (x1 + (t_2 + ((t_5 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + ((1.0 / x1) * t_7))) + (t_1 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 75.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_5)));
} else if (x1 <= 5e+153) {
tmp = x1 + ((9.0 - (3.0 / x1)) - ((((t_1 * t_0) + (t_5 * (((t_6 - 3.0) * t_7) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_5))))))) - t_2) - x1));
} else {
tmp = t_3;
}
return tmp;
}
def code(x1, x2): t_0 = (1.0 / x1) - 3.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 * (x1 * x1) t_3 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_4 = t_1 + (2.0 * x2) t_5 = (x1 * x1) + 1.0 t_6 = (t_4 - x1) / t_5 t_7 = (x1 * 2.0) * t_0 tmp = 0 if x1 <= -6e+108: tmp = t_3 elif x1 <= -7400000.0: tmp = x1 + (9.0 + (x1 + (t_2 + ((t_5 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + ((1.0 / x1) * t_7))) + (t_1 * (3.0 + (-1.0 / x1))))))) elif x1 <= 75.0: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_5))) elif x1 <= 5e+153: tmp = x1 + ((9.0 - (3.0 / x1)) - ((((t_1 * t_0) + (t_5 * (((t_6 - 3.0) * t_7) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_5))))))) - t_2) - x1)) else: tmp = t_3 return tmp
function code(x1, x2) t_0 = Float64(Float64(1.0 / x1) - 3.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_4 = Float64(t_1 + Float64(2.0 * x2)) t_5 = Float64(Float64(x1 * x1) + 1.0) t_6 = Float64(Float64(t_4 - x1) / t_5) t_7 = Float64(Float64(x1 * 2.0) * t_0) tmp = 0.0 if (x1 <= -6e+108) tmp = t_3; elseif (x1 <= -7400000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_2 + Float64(Float64(t_5 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_6 * 4.0) - 6.0)) + Float64(Float64(1.0 / x1) * t_7))) + Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1)))))))); elseif (x1 <= 75.0) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / t_5)))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(9.0 - Float64(3.0 / x1)) - Float64(Float64(Float64(Float64(t_1 * t_0) + Float64(t_5 * Float64(Float64(Float64(t_6 - 3.0) * t_7) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_4) / t_5))))))) - t_2) - x1))); else tmp = t_3; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (1.0 / x1) - 3.0; t_1 = x1 * (x1 * 3.0); t_2 = x1 * (x1 * x1); t_3 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_4 = t_1 + (2.0 * x2); t_5 = (x1 * x1) + 1.0; t_6 = (t_4 - x1) / t_5; t_7 = (x1 * 2.0) * t_0; tmp = 0.0; if (x1 <= -6e+108) tmp = t_3; elseif (x1 <= -7400000.0) tmp = x1 + (9.0 + (x1 + (t_2 + ((t_5 * (((x1 * x1) * ((t_6 * 4.0) - 6.0)) + ((1.0 / x1) * t_7))) + (t_1 * (3.0 + (-1.0 / x1))))))); elseif (x1 <= 75.0) tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_5))); elseif (x1 <= 5e+153) tmp = x1 + ((9.0 - (3.0 / x1)) - ((((t_1 * t_0) + (t_5 * (((t_6 - 3.0) * t_7) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_4) / t_5))))))) - t_2) - x1)); else tmp = t_3; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[x1, -6e+108], t$95$3, If[LessEqual[x1, -7400000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$2 + N[(N[(t$95$5 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$6 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 75.0], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(9.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$1 * t$95$0), $MachinePrecision] + N[(t$95$5 * N[(N[(N[(t$95$6 - 3.0), $MachinePrecision] * t$95$7), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x1} - 3\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_4 := t_1 + 2 \cdot x2\\
t_5 := x1 \cdot x1 + 1\\
t_6 := \frac{t_4 - x1}{t_5}\\
t_7 := \left(x1 \cdot 2\right) \cdot t_0\\
\mathbf{if}\;x1 \leq -6 \cdot 10^{+108}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq -7400000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_2 + \left(t_5 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_6 \cdot 4 - 6\right) + \frac{1}{x1} \cdot t_7\right) + t_1 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 75:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_1 - 2 \cdot x2\right)}{t_5}\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(9 - \frac{3}{x1}\right) - \left(\left(\left(t_1 \cdot t_0 + t_5 \cdot \left(\left(t_6 - 3\right) \cdot t_7 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_4}{t_5}\right)\right)\right) - t_2\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x1 < -5.99999999999999968e108 or 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -5.99999999999999968e108 < x1 < -7.4e6Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -7.4e6 < x1 < 75Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
if 75 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
associate-*r/87.8%
metadata-eval87.8%
Simplified87.8%
Final simplification93.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_3 (+ t_0 (* 2.0 x2)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- t_3 x1) t_4))
(t_6 (* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
(if (<= x1 -2.6e+108)
t_2
(if (<= x1 -600000.0)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_4 (+ (* (* x1 x1) (- (* t_5 4.0) 6.0)) (* (/ 1.0 x1) t_6)))
(* t_0 (+ 3.0 (/ -1.0 x1))))))))
(if (<= x1 145.0)
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) t_4))))
(if (<= x1 5e+153)
(+
x1
(+
9.0
(-
x1
(-
(-
(*
t_4
(+
(* (- t_5 3.0) t_6)
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_3) t_4))))))
(* x1 (+ -3.0 (* x1 9.0))))
t_1))))
t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = t_0 + (2.0 * x2);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (t_3 - x1) / t_4;
double t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0);
double tmp;
if (x1 <= -2.6e+108) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 145.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4)));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 - (((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - (x1 * (-3.0 + (x1 * 9.0)))) - t_1)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_3 = t_0 + (2.0d0 * x2)
t_4 = (x1 * x1) + 1.0d0
t_5 = (t_3 - x1) / t_4
t_6 = (x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)
if (x1 <= (-2.6d+108)) then
tmp = t_2
else if (x1 <= (-600000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + ((1.0d0 / x1) * t_6))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))))
else if (x1 <= 145.0d0) then
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - (t_0 - (2.0d0 * x2))) / t_4)))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 + (x1 - (((t_4 * (((t_5 - 3.0d0) * t_6) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_3) / t_4)))))) - (x1 * ((-3.0d0) + (x1 * 9.0d0)))) - t_1)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = t_0 + (2.0 * x2);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (t_3 - x1) / t_4;
double t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0);
double tmp;
if (x1 <= -2.6e+108) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 145.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4)));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 + (x1 - (((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - (x1 * (-3.0 + (x1 * 9.0)))) - t_1)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_3 = t_0 + (2.0 * x2) t_4 = (x1 * x1) + 1.0 t_5 = (t_3 - x1) / t_4 t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0) tmp = 0 if x1 <= -2.6e+108: tmp = t_2 elif x1 <= -600000.0: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1))))))) elif x1 <= 145.0: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4))) elif x1 <= 5e+153: tmp = x1 + (9.0 + (x1 - (((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - (x1 * (-3.0 + (x1 * 9.0)))) - t_1))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_3 = Float64(t_0 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(t_3 - x1) / t_4) t_6 = Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)) tmp = 0.0 if (x1 <= -2.6e+108) tmp = t_2; elseif (x1 <= -600000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(Float64(1.0 / x1) * t_6))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))))); elseif (x1 <= 145.0) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / t_4)))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 + Float64(x1 - Float64(Float64(Float64(t_4 * Float64(Float64(Float64(t_5 - 3.0) * t_6) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_3) / t_4)))))) - Float64(x1 * Float64(-3.0 + Float64(x1 * 9.0)))) - t_1)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_3 = t_0 + (2.0 * x2); t_4 = (x1 * x1) + 1.0; t_5 = (t_3 - x1) / t_4; t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0); tmp = 0.0; if (x1 <= -2.6e+108) tmp = t_2; elseif (x1 <= -600000.0) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1))))))); elseif (x1 <= 145.0) tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 + (x1 - (((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - (x1 * (-3.0 + (x1 * 9.0)))) - t_1))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.6e+108], t$95$2, If[LessEqual[x1, -600000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 145.0], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 + N[(x1 - N[(N[(N[(t$95$4 * N[(N[(N[(t$95$5 - 3.0), $MachinePrecision] * t$95$6), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(-3.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := t_0 + 2 \cdot x2\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t_3 - x1}{t_4}\\
t_6 := \left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -600000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right) + \frac{1}{x1} \cdot t_6\right) + t_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 145:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_0 - 2 \cdot x2\right)}{t_4}\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 + \left(x1 - \left(\left(t_4 \cdot \left(\left(t_5 - 3\right) \cdot t_6 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_3}{t_4}\right)\right) - x1 \cdot \left(-3 + x1 \cdot 9\right)\right) - t_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -2.6000000000000002e108 or 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -2.6000000000000002e108 < x1 < -6e5Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -6e5 < x1 < 145Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
if 145 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around 0 87.8%
+-commutative87.8%
*-commutative87.8%
*-commutative87.8%
unpow287.8%
associate-*l*87.8%
distribute-lft-out87.8%
Simplified87.8%
Final simplification93.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_3 (+ t_0 (* 2.0 x2)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- t_3 x1) t_4))
(t_6 (* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
(if (<= x1 -5.4e+108)
t_2
(if (<= x1 -600000.0)
(+
x1
(+
9.0
(+
x1
(+
t_1
(+
(* t_4 (+ (* (* x1 x1) (- (* t_5 4.0) 6.0)) (* (/ 1.0 x1) t_6)))
(* t_0 (+ 3.0 (/ -1.0 x1))))))))
(if (<= x1 195.0)
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) t_4))))
(if (<= x1 5e+153)
(+
x1
(-
9.0
(-
(-
(-
(*
t_4
(+
(* (- t_5 3.0) t_6)
(* (* x1 x1) (+ 6.0 (* 4.0 (/ (- x1 t_3) t_4))))))
(* (* x1 x1) 9.0))
t_1)
x1)))
t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = t_0 + (2.0 * x2);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (t_3 - x1) / t_4;
double t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0);
double tmp;
if (x1 <= -5.4e+108) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 195.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4)));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 - ((((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - ((x1 * x1) * 9.0)) - t_1) - x1));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_3 = t_0 + (2.0d0 * x2)
t_4 = (x1 * x1) + 1.0d0
t_5 = (t_3 - x1) / t_4
t_6 = (x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)
if (x1 <= (-5.4d+108)) then
tmp = t_2
else if (x1 <= (-600000.0d0)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + ((1.0d0 / x1) * t_6))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))))
else if (x1 <= 195.0d0) then
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - (t_0 - (2.0d0 * x2))) / t_4)))
else if (x1 <= 5d+153) then
tmp = x1 + (9.0d0 - ((((t_4 * (((t_5 - 3.0d0) * t_6) + ((x1 * x1) * (6.0d0 + (4.0d0 * ((x1 - t_3) / t_4)))))) - ((x1 * x1) * 9.0d0)) - t_1) - x1))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = t_0 + (2.0 * x2);
double t_4 = (x1 * x1) + 1.0;
double t_5 = (t_3 - x1) / t_4;
double t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0);
double tmp;
if (x1 <= -5.4e+108) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1)))))));
} else if (x1 <= 195.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4)));
} else if (x1 <= 5e+153) {
tmp = x1 + (9.0 - ((((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - ((x1 * x1) * 9.0)) - t_1) - x1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * x1) t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_3 = t_0 + (2.0 * x2) t_4 = (x1 * x1) + 1.0 t_5 = (t_3 - x1) / t_4 t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0) tmp = 0 if x1 <= -5.4e+108: tmp = t_2 elif x1 <= -600000.0: tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1))))))) elif x1 <= 195.0: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4))) elif x1 <= 5e+153: tmp = x1 + (9.0 - ((((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - ((x1 * x1) * 9.0)) - t_1) - x1)) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_3 = Float64(t_0 + Float64(2.0 * x2)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(t_3 - x1) / t_4) t_6 = Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)) tmp = 0.0 if (x1 <= -5.4e+108) tmp = t_2; elseif (x1 <= -600000.0) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_4 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(Float64(1.0 / x1) * t_6))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))))); elseif (x1 <= 195.0) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / t_4)))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(9.0 - Float64(Float64(Float64(Float64(t_4 * Float64(Float64(Float64(t_5 - 3.0) * t_6) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(Float64(x1 - t_3) / t_4)))))) - Float64(Float64(x1 * x1) * 9.0)) - t_1) - x1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * x1); t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_3 = t_0 + (2.0 * x2); t_4 = (x1 * x1) + 1.0; t_5 = (t_3 - x1) / t_4; t_6 = (x1 * 2.0) * ((1.0 / x1) - 3.0); tmp = 0.0; if (x1 <= -5.4e+108) tmp = t_2; elseif (x1 <= -600000.0) tmp = x1 + (9.0 + (x1 + (t_1 + ((t_4 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((1.0 / x1) * t_6))) + (t_0 * (3.0 + (-1.0 / x1))))))); elseif (x1 <= 195.0) tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_4))); elseif (x1 <= 5e+153) tmp = x1 + (9.0 - ((((t_4 * (((t_5 - 3.0) * t_6) + ((x1 * x1) * (6.0 + (4.0 * ((x1 - t_3) / t_4)))))) - ((x1 * x1) * 9.0)) - t_1) - x1)); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.4e+108], t$95$2, If[LessEqual[x1, -600000.0], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$4 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 195.0], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(9.0 - N[(N[(N[(N[(t$95$4 * N[(N[(N[(t$95$5 - 3.0), $MachinePrecision] * t$95$6), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := t_0 + 2 \cdot x2\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t_3 - x1}{t_4}\\
t_6 := \left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\\
\mathbf{if}\;x1 \leq -5.4 \cdot 10^{+108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -600000:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t_1 + \left(t_4 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right) + \frac{1}{x1} \cdot t_6\right) + t_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 195:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_0 - 2 \cdot x2\right)}{t_4}\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(9 - \left(\left(\left(t_4 \cdot \left(\left(t_5 - 3\right) \cdot t_6 + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{x1 - t_3}{t_4}\right)\right) - \left(x1 \cdot x1\right) \cdot 9\right) - t_1\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -5.4e108 or 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -5.4e108 < x1 < -6e5Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 99.4%
if -6e5 < x1 < 195Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
if 195 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.8%
Taylor expanded in x1 around inf 87.3%
*-commutative87.3%
unpow287.3%
Simplified87.3%
Final simplification93.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_3
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
(* (/ 1.0 x1) (* (* x1 2.0) (- (/ 1.0 x1) 3.0)))))
(* t_0 (+ 3.0 (/ -1.0 x1))))))))))
(if (<= x1 -1.1e+107)
t_2
(if (<= x1 -600000.0)
t_3
(if (<= x1 50.0)
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- t_0 (* 2.0 x2))) t_1))))
(if (<= x1 1.5e+154) t_3 t_2))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (t_0 * (3.0 + (-1.0 / x1)))))));
double tmp;
if (x1 <= -1.1e+107) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = t_3;
} else if (x1 <= 50.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_1)));
} else if (x1 <= 1.5e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_3 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + ((1.0d0 / x1) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0))))) + (t_0 * (3.0d0 + ((-1.0d0) / x1)))))))
if (x1 <= (-1.1d+107)) then
tmp = t_2
else if (x1 <= (-600000.0d0)) then
tmp = t_3
else if (x1 <= 50.0d0) then
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - (t_0 - (2.0d0 * x2))) / t_1)))
else if (x1 <= 1.5d+154) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (t_0 * (3.0 + (-1.0 / x1)))))));
double tmp;
if (x1 <= -1.1e+107) {
tmp = t_2;
} else if (x1 <= -600000.0) {
tmp = t_3;
} else if (x1 <= 50.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_1)));
} else if (x1 <= 1.5e+154) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (t_0 * (3.0 + (-1.0 / x1))))))) tmp = 0 if x1 <= -1.1e+107: tmp = t_2 elif x1 <= -600000.0: tmp = t_3 elif x1 <= 50.0: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_1))) elif x1 <= 1.5e+154: tmp = t_3 else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_3 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + Float64(Float64(1.0 / x1) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0))))) + Float64(t_0 * Float64(3.0 + Float64(-1.0 / x1)))))))) tmp = 0.0 if (x1 <= -1.1e+107) tmp = t_2; elseif (x1 <= -600000.0) tmp = t_3; elseif (x1 <= 50.0) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(t_0 - Float64(2.0 * x2))) / t_1)))); elseif (x1 <= 1.5e+154) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + ((1.0 / x1) * ((x1 * 2.0) * ((1.0 / x1) - 3.0))))) + (t_0 * (3.0 + (-1.0 / x1))))))); tmp = 0.0; if (x1 <= -1.1e+107) tmp = t_2; elseif (x1 <= -600000.0) tmp = t_3; elseif (x1 <= 50.0) tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_0 - (2.0 * x2))) / t_1))); elseif (x1 <= 1.5e+154) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.1e+107], t$95$2, If[LessEqual[x1, -600000.0], t$95$3, If[LessEqual[x1, 50.0], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.5e+154], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1} \cdot 4 - 6\right) + \frac{1}{x1} \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) + t_0 \cdot \left(3 + \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.1 \cdot 10^{+107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -600000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 50:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_0 - 2 \cdot x2\right)}{t_1}\right)\\
\mathbf{elif}\;x1 \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -1.1e107 or 1.50000000000000013e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -1.1e107 < x1 < -6e5 or 50 < x1 < 1.50000000000000013e154Initial program 99.3%
Taylor expanded in x1 around inf 92.4%
Taylor expanded in x1 around inf 92.5%
Taylor expanded in x1 around inf 92.5%
Taylor expanded in x1 around inf 92.1%
if -6e5 < x1 < 50Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
Final simplification93.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_3
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_1 (+ 3.0 (/ -1.0 x1)))
(*
(-
(* (* x1 x1) 6.0)
(*
(- (/ (- (+ t_1 (* 2.0 x2)) x1) t_0) 3.0)
(* (* x1 2.0) (- (/ 1.0 x1) 3.0))))
(- -1.0 (* x1 x1))))))))))
(if (<= x1 -5.5e+102)
t_2
(if (<= x1 -8200000.0)
t_3
(if (<= x1 520.0)
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- t_1 (* 2.0 x2))) t_0))))
(if (<= x1 5e+153) t_3 t_2))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (3.0 + (-1.0 / x1))) - ((((x1 * x1) * 6.0) - (((((t_1 + (2.0 * x2)) - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * (-1.0 - (x1 * x1)))))));
double tmp;
if (x1 <= -5.5e+102) {
tmp = t_2;
} else if (x1 <= -8200000.0) {
tmp = t_3;
} else if (x1 <= 520.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_0)));
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_3 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (3.0d0 + ((-1.0d0) / x1))) - ((((x1 * x1) * 6.0d0) - (((((t_1 + (2.0d0 * x2)) - x1) / t_0) - 3.0d0) * ((x1 * 2.0d0) * ((1.0d0 / x1) - 3.0d0)))) * ((-1.0d0) - (x1 * x1)))))))
if (x1 <= (-5.5d+102)) then
tmp = t_2
else if (x1 <= (-8200000.0d0)) then
tmp = t_3
else if (x1 <= 520.0d0) then
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - (t_1 - (2.0d0 * x2))) / t_0)))
else if (x1 <= 5d+153) then
tmp = t_3
else
tmp = t_2
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 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (3.0 + (-1.0 / x1))) - ((((x1 * x1) * 6.0) - (((((t_1 + (2.0 * x2)) - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * (-1.0 - (x1 * x1)))))));
double tmp;
if (x1 <= -5.5e+102) {
tmp = t_2;
} else if (x1 <= -8200000.0) {
tmp = t_3;
} else if (x1 <= 520.0) {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_0)));
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (3.0 + (-1.0 / x1))) - ((((x1 * x1) * 6.0) - (((((t_1 + (2.0 * x2)) - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * (-1.0 - (x1 * x1))))))) tmp = 0 if x1 <= -5.5e+102: tmp = t_2 elif x1 <= -8200000.0: tmp = t_3 elif x1 <= 520.0: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_0))) elif x1 <= 5e+153: tmp = t_3 else: tmp = t_2 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(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_3 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(3.0 + Float64(-1.0 / x1))) - Float64(Float64(Float64(Float64(x1 * x1) * 6.0) - Float64(Float64(Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(1.0 / x1) - 3.0)))) * Float64(-1.0 - Float64(x1 * x1)))))))) tmp = 0.0 if (x1 <= -5.5e+102) tmp = t_2; elseif (x1 <= -8200000.0) tmp = t_3; elseif (x1 <= 520.0) tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(t_1 - Float64(2.0 * x2))) / t_0)))); elseif (x1 <= 5e+153) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_3 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (3.0 + (-1.0 / x1))) - ((((x1 * x1) * 6.0) - (((((t_1 + (2.0 * x2)) - x1) / t_0) - 3.0) * ((x1 * 2.0) * ((1.0 / x1) - 3.0)))) * (-1.0 - (x1 * x1))))))); tmp = 0.0; if (x1 <= -5.5e+102) tmp = t_2; elseif (x1 <= -8200000.0) tmp = t_3; elseif (x1 <= 520.0) tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - (t_1 - (2.0 * x2))) / t_0))); elseif (x1 <= 5e+153) tmp = t_3; else tmp = t_2; 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[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(3.0 + N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] - N[(N[(N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+102], t$95$2, If[LessEqual[x1, -8200000.0], t$95$3, If[LessEqual[x1, 520.0], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_3 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(3 + \frac{-1}{x1}\right) - \left(\left(x1 \cdot x1\right) \cdot 6 - \left(\frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(\frac{1}{x1} - 3\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -8200000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 520:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(t_1 - 2 \cdot x2\right)}{t_0}\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102 or 5.00000000000000018e153 < x1 Initial program 1.3%
Taylor expanded in x1 around inf 1.3%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 62.3%
+-commutative62.3%
+-commutative62.3%
associate-+l+62.3%
metadata-eval62.3%
distribute-lft-neg-in62.3%
mul-1-neg62.3%
distribute-neg-in62.3%
fma-udef62.3%
unsub-neg62.3%
*-commutative62.3%
unpow262.3%
associate-*l*62.3%
cancel-sign-sub-inv62.3%
metadata-eval62.3%
+-commutative62.3%
count-262.3%
Simplified62.3%
Taylor expanded in x2 around 0 85.8%
*-commutative85.8%
unpow285.8%
Simplified85.8%
if -5.49999999999999981e102 < x1 < -8.2e6 or 520 < x1 < 5.00000000000000018e153Initial program 99.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 92.3%
Taylor expanded in x1 around inf 80.9%
if -8.2e6 < x1 < 520Initial program 98.7%
Taylor expanded in x1 around 0 98.4%
Final simplification91.5%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -2.6e+108) (not (<= x1 1.5e+154)))
(+ x1 (- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1))))))
(-
x1
(+
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)
(* 3.0 (/ (- x1 (- (* x1 (* x1 3.0)) (* 2.0 x2))) (+ (* x1 x1) 1.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e+108) || !(x1 <= 1.5e+154)) {
tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
} else {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-2.6d+108)) .or. (.not. (x1 <= 1.5d+154))) then
tmp = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
else
tmp = x1 - (((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1) + (3.0d0 * ((x1 - ((x1 * (x1 * 3.0d0)) - (2.0d0 * x2))) / ((x1 * x1) + 1.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -2.6e+108) || !(x1 <= 1.5e+154)) {
tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
} else {
tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -2.6e+108) or not (x1 <= 1.5e+154): tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) else: tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -2.6e+108) || !(x1 <= 1.5e+154)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))); else tmp = Float64(x1 - Float64(Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1) + Float64(3.0 * Float64(Float64(x1 - Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2))) / Float64(Float64(x1 * x1) + 1.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -2.6e+108) || ~((x1 <= 1.5e+154))) tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); else tmp = x1 - (((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1) + (3.0 * ((x1 - ((x1 * (x1 * 3.0)) - (2.0 * x2))) / ((x1 * x1) + 1.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -2.6e+108], N[Not[LessEqual[x1, 1.5e+154]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 - N[(N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(N[(x1 - N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+108} \lor \neg \left(x1 \leq 1.5 \cdot 10^{+154}\right):\\
\;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - \left(\left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right) + 3 \cdot \frac{x1 - \left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right)}{x1 \cdot x1 + 1}\right)\\
\end{array}
\end{array}
if x1 < -2.6000000000000002e108 or 1.50000000000000013e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -2.6000000000000002e108 < x1 < 1.50000000000000013e154Initial program 98.8%
Taylor expanded in x1 around 0 80.5%
Final simplification82.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
(if (<= x1 -2.25e+77)
(- x1 (* x2 (+ (* (* x1 x1) -6.0) 10.0)))
(if (<= x1 -1.06e-163)
t_0
(if (<= x1 5e-178)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+154) t_0 (/ (* x1 x1) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.25e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= -1.06e-163) {
tmp = t_0;
} else if (x1 <= 5e-178) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-2.25d+77)) then
tmp = x1 - (x2 * (((x1 * x1) * (-6.0d0)) + 10.0d0))
else if (x1 <= (-1.06d-163)) then
tmp = t_0
else if (x1 <= 5d-178) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.4d+154) then
tmp = t_0
else
tmp = (x1 * x1) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.25e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= -1.06e-163) {
tmp = t_0;
} else if (x1 <= 5e-178) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -2.25e+77: tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)) elif x1 <= -1.06e-163: tmp = t_0 elif x1 <= 5e-178: tmp = (x2 * -6.0) - x1 elif x1 <= 1.4e+154: tmp = t_0 else: tmp = (x1 * x1) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -2.25e+77) tmp = Float64(x1 - Float64(x2 * Float64(Float64(Float64(x1 * x1) * -6.0) + 10.0))); elseif (x1 <= -1.06e-163) tmp = t_0; elseif (x1 <= 5e-178) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -2.25e+77) tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)); elseif (x1 <= -1.06e-163) tmp = t_0; elseif (x1 <= 5e-178) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.4e+154) tmp = t_0; else tmp = (x1 * x1) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.25e+77], N[(x1 - N[(x2 * N[(N[(N[(x1 * x1), $MachinePrecision] * -6.0), $MachinePrecision] + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.06e-163], t$95$0, If[LessEqual[x1, 5e-178], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{+77}:\\
\;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\
\mathbf{elif}\;x1 \leq -1.06 \cdot 10^{-163}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.25000000000000012e77Initial program 14.8%
Taylor expanded in x1 around inf 14.8%
Taylor expanded in x1 around 0 0.3%
sub-neg0.3%
metadata-eval0.3%
distribute-lft-in0.3%
*-commutative0.3%
associate-*l*0.3%
metadata-eval0.3%
metadata-eval0.3%
distribute-rgt-in0.3%
+-commutative0.3%
distribute-lft-in0.3%
metadata-eval0.3%
associate-*r*0.3%
metadata-eval0.3%
Simplified0.3%
Taylor expanded in x1 around 0 51.4%
+-commutative51.4%
+-commutative51.4%
associate-+l+51.4%
metadata-eval51.4%
distribute-lft-neg-in51.4%
mul-1-neg51.4%
distribute-neg-in51.4%
fma-udef51.4%
unsub-neg51.4%
*-commutative51.4%
unpow251.4%
associate-*l*51.4%
cancel-sign-sub-inv51.4%
metadata-eval51.4%
+-commutative51.4%
count-251.4%
Simplified51.4%
Taylor expanded in x2 around -inf 37.5%
mul-1-neg37.5%
*-commutative37.5%
distribute-rgt-neg-in37.5%
distribute-rgt-in37.5%
metadata-eval37.5%
associate-+l+37.5%
*-commutative37.5%
associate-*l*37.5%
metadata-eval37.5%
unpow237.5%
metadata-eval37.5%
Simplified37.5%
if -2.25000000000000012e77 < x1 < -1.06000000000000006e-163 or 4.99999999999999976e-178 < x1 < 1.4e154Initial program 98.3%
Taylor expanded in x1 around 0 70.2%
Taylor expanded in x1 around 0 66.6%
if -1.06000000000000006e-163 < x1 < 4.99999999999999976e-178Initial program 99.6%
Taylor expanded in x2 around inf 77.1%
associate-/l*77.1%
unpow277.1%
+-commutative77.1%
unpow277.1%
fma-udef77.1%
Simplified77.1%
Taylor expanded in x1 around 0 75.8%
fma-def76.0%
fma-neg76.0%
unpow276.0%
metadata-eval76.0%
Simplified76.0%
Taylor expanded in x2 around 0 84.6%
associate-+r+84.6%
+-commutative84.6%
associate-+l+84.6%
distribute-rgt1-in84.6%
metadata-eval84.6%
mul-1-neg84.6%
sub-neg84.6%
*-commutative84.6%
Simplified84.6%
if 1.4e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.1%
*-commutative6.1%
Simplified6.1%
flip-+77.4%
Applied egg-rr77.4%
swap-sqr77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x1 around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification68.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_1
(+
x1
(+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
(if (<= x1 -2.4e+107)
t_0
(if (<= x1 -5.5e-167)
t_1
(if (<= x1 5e-178) (- (* x2 -6.0) x1) (if (<= x1 4.4e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.4e+107) {
tmp = t_0;
} else if (x1 <= -5.5e-167) {
tmp = t_1;
} else if (x1 <= 5e-178) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-2.4d+107)) then
tmp = t_0
else if (x1 <= (-5.5d-167)) then
tmp = t_1
else if (x1 <= 5d-178) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.4d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -2.4e+107) {
tmp = t_0;
} else if (x1 <= -5.5e-167) {
tmp = t_1;
} else if (x1 <= 5e-178) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -2.4e+107: tmp = t_0 elif x1 <= -5.5e-167: tmp = t_1 elif x1 <= 5e-178: tmp = (x2 * -6.0) - x1 elif x1 <= 4.4e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -2.4e+107) tmp = t_0; elseif (x1 <= -5.5e-167) tmp = t_1; elseif (x1 <= 5e-178) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -2.4e+107) tmp = t_0; elseif (x1 <= -5.5e-167) tmp = t_1; elseif (x1 <= 5e-178) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.4e+107], t$95$0, If[LessEqual[x1, -5.5e-167], t$95$1, If[LessEqual[x1, 5e-178], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-167}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -2.4000000000000001e107 or 4.3999999999999999e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -2.4000000000000001e107 < x1 < -5.5000000000000003e-167 or 4.99999999999999976e-178 < x1 < 4.3999999999999999e153Initial program 98.4%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x1 around 0 65.5%
if -5.5000000000000003e-167 < x1 < 4.99999999999999976e-178Initial program 99.6%
Taylor expanded in x2 around inf 77.1%
associate-/l*77.1%
unpow277.1%
+-commutative77.1%
unpow277.1%
fma-udef77.1%
Simplified77.1%
Taylor expanded in x1 around 0 75.8%
fma-def76.0%
fma-neg76.0%
unpow276.0%
metadata-eval76.0%
Simplified76.0%
Taylor expanded in x2 around 0 84.6%
associate-+r+84.6%
+-commutative84.6%
associate-+l+84.6%
distribute-rgt1-in84.6%
metadata-eval84.6%
mul-1-neg84.6%
sub-neg84.6%
*-commutative84.6%
Simplified84.6%
Final simplification77.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1)))))))
(t_1
(+
x1
(+ (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)) (* x2 -6.0)))))
(if (<= x1 -4.6e+108)
t_0
(if (<= x1 -6.6e-239)
t_1
(if (<= x1 6e-177)
(+
x1
(-
(* 3.0 (* x2 -2.0))
(- (* 4.0 (* x2 (* x1 (- 3.0 (* 2.0 x2))))) x1)))
(if (<= x1 4.5e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -4.6e+108) {
tmp = t_0;
} else if (x1 <= -6.6e-239) {
tmp = t_1;
} else if (x1 <= 6e-177) {
tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
t_1 = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (x2 * (-6.0d0)))
if (x1 <= (-4.6d+108)) then
tmp = t_0
else if (x1 <= (-6.6d-239)) then
tmp = t_1
else if (x1 <= 6d-177) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) - ((4.0d0 * (x2 * (x1 * (3.0d0 - (2.0d0 * x2))))) - x1))
else if (x1 <= 4.5d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
double t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0));
double tmp;
if (x1 <= -4.6e+108) {
tmp = t_0;
} else if (x1 <= -6.6e-239) {
tmp = t_1;
} else if (x1 <= 6e-177) {
tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)) tmp = 0 if x1 <= -4.6e+108: tmp = t_0 elif x1 <= -6.6e-239: tmp = t_1 elif x1 <= 6e-177: tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1)) elif x1 <= 4.5e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))) t_1 = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(x2 * -6.0))) tmp = 0.0 if (x1 <= -4.6e+108) tmp = t_0; elseif (x1 <= -6.6e-239) tmp = t_1; elseif (x1 <= 6e-177) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) - Float64(Float64(4.0 * Float64(x2 * Float64(x1 * Float64(3.0 - Float64(2.0 * x2))))) - x1))); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); t_1 = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (x2 * -6.0)); tmp = 0.0; if (x1 <= -4.6e+108) tmp = t_0; elseif (x1 <= -6.6e-239) tmp = t_1; elseif (x1 <= 6e-177) tmp = x1 + ((3.0 * (x2 * -2.0)) - ((4.0 * (x2 * (x1 * (3.0 - (2.0 * x2))))) - x1)); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.6e+108], t$95$0, If[LessEqual[x1, -6.6e-239], t$95$1, If[LessEqual[x1, 6e-177], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x2 * N[(x1 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
t_1 := x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + x2 \cdot -6\right)\\
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -6.6 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{-177}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) - \left(4 \cdot \left(x2 \cdot \left(x1 \cdot \left(3 - 2 \cdot x2\right)\right)\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -4.5999999999999998e108 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -4.5999999999999998e108 < x1 < -6.5999999999999999e-239 or 6.00000000000000015e-177 < x1 < 4.5000000000000001e153Initial program 98.6%
Taylor expanded in x1 around 0 74.4%
Taylor expanded in x1 around 0 68.3%
if -6.5999999999999999e-239 < x1 < 6.00000000000000015e-177Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
Taylor expanded in x1 around 0 97.8%
*-commutative97.8%
Simplified97.8%
Final simplification78.9%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -1.15e+108) (not (<= x1 4.5e+153)))
(+ x1 (- (+ x1 (+ 6.0 (* x2 -4.0))) (* 3.0 (- x1 (* 3.0 (* x1 x1))))))
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0)))))
(* 3.0 (- (* x2 -2.0) x1))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.15e+108) || !(x1 <= 4.5e+153)) {
tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.15d+108)) .or. (.not. (x1 <= 4.5d+153))) then
tmp = x1 + ((x1 + (6.0d0 + (x2 * (-4.0d0)))) - (3.0d0 * (x1 - (3.0d0 * (x1 * x1)))))
else
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.15e+108) || !(x1 <= 4.5e+153)) {
tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1)))));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.15e+108) or not (x1 <= 4.5e+153): tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))) else: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.15e+108) || !(x1 <= 4.5e+153)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 + Float64(x2 * -4.0))) - Float64(3.0 * Float64(x1 - Float64(3.0 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.15e+108) || ~((x1 <= 4.5e+153))) tmp = x1 + ((x1 + (6.0 + (x2 * -4.0))) - (3.0 * (x1 - (3.0 * (x1 * x1))))); else tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.15e+108], N[Not[LessEqual[x1, 4.5e+153]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(6.0 + N[(x2 * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[(x1 - N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{+108} \lor \neg \left(x1 \leq 4.5 \cdot 10^{+153}\right):\\
\;\;\;\;x1 + \left(\left(x1 + \left(6 + x2 \cdot -4\right)\right) - 3 \cdot \left(x1 - 3 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -1.1499999999999999e108 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
associate-*l*0.1%
metadata-eval0.1%
metadata-eval0.1%
distribute-rgt-in0.1%
+-commutative0.1%
distribute-lft-in0.1%
metadata-eval0.1%
associate-*r*0.1%
metadata-eval0.1%
Simplified0.1%
Taylor expanded in x1 around 0 61.9%
+-commutative61.9%
+-commutative61.9%
associate-+l+61.9%
metadata-eval61.9%
distribute-lft-neg-in61.9%
mul-1-neg61.9%
distribute-neg-in61.9%
fma-udef61.9%
unsub-neg61.9%
*-commutative61.9%
unpow261.9%
associate-*l*61.9%
cancel-sign-sub-inv61.9%
metadata-eval61.9%
+-commutative61.9%
count-261.9%
Simplified61.9%
Taylor expanded in x2 around 0 86.9%
*-commutative86.9%
unpow286.9%
Simplified86.9%
if -1.1499999999999999e108 < x1 < 4.5000000000000001e153Initial program 98.8%
Taylor expanded in x1 around 0 80.5%
Taylor expanded in x1 around 0 79.8%
Final simplification82.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.05e+77)
(- x1 (* x2 (+ (* (* x1 x1) -6.0) 10.0)))
(if (<= x1 1.85e-9)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+154)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(/ (* x1 x1) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= 1.85e-9) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x1 * x1) / (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 <= (-2.05d+77)) then
tmp = x1 - (x2 * (((x1 * x1) * (-6.0d0)) + 10.0d0))
else if (x1 <= 1.85d-9) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.4d+154) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = (x1 * x1) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= 1.85e-9) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x1 * x1) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.05e+77: tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)) elif x1 <= 1.85e-9: tmp = (x2 * -6.0) - x1 elif x1 <= 1.4e+154: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = (x1 * x1) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.05e+77) tmp = Float64(x1 - Float64(x2 * Float64(Float64(Float64(x1 * x1) * -6.0) + 10.0))); elseif (x1 <= 1.85e-9) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+154) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(Float64(x1 * x1) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.05e+77) tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)); elseif (x1 <= 1.85e-9) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.4e+154) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = (x1 * x1) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.05e+77], N[(x1 - N[(x2 * N[(N[(N[(x1 * x1), $MachinePrecision] * -6.0), $MachinePrecision] + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.85e-9], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+77}:\\
\;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{-9}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.05e77Initial program 14.8%
Taylor expanded in x1 around inf 14.8%
Taylor expanded in x1 around 0 0.3%
sub-neg0.3%
metadata-eval0.3%
distribute-lft-in0.3%
*-commutative0.3%
associate-*l*0.3%
metadata-eval0.3%
metadata-eval0.3%
distribute-rgt-in0.3%
+-commutative0.3%
distribute-lft-in0.3%
metadata-eval0.3%
associate-*r*0.3%
metadata-eval0.3%
Simplified0.3%
Taylor expanded in x1 around 0 51.4%
+-commutative51.4%
+-commutative51.4%
associate-+l+51.4%
metadata-eval51.4%
distribute-lft-neg-in51.4%
mul-1-neg51.4%
distribute-neg-in51.4%
fma-udef51.4%
unsub-neg51.4%
*-commutative51.4%
unpow251.4%
associate-*l*51.4%
cancel-sign-sub-inv51.4%
metadata-eval51.4%
+-commutative51.4%
count-251.4%
Simplified51.4%
Taylor expanded in x2 around -inf 37.5%
mul-1-neg37.5%
*-commutative37.5%
distribute-rgt-neg-in37.5%
distribute-rgt-in37.5%
metadata-eval37.5%
associate-+l+37.5%
*-commutative37.5%
associate-*l*37.5%
metadata-eval37.5%
unpow237.5%
metadata-eval37.5%
Simplified37.5%
if -2.05e77 < x1 < 1.85e-9Initial program 98.7%
Taylor expanded in x2 around inf 80.0%
associate-/l*79.9%
unpow279.9%
+-commutative79.9%
unpow279.9%
fma-udef79.9%
Simplified79.9%
Taylor expanded in x1 around 0 78.6%
fma-def78.7%
fma-neg78.7%
unpow278.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in x2 around 0 68.1%
associate-+r+68.1%
+-commutative68.1%
associate-+l+68.1%
distribute-rgt1-in68.1%
metadata-eval68.1%
mul-1-neg68.1%
sub-neg68.1%
*-commutative68.1%
Simplified68.1%
if 1.85e-9 < x1 < 1.4e154Initial program 99.3%
Taylor expanded in x1 around 0 30.5%
Taylor expanded in x1 around inf 30.5%
if 1.4e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.1%
*-commutative6.1%
Simplified6.1%
flip-+77.4%
Applied egg-rr77.4%
swap-sqr77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x1 around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification60.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* (* x1 (* x2 x2)) 8.0))) (t_1 (- x1 (* x2 -6.0))))
(if (<= x1 -2.15e+106)
(/ (* (* x2 x2) -36.0) t_1)
(if (<= x1 -8.5e-17)
t_0
(if (<= x1 1.02e-8)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+154) t_0 (/ (* x1 x1) t_1)))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * (x2 * x2)) * 8.0);
double t_1 = x1 - (x2 * -6.0);
double tmp;
if (x1 <= -2.15e+106) {
tmp = ((x2 * x2) * -36.0) / t_1;
} else if (x1 <= -8.5e-17) {
tmp = t_0;
} else if (x1 <= 1.02e-8) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + ((x1 * (x2 * x2)) * 8.0d0)
t_1 = x1 - (x2 * (-6.0d0))
if (x1 <= (-2.15d+106)) then
tmp = ((x2 * x2) * (-36.0d0)) / t_1
else if (x1 <= (-8.5d-17)) then
tmp = t_0
else if (x1 <= 1.02d-8) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.4d+154) then
tmp = t_0
else
tmp = (x1 * x1) / t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x1 * (x2 * x2)) * 8.0);
double t_1 = x1 - (x2 * -6.0);
double tmp;
if (x1 <= -2.15e+106) {
tmp = ((x2 * x2) * -36.0) / t_1;
} else if (x1 <= -8.5e-17) {
tmp = t_0;
} else if (x1 <= 1.02e-8) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = t_0;
} else {
tmp = (x1 * x1) / t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x1 * (x2 * x2)) * 8.0) t_1 = x1 - (x2 * -6.0) tmp = 0 if x1 <= -2.15e+106: tmp = ((x2 * x2) * -36.0) / t_1 elif x1 <= -8.5e-17: tmp = t_0 elif x1 <= 1.02e-8: tmp = (x2 * -6.0) - x1 elif x1 <= 1.4e+154: tmp = t_0 else: tmp = (x1 * x1) / t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0)) t_1 = Float64(x1 - Float64(x2 * -6.0)) tmp = 0.0 if (x1 <= -2.15e+106) tmp = Float64(Float64(Float64(x2 * x2) * -36.0) / t_1); elseif (x1 <= -8.5e-17) tmp = t_0; elseif (x1 <= 1.02e-8) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+154) tmp = t_0; else tmp = Float64(Float64(x1 * x1) / t_1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x1 * (x2 * x2)) * 8.0); t_1 = x1 - (x2 * -6.0); tmp = 0.0; if (x1 <= -2.15e+106) tmp = ((x2 * x2) * -36.0) / t_1; elseif (x1 <= -8.5e-17) tmp = t_0; elseif (x1 <= 1.02e-8) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.4e+154) tmp = t_0; else tmp = (x1 * x1) / t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.15e+106], N[(N[(N[(x2 * x2), $MachinePrecision] * -36.0), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x1, -8.5e-17], t$95$0, If[LessEqual[x1, 1.02e-8], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], t$95$0, N[(N[(x1 * x1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\
t_1 := x1 - x2 \cdot -6\\
\mathbf{if}\;x1 \leq -2.15 \cdot 10^{+106}:\\
\;\;\;\;\frac{\left(x2 \cdot x2\right) \cdot -36}{t_1}\\
\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-17}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 1.02 \cdot 10^{-8}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{t_1}\\
\end{array}
\end{array}
if x1 < -2.15e106Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 0.7%
*-commutative0.7%
Simplified0.7%
flip-+2.2%
Applied egg-rr2.2%
swap-sqr2.2%
metadata-eval2.2%
Simplified2.2%
Taylor expanded in x1 around 0 23.2%
unpow223.2%
Simplified23.2%
if -2.15e106 < x1 < -8.5e-17 or 1.02000000000000003e-8 < x1 < 1.4e154Initial program 99.3%
Taylor expanded in x1 around 0 31.5%
Taylor expanded in x2 around inf 31.5%
*-commutative31.5%
*-commutative31.5%
unpow231.5%
Simplified31.5%
if -8.5e-17 < x1 < 1.02000000000000003e-8Initial program 98.7%
Taylor expanded in x2 around inf 85.5%
associate-/l*85.5%
unpow285.5%
+-commutative85.5%
unpow285.5%
fma-udef85.5%
Simplified85.5%
Taylor expanded in x1 around 0 84.3%
fma-def84.5%
fma-neg84.5%
unpow284.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in x2 around 0 75.0%
associate-+r+75.0%
+-commutative75.0%
associate-+l+75.0%
distribute-rgt1-in75.0%
metadata-eval75.0%
mul-1-neg75.0%
sub-neg75.0%
*-commutative75.0%
Simplified75.0%
if 1.4e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.1%
*-commutative6.1%
Simplified6.1%
flip-+77.4%
Applied egg-rr77.4%
swap-sqr77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x1 around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification59.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.05e+77)
(- x1 (* x2 (+ (* (* x1 x1) -6.0) 10.0)))
(if (<= x1 1.15e-9)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+154)
(+ x1 (* (* x1 (* x2 x2)) 8.0))
(/ (* x1 x1) (- x1 (* x2 -6.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= 1.15e-9) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (x1 * x1) / (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 <= (-2.05d+77)) then
tmp = x1 - (x2 * (((x1 * x1) * (-6.0d0)) + 10.0d0))
else if (x1 <= 1.15d-9) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.4d+154) then
tmp = x1 + ((x1 * (x2 * x2)) * 8.0d0)
else
tmp = (x1 * x1) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.05e+77) {
tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0));
} else if (x1 <= 1.15e-9) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (x1 * x1) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.05e+77: tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)) elif x1 <= 1.15e-9: tmp = (x2 * -6.0) - x1 elif x1 <= 1.4e+154: tmp = x1 + ((x1 * (x2 * x2)) * 8.0) else: tmp = (x1 * x1) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.05e+77) tmp = Float64(x1 - Float64(x2 * Float64(Float64(Float64(x1 * x1) * -6.0) + 10.0))); elseif (x1 <= 1.15e-9) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+154) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0)); else tmp = Float64(Float64(x1 * x1) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.05e+77) tmp = x1 - (x2 * (((x1 * x1) * -6.0) + 10.0)); elseif (x1 <= 1.15e-9) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.4e+154) tmp = x1 + ((x1 * (x2 * x2)) * 8.0); else tmp = (x1 * x1) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.05e+77], N[(x1 - N[(x2 * N[(N[(N[(x1 * x1), $MachinePrecision] * -6.0), $MachinePrecision] + 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.15e-9], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.05 \cdot 10^{+77}:\\
\;\;\;\;x1 - x2 \cdot \left(\left(x1 \cdot x1\right) \cdot -6 + 10\right)\\
\mathbf{elif}\;x1 \leq 1.15 \cdot 10^{-9}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -2.05e77Initial program 14.8%
Taylor expanded in x1 around inf 14.8%
Taylor expanded in x1 around 0 0.3%
sub-neg0.3%
metadata-eval0.3%
distribute-lft-in0.3%
*-commutative0.3%
associate-*l*0.3%
metadata-eval0.3%
metadata-eval0.3%
distribute-rgt-in0.3%
+-commutative0.3%
distribute-lft-in0.3%
metadata-eval0.3%
associate-*r*0.3%
metadata-eval0.3%
Simplified0.3%
Taylor expanded in x1 around 0 51.4%
+-commutative51.4%
+-commutative51.4%
associate-+l+51.4%
metadata-eval51.4%
distribute-lft-neg-in51.4%
mul-1-neg51.4%
distribute-neg-in51.4%
fma-udef51.4%
unsub-neg51.4%
*-commutative51.4%
unpow251.4%
associate-*l*51.4%
cancel-sign-sub-inv51.4%
metadata-eval51.4%
+-commutative51.4%
count-251.4%
Simplified51.4%
Taylor expanded in x2 around -inf 37.5%
mul-1-neg37.5%
*-commutative37.5%
distribute-rgt-neg-in37.5%
distribute-rgt-in37.5%
metadata-eval37.5%
associate-+l+37.5%
*-commutative37.5%
associate-*l*37.5%
metadata-eval37.5%
unpow237.5%
metadata-eval37.5%
Simplified37.5%
if -2.05e77 < x1 < 1.15e-9Initial program 98.7%
Taylor expanded in x2 around inf 80.0%
associate-/l*79.9%
unpow279.9%
+-commutative79.9%
unpow279.9%
fma-udef79.9%
Simplified79.9%
Taylor expanded in x1 around 0 78.6%
fma-def78.7%
fma-neg78.7%
unpow278.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in x2 around 0 68.1%
associate-+r+68.1%
+-commutative68.1%
associate-+l+68.1%
distribute-rgt1-in68.1%
metadata-eval68.1%
mul-1-neg68.1%
sub-neg68.1%
*-commutative68.1%
Simplified68.1%
if 1.15e-9 < x1 < 1.4e154Initial program 99.3%
Taylor expanded in x1 around 0 30.5%
Taylor expanded in x2 around inf 30.5%
*-commutative30.5%
*-commutative30.5%
unpow230.5%
Simplified30.5%
if 1.4e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.1%
*-commutative6.1%
Simplified6.1%
flip-+77.4%
Applied egg-rr77.4%
swap-sqr77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x1 around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification60.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -4.8e+126) (not (<= x2 4.2e+41))) (+ x1 (* (* x1 (* x2 x2)) 8.0)) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.8e+126) || !(x2 <= 4.2e+41)) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (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 ((x2 <= (-4.8d+126)) .or. (.not. (x2 <= 4.2d+41))) then
tmp = x1 + ((x1 * (x2 * x2)) * 8.0d0)
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -4.8e+126) || !(x2 <= 4.2e+41)) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -4.8e+126) or not (x2 <= 4.2e+41): tmp = x1 + ((x1 * (x2 * x2)) * 8.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -4.8e+126) || !(x2 <= 4.2e+41)) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0)); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -4.8e+126) || ~((x2 <= 4.2e+41))) tmp = x1 + ((x1 * (x2 * x2)) * 8.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -4.8e+126], N[Not[LessEqual[x2, 4.2e+41]], $MachinePrecision]], N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4.8 \cdot 10^{+126} \lor \neg \left(x2 \leq 4.2 \cdot 10^{+41}\right):\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x2 < -4.80000000000000024e126 or 4.1999999999999999e41 < x2 Initial program 68.3%
Taylor expanded in x1 around 0 64.6%
Taylor expanded in x2 around inf 52.5%
*-commutative52.5%
*-commutative52.5%
unpow252.5%
Simplified52.5%
if -4.80000000000000024e126 < x2 < 4.1999999999999999e41Initial program 69.6%
Taylor expanded in x2 around inf 51.6%
associate-/l*51.6%
unpow251.6%
+-commutative51.6%
unpow251.6%
fma-udef51.6%
Simplified51.6%
Taylor expanded in x1 around 0 52.7%
fma-def52.8%
fma-neg52.8%
unpow252.8%
metadata-eval52.8%
Simplified52.8%
Taylor expanded in x2 around 0 51.3%
associate-+r+51.3%
+-commutative51.3%
associate-+l+51.3%
distribute-rgt1-in51.3%
metadata-eval51.3%
mul-1-neg51.3%
sub-neg51.3%
*-commutative51.3%
Simplified51.3%
Final simplification51.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 4.8e-10)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+154)
(+ x1 (* (* x1 (* x2 x2)) 8.0))
(/ (* x1 x1) (- x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 4.8e-10) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (x1 * x1) / (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 <= 4.8d-10) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 1.4d+154) then
tmp = x1 + ((x1 * (x2 * x2)) * 8.0d0)
else
tmp = (x1 * x1) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 4.8e-10) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+154) {
tmp = x1 + ((x1 * (x2 * x2)) * 8.0);
} else {
tmp = (x1 * x1) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 4.8e-10: tmp = (x2 * -6.0) - x1 elif x1 <= 1.4e+154: tmp = x1 + ((x1 * (x2 * x2)) * 8.0) else: tmp = (x1 * x1) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 4.8e-10) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+154) tmp = Float64(x1 + Float64(Float64(x1 * Float64(x2 * x2)) * 8.0)); else tmp = Float64(Float64(x1 * x1) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 4.8e-10) tmp = (x2 * -6.0) - x1; elseif (x1 <= 1.4e+154) tmp = x1 + ((x1 * (x2 * x2)) * 8.0); else tmp = (x1 * x1) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 4.8e-10], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+154], N[(x1 + N[(N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(x2 \cdot x2\right)\right) \cdot 8\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < 4.8e-10Initial program 75.7%
Taylor expanded in x2 around inf 60.1%
associate-/l*60.1%
unpow260.1%
+-commutative60.1%
unpow260.1%
fma-udef60.1%
Simplified60.1%
Taylor expanded in x1 around 0 59.8%
fma-def59.9%
fma-neg59.9%
unpow259.9%
metadata-eval59.9%
Simplified59.9%
Taylor expanded in x2 around 0 51.0%
associate-+r+51.0%
+-commutative51.0%
associate-+l+51.0%
distribute-rgt1-in51.0%
metadata-eval51.0%
mul-1-neg51.0%
sub-neg51.0%
*-commutative51.0%
Simplified51.0%
if 4.8e-10 < x1 < 1.4e154Initial program 99.3%
Taylor expanded in x1 around 0 30.5%
Taylor expanded in x2 around inf 30.5%
*-commutative30.5%
*-commutative30.5%
unpow230.5%
Simplified30.5%
if 1.4e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.1%
*-commutative6.1%
Simplified6.1%
flip-+77.4%
Applied egg-rr77.4%
swap-sqr77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x1 around inf 93.5%
unpow293.5%
Simplified93.5%
Final simplification53.9%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.05e-254) (* x2 -6.0) (if (<= x2 1.45e-173) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.05e-254) {
tmp = x2 * -6.0;
} else if (x2 <= 1.45e-173) {
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 <= (-1.05d-254)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1.45d-173) 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 <= -1.05e-254) {
tmp = x2 * -6.0;
} else if (x2 <= 1.45e-173) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.05e-254: tmp = x2 * -6.0 elif x2 <= 1.45e-173: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.05e-254) tmp = Float64(x2 * -6.0); elseif (x2 <= 1.45e-173) 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 <= -1.05e-254) tmp = x2 * -6.0; elseif (x2 <= 1.45e-173) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.05e-254], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1.45e-173], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 1.45 \cdot 10^{-173}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.04999999999999998e-254Initial program 70.7%
Taylor expanded in x1 around 0 55.2%
Taylor expanded in x1 around 0 27.4%
*-commutative27.4%
Simplified27.4%
Taylor expanded in x1 around 0 27.9%
*-commutative27.9%
Simplified27.9%
if -1.04999999999999998e-254 < x2 < 1.4499999999999999e-173Initial program 61.9%
Taylor expanded in x2 around inf 48.7%
associate-/l*48.7%
unpow248.7%
+-commutative48.7%
unpow248.7%
fma-udef48.7%
Simplified48.7%
Taylor expanded in x1 around 0 50.1%
fma-def50.1%
fma-neg50.1%
unpow250.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in x2 around 0 49.6%
distribute-rgt1-in49.6%
metadata-eval49.6%
mul-1-neg49.6%
Simplified49.6%
if 1.4499999999999999e-173 < x2 Initial program 69.6%
Taylor expanded in x1 around 0 60.6%
Taylor expanded in x1 around 0 34.6%
*-commutative34.6%
Simplified34.6%
Final simplification33.3%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -1.05e-254) (* x2 -6.0) (if (<= x2 4e-172) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.05e-254) {
tmp = x2 * -6.0;
} else if (x2 <= 4e-172) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-1.05d-254)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 4d-172) then
tmp = -x1
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.05e-254) {
tmp = x2 * -6.0;
} else if (x2 <= 4e-172) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.05e-254: tmp = x2 * -6.0 elif x2 <= 4e-172: tmp = -x1 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.05e-254) tmp = Float64(x2 * -6.0); elseif (x2 <= 4e-172) tmp = Float64(-x1); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.05e-254) tmp = x2 * -6.0; elseif (x2 <= 4e-172) tmp = -x1; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.05e-254], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 4e-172], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-254}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 4 \cdot 10^{-172}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.04999999999999998e-254 or 4.0000000000000002e-172 < x2 Initial program 70.3%
Taylor expanded in x1 around 0 57.5%
Taylor expanded in x1 around 0 30.4%
*-commutative30.4%
Simplified30.4%
Taylor expanded in x1 around 0 30.4%
*-commutative30.4%
Simplified30.4%
if -1.04999999999999998e-254 < x2 < 4.0000000000000002e-172Initial program 61.9%
Taylor expanded in x2 around inf 48.7%
associate-/l*48.7%
unpow248.7%
+-commutative48.7%
unpow248.7%
fma-udef48.7%
Simplified48.7%
Taylor expanded in x1 around 0 50.1%
fma-def50.1%
fma-neg50.1%
unpow250.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in x2 around 0 49.6%
distribute-rgt1-in49.6%
metadata-eval49.6%
mul-1-neg49.6%
Simplified49.6%
Final simplification33.0%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 69.1%
Taylor expanded in x2 around inf 49.8%
associate-/l*49.4%
unpow249.4%
+-commutative49.4%
unpow249.4%
fma-udef49.4%
Simplified49.4%
Taylor expanded in x1 around 0 54.2%
fma-def54.3%
fma-neg54.3%
unpow254.3%
metadata-eval54.3%
Simplified54.3%
Taylor expanded in x2 around 0 39.5%
associate-+r+39.5%
+-commutative39.5%
associate-+l+39.5%
distribute-rgt1-in39.5%
metadata-eval39.5%
mul-1-neg39.5%
sub-neg39.5%
*-commutative39.5%
Simplified39.5%
Final simplification39.5%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 69.1%
Taylor expanded in x2 around inf 49.8%
associate-/l*49.4%
unpow249.4%
+-commutative49.4%
unpow249.4%
fma-udef49.4%
Simplified49.4%
Taylor expanded in x1 around 0 54.2%
fma-def54.3%
fma-neg54.3%
unpow254.3%
metadata-eval54.3%
Simplified54.3%
Taylor expanded in x2 around 0 13.7%
distribute-rgt1-in13.7%
metadata-eval13.7%
mul-1-neg13.7%
Simplified13.7%
Final simplification13.7%
(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 69.1%
Taylor expanded in x1 around 0 56.3%
Taylor expanded in x1 around 0 26.7%
*-commutative26.7%
Simplified26.7%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2023279
(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))))))