
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (fma (* x1 3.0) x1 (+ x2 x2)) x1))
(t_1 (/ (fma x1 x1 1.0) t_0))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ t_0 (fma x1 x1 1.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_4))
(t_6 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_4))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_4
(+
(* (* (* x1 2.0) t_5) (- t_5 3.0))
(* (* x1 x1) (- (* t_5 4.0) 6.0))))
(* t_2 t_5))
(* x1 (* x1 x1))))
t_6))
INFINITY)
(+
x1
(+
t_6
(+
x1
(+
(pow x1 3.0)
(fma
(fma
(/ (* x1 2.0) t_1)
(+ -3.0 t_3)
(* x1 (* x1 (fma 4.0 t_3 -6.0))))
(fma x1 x1 1.0)
(/ (* 3.0 (* x1 x1)) t_1))))))
(+ (* x1 2.0) (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = fma((x1 * 3.0), x1, (x2 + x2)) - x1;
double t_1 = fma(x1, x1, 1.0) / t_0;
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_0 / fma(x1, x1, 1.0);
double t_4 = (x1 * x1) + 1.0;
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_4;
double t_6 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_4);
double tmp;
if ((x1 + ((x1 + (((t_4 * ((((x1 * 2.0) * t_5) * (t_5 - 3.0)) + ((x1 * x1) * ((t_5 * 4.0) - 6.0)))) + (t_2 * t_5)) + (x1 * (x1 * x1)))) + t_6)) <= ((double) INFINITY)) {
tmp = x1 + (t_6 + (x1 + (pow(x1, 3.0) + fma(fma(((x1 * 2.0) / t_1), (-3.0 + t_3), (x1 * (x1 * fma(4.0, t_3, -6.0)))), fma(x1, x1, 1.0), ((3.0 * (x1 * x1)) / t_1)))));
} else {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(fma(Float64(x1 * 3.0), x1, Float64(x2 + x2)) - x1) t_1 = Float64(fma(x1, x1, 1.0) / t_0) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_0 / fma(x1, x1, 1.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_4) t_6 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_4)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(t_5 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)))) + Float64(t_2 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + t_6)) <= Inf) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64((x1 ^ 3.0) + fma(fma(Float64(Float64(x1 * 2.0) / t_1), Float64(-3.0 + t_3), Float64(x1 * Float64(x1 * fma(4.0, t_3, -6.0)))), fma(x1, x1, 1.0), Float64(Float64(3.0 * Float64(x1 * x1)) / t_1)))))); else tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(x2 + x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1 + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(t$95$5 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$6 + N[(x1 + N[(N[Power[x1, 3.0], $MachinePrecision] + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(-3.0 + t$95$3), $MachinePrecision] + N[(x1 * N[(x1 * N[(4.0 * t$95$3 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot 3, x1, x2 + x2\right) - x1\\
t_1 := \frac{\mathsf{fma}\left(x1, x1, 1\right)}{t_0}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_4}\\
t_6 := 3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_4}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(t_5 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_5 \cdot 4 - 6\right)\right) + t_2 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + t_6\right) \leq \infty:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left({x1}^{3} + \mathsf{fma}\left(\mathsf{fma}\left(\frac{x1 \cdot 2}{t_1}, -3 + t_3, x1 \cdot \left(x1 \cdot \mathsf{fma}\left(4, t_3, -6\right)\right)\right), \mathsf{fma}\left(x1, x1, 1\right), \frac{3 \cdot \left(x1 \cdot x1\right)}{t_1}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot 2 + 6 \cdot {x1}^{4}\\
\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%
Applied egg-rr90.0%
Simplified99.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 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x1 around inf 97.3%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
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 2.0) (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (x1 * 2.0) + (6.0 * Math.pow(x1, 4.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = (x1 * 2.0) + (6.0 * math.pow(x1, 4.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = (x1 * 2.0) + (6.0 * (x1 ^ 4.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
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 \cdot 2 + 6 \cdot {x1}^{4}\\
\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 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in x1 around inf 97.3%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_3 t_4))
t_1))
9.0))))
(if (<= x1 -1.22e+53)
(+ (* x1 2.0) (* 6.0 (pow x1 4.0)))
(if (<= x1 -0.00112)
t_5
(if (<= x1 -8.4e-166)
t_2
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 1.1e-27)
t_2
(if (<= x1 4.2e+69)
t_5
(+
x1
(+
(+ x1 (+ t_1 (+ (* t_0 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
(* 3.0 (* x2 -2.0))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_3 * t_4)) + t_1)) + 9.0);
double tmp;
if (x1 <= -1.22e+53) {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
} else if (x1 <= -0.00112) {
tmp = t_5;
} else if (x1 <= -8.4e-166) {
tmp = t_2;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 1.1e-27) {
tmp = t_2;
} else if (x1 <= 4.2e+69) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + ((x1 + (((t_0 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)))) + (t_3 * t_4)) + t_1)) + 9.0d0)
if (x1 <= (-1.22d+53)) then
tmp = (x1 * 2.0d0) + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= (-0.00112d0)) then
tmp = t_5
else if (x1 <= (-8.4d-166)) then
tmp = t_2
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 1.1d-27) then
tmp = t_2
else if (x1 <= 4.2d+69) then
tmp = t_5
else
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + (3.0d0 * (x2 * (-2.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_3 * t_4)) + t_1)) + 9.0);
double tmp;
if (x1 <= -1.22e+53) {
tmp = (x1 * 2.0) + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= -0.00112) {
tmp = t_5;
} else if (x1 <= -8.4e-166) {
tmp = t_2;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 1.1e-27) {
tmp = t_2;
} else if (x1 <= 4.2e+69) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (t_1 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_3 * t_4)) + t_1)) + 9.0) tmp = 0 if x1 <= -1.22e+53: tmp = (x1 * 2.0) + (6.0 * math.pow(x1, 4.0)) elif x1 <= -0.00112: tmp = t_5 elif x1 <= -8.4e-166: tmp = t_2 elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 1.1e-27: tmp = t_2 elif x1 <= 4.2e+69: tmp = t_5 else: tmp = x1 + ((x1 + (t_1 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + Float64(t_3 * t_4)) + t_1)) + 9.0)) tmp = 0.0 if (x1 <= -1.22e+53) tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= -0.00112) tmp = t_5; elseif (x1 <= -8.4e-166) tmp = t_2; elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 1.1e-27) tmp = t_2; elseif (x1 <= 4.2e+69) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(Float64(t_0 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_3 * t_4)) + t_1)) + 9.0); tmp = 0.0; if (x1 <= -1.22e+53) tmp = (x1 * 2.0) + (6.0 * (x1 ^ 4.0)); elseif (x1 <= -0.00112) tmp = t_5; elseif (x1 <= -8.4e-166) tmp = t_2; elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 1.1e-27) tmp = t_2; elseif (x1 <= 4.2e+69) tmp = t_5; else tmp = x1 + ((x1 + (t_1 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.22e+53], N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00112], t$95$5, If[LessEqual[x1, -8.4e-166], t$95$2, If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.1e-27], t$95$2, If[LessEqual[x1, 4.2e+69], t$95$5, N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(N[(t$95$0 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := x1 + \left(\left(x1 + \left(\left(t_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\right) + t_3 \cdot t_4\right) + t_1\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\
\;\;\;\;x1 \cdot 2 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq -0.00112:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 1.1 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_1 + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x1 < -1.21999999999999999e53Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x1 around inf 98.2%
if -1.21999999999999999e53 < x1 < -0.0011199999999999999 or 1.09999999999999993e-27 < x1 < 4.2000000000000003e69Initial program 96.2%
Taylor expanded in x1 around inf 96.3%
if -0.0011199999999999999 < x1 < -8.3999999999999998e-166 or 4.89999999999999975e-285 < x1 < 1.09999999999999993e-27Initial program 99.3%
Taylor expanded in x1 around 0 90.7%
Taylor expanded in x1 around 0 91.2%
if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.2000000000000003e69 < x1 Initial program 47.1%
Taylor expanded in x1 around 0 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in x1 around inf 47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x1 around inf 98.1%
*-commutative98.1%
unpow298.1%
Simplified98.1%
Final simplification95.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -4e+101)
(+ (* x1 2.0) (* 6.0 (pow x1 4.0)))
(if (<= x1 2.6e+67)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
t_0
(+
(* t_1 t_3)
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (- t_3 3.0) (* (* x1 2.0) (+ x2 (- x2 x1)))))))))))
(+
x1
(+
(+ x1 (+ t_0 (+ (* t_2 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
(* 3.0 (* x2 -2.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 tmp;
if (x1 <= -4e+101) {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
} else if (x1 <= 2.6e+67) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * (x2 + (x2 - x1))))))))));
} else {
tmp = x1 + ((x1 + (t_0 + ((t_2 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-4d+101)) then
tmp = (x1 * 2.0d0) + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= 2.6d+67) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * (x2 + (x2 - x1))))))))))
else
tmp = x1 + ((x1 + (t_0 + ((t_2 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + (3.0d0 * (x2 * (-2.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -4e+101) {
tmp = (x1 * 2.0) + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= 2.6e+67) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * (x2 + (x2 - x1))))))))));
} else {
tmp = x1 + ((x1 + (t_0 + ((t_2 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -4e+101: tmp = (x1 * 2.0) + (6.0 * math.pow(x1, 4.0)) elif x1 <= 2.6e+67: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * (x2 + (x2 - x1)))))))))) else: tmp = x1 + ((x1 + (t_0 + ((t_2 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.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) tmp = 0.0 if (x1 <= -4e+101) tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= 2.6e+67) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x2 + Float64(x2 - x1))))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(Float64(t_2 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -4e+101) tmp = (x1 * 2.0) + (6.0 * (x1 ^ 4.0)); elseif (x1 <= 2.6e+67) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + (t_0 + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * (x2 + (x2 - x1)))))))))); else tmp = x1 + ((x1 + (t_0 + ((t_2 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -4e+101], N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.6e+67], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x2 + N[(x2 - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(N[(t$95$2 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+101}:\\
\;\;\;\;x1 \cdot 2 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 2.6 \cdot 10^{+67}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(t_0 + \left(t_1 \cdot t_3 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right) + \left(t_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 + \left(x2 - x1\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_0 + \left(t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x1 < -3.9999999999999999e101Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in x1 around inf 97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in x1 around inf 97.8%
if -3.9999999999999999e101 < x1 < 2.6e67Initial program 98.7%
Taylor expanded in x1 around 0 95.2%
+-commutative95.2%
count-295.2%
associate-+l+95.2%
mul-1-neg95.2%
unsub-neg95.2%
Simplified95.2%
if 2.6e67 < x1 Initial program 49.0%
Taylor expanded in x1 around 0 49.0%
*-commutative49.0%
Simplified49.0%
Taylor expanded in x1 around inf 47.4%
*-commutative47.4%
unpow247.4%
Simplified47.4%
Taylor expanded in x1 around inf 96.5%
*-commutative96.5%
unpow296.5%
Simplified96.5%
Final simplification96.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (* x2 -2.0)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_4 (* (* x1 2.0) t_3))
(t_5 (* x1 (* x1 x1)))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0))))
(if (<= x1 -1.7e+51)
(+ (* x1 2.0) (* 6.0 (pow x1 4.0)))
(if (<= x1 -0.00063)
(+
x1
(+
t_2
(+
x1
(+ t_5 (+ (* t_1 (+ (* t_4 (- t_3 3.0)) t_6)) (* t_0 (+ x2 x2)))))))
(if (<= x1 -1.05e-165)
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 41000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
(if (<= x1 4.2e+69)
(+
x1
(+
t_2
(+
x1
(+
t_5
(+ (* t_0 t_3) (* t_1 (+ t_6 (* t_4 (/ -1.0 x1)))))))))
(+
x1
(+
(+ x1 (+ t_5 (+ (* t_1 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
t_2))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (x2 * -2.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = x1 * (x1 * x1);
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.7e+51) {
tmp = (x1 * 2.0) + (6.0 * pow(x1, 4.0));
} else if (x1 <= -0.00063) {
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_1 * ((t_4 * (t_3 - 3.0)) + t_6)) + (t_0 * (x2 + x2))))));
} else if (x1 <= -1.05e-165) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 41000.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_0 * t_3) + (t_1 * (t_6 + (t_4 * (-1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + (t_5 + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + 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) + 1.0d0
t_2 = 3.0d0 * (x2 * (-2.0d0))
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_4 = (x1 * 2.0d0) * t_3
t_5 = x1 * (x1 * x1)
t_6 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
if (x1 <= (-1.7d+51)) then
tmp = (x1 * 2.0d0) + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= (-0.00063d0)) then
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_1 * ((t_4 * (t_3 - 3.0d0)) + t_6)) + (t_0 * (x2 + x2))))))
else if (x1 <= (-1.05d-165)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 41000.0d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else if (x1 <= 4.2d+69) then
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_0 * t_3) + (t_1 * (t_6 + (t_4 * ((-1.0d0) / x1))))))))
else
tmp = x1 + ((x1 + (t_5 + ((t_1 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + 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 = 3.0 * (x2 * -2.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * 2.0) * t_3;
double t_5 = x1 * (x1 * x1);
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double tmp;
if (x1 <= -1.7e+51) {
tmp = (x1 * 2.0) + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= -0.00063) {
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_1 * ((t_4 * (t_3 - 3.0)) + t_6)) + (t_0 * (x2 + x2))))));
} else if (x1 <= -1.05e-165) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 41000.0) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = x1 + (t_2 + (x1 + (t_5 + ((t_0 * t_3) + (t_1 * (t_6 + (t_4 * (-1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + (t_5 + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_2);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (x2 * -2.0) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_4 = (x1 * 2.0) * t_3 t_5 = x1 * (x1 * x1) t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0) tmp = 0 if x1 <= -1.7e+51: tmp = (x1 * 2.0) + (6.0 * math.pow(x1, 4.0)) elif x1 <= -0.00063: tmp = x1 + (t_2 + (x1 + (t_5 + ((t_1 * ((t_4 * (t_3 - 3.0)) + t_6)) + (t_0 * (x2 + x2)))))) elif x1 <= -1.05e-165: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 41000.0: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) elif x1 <= 4.2e+69: tmp = x1 + (t_2 + (x1 + (t_5 + ((t_0 * t_3) + (t_1 * (t_6 + (t_4 * (-1.0 / x1)))))))) else: tmp = x1 + ((x1 + (t_5 + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + 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(3.0 * Float64(x2 * -2.0)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(Float64(x1 * 2.0) * t_3) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -1.7e+51) tmp = Float64(Float64(x1 * 2.0) + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= -0.00063) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_5 + Float64(Float64(t_1 * Float64(Float64(t_4 * Float64(t_3 - 3.0)) + t_6)) + Float64(t_0 * Float64(x2 + x2))))))); elseif (x1 <= -1.05e-165) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 41000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); elseif (x1 <= 4.2e+69) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(t_5 + Float64(Float64(t_0 * t_3) + Float64(t_1 * Float64(t_6 + Float64(t_4 * Float64(-1.0 / x1))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_5 + Float64(Float64(t_1 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + 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 = 3.0 * (x2 * -2.0); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_4 = (x1 * 2.0) * t_3; t_5 = x1 * (x1 * x1); t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -1.7e+51) tmp = (x1 * 2.0) + (6.0 * (x1 ^ 4.0)); elseif (x1 <= -0.00063) tmp = x1 + (t_2 + (x1 + (t_5 + ((t_1 * ((t_4 * (t_3 - 3.0)) + t_6)) + (t_0 * (x2 + x2)))))); elseif (x1 <= -1.05e-165) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 41000.0) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); elseif (x1 <= 4.2e+69) tmp = x1 + (t_2 + (x1 + (t_5 + ((t_0 * t_3) + (t_1 * (t_6 + (t_4 * (-1.0 / x1)))))))); else tmp = x1 + ((x1 + (t_5 + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + 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[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.7e+51], N[(N[(x1 * 2.0), $MachinePrecision] + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.00063], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$5 + N[(N[(t$95$1 * N[(N[(t$95$4 * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.05e-165], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 41000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e+69], N[(x1 + N[(t$95$2 + N[(x1 + N[(t$95$5 + N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$1 * N[(t$95$6 + N[(t$95$4 * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$5 + N[(N[(t$95$1 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 := 3 \cdot \left(x2 \cdot -2\right)\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_4 := \left(x1 \cdot 2\right) \cdot t_3\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -1.7 \cdot 10^{+51}:\\
\;\;\;\;x1 \cdot 2 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq -0.00063:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_5 + \left(t_1 \cdot \left(t_4 \cdot \left(t_3 - 3\right) + t_6\right) + t_0 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.05 \cdot 10^{-165}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 41000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(t_5 + \left(t_0 \cdot t_3 + t_1 \cdot \left(t_6 + t_4 \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_5 + \left(t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + t_2\right)\\
\end{array}
\end{array}
if x1 < -1.69999999999999992e51Initial program 21.0%
Taylor expanded in x1 around 0 21.0%
*-commutative21.0%
Simplified21.0%
Taylor expanded in x1 around inf 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in x1 around inf 96.5%
if -1.69999999999999992e51 < x1 < -6.30000000000000026e-4Initial program 99.3%
Taylor expanded in x1 around 0 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x1 around 0 86.6%
count-286.6%
Simplified86.6%
if -6.30000000000000026e-4 < x1 < -1.04999999999999997e-165Initial program 99.2%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 87.2%
if -1.04999999999999997e-165 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.89999999999999975e-285 < x1 < 41000Initial program 97.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
unpow291.7%
Simplified91.7%
if 41000 < x1 < 4.2000000000000003e69Initial program 99.1%
Taylor expanded in x1 around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x1 around inf 88.7%
if 4.2000000000000003e69 < x1 Initial program 47.1%
Taylor expanded in x1 around 0 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in x1 around inf 47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x1 around inf 98.1%
*-commutative98.1%
unpow298.1%
Simplified98.1%
Final simplification94.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
t_1
(+
x1
(+
t_2
(+
(* t_3 t_4)
(*
t_0
(+
(* (* x1 x1) (- (* t_4 4.0) 6.0))
(* (* (* x1 2.0) t_4) (/ -1.0 x1)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_1 (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -1.02e+15)
t_5
(if (<= x1 -8.4e-166)
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.4e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 8200000000.0)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
(if (<= x1 4.2e+69)
t_5
(+
x1
(+
(+ x1 (+ t_2 (+ (* t_0 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
t_1))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (t_1 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -1.02e+15) {
tmp = t_5;
} else if (x1 <= -8.4e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.4e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 8200000000.0) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (t_2 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + (t_1 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_4) * ((-1.0d0) / x1))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-1.02d+15)) then
tmp = t_5
else if (x1 <= (-8.4d-166)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.4d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 8200000000.0d0) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else if (x1 <= 4.2d+69) then
tmp = t_5
else
tmp = x1 + ((x1 + (t_2 + ((t_0 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + t_1)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + (t_1 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * (-1.0 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -1.02e+15) {
tmp = t_5;
} else if (x1 <= -8.4e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.4e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 8200000000.0) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = t_5;
} else {
tmp = x1 + ((x1 + (t_2 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1);
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + (t_1 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * (-1.0 / x1)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -1.02e+15: tmp = t_5 elif x1 <= -8.4e-166: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.4e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 8200000000.0: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) elif x1 <= 4.2e+69: tmp = t_5 else: tmp = x1 + ((x1 + (t_2 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(-1.0 / x1))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -1.02e+15) tmp = t_5; elseif (x1 <= -8.4e-166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.4e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 8200000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); elseif (x1 <= 4.2e+69) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + t_1)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + (t_1 + (x1 + (t_2 + ((t_3 * t_4) + (t_0 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (((x1 * 2.0) * t_4) * (-1.0 / x1)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -1.02e+15) tmp = t_5; elseif (x1 <= -8.4e-166) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.4e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 8200000000.0) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); elseif (x1 <= 4.2e+69) tmp = t_5; else tmp = x1 + ((x1 + (t_2 + ((t_0 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.02e+15], t$95$5, If[LessEqual[x1, -8.4e-166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.4e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8200000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e+69], t$95$5, N[(x1 + N[(N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t_3 + 2 \cdot x2\right) - x1}{t_0}\\
t_5 := x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_3 \cdot t_4 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.02 \cdot 10^{+15}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 8200000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_3 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_2 + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + t_1\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
unpow265.4%
Simplified65.4%
if -5.60000000000000037e102 < x1 < -1.02e15 or 8.2e9 < x1 < 4.2000000000000003e69Initial program 99.2%
Taylor expanded in x1 around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x1 around inf 89.0%
if -1.02e15 < x1 < -8.3999999999999998e-166Initial program 99.2%
Taylor expanded in x1 around 0 79.7%
Taylor expanded in x1 around 0 80.6%
if -8.3999999999999998e-166 < x1 < 4.3999999999999998e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.3999999999999998e-285 < x1 < 8.2e9Initial program 97.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
unpow291.7%
Simplified91.7%
if 4.2000000000000003e69 < x1 Initial program 47.1%
Taylor expanded in x1 around 0 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in x1 around inf 47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x1 around inf 98.1%
*-commutative98.1%
unpow298.1%
Simplified98.1%
Final simplification87.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* 3.0 (* x2 -2.0)))
(t_2 (* x1 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3))
(t_5 (* (* x1 2.0) t_4))
(t_6 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_1 (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -0.0022)
(+
x1
(+
t_1
(+
x1
(+ t_2 (+ (* t_3 (+ (* t_5 (- t_4 3.0)) t_6)) (* t_0 (+ x2 x2)))))))
(if (<= x1 -9.5e-166)
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 19.5)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
(if (<= x1 4.2e+69)
(+
x1
(+
t_1
(+
x1
(+
t_2
(+ (* t_0 t_4) (* t_3 (+ t_6 (* t_5 (/ -1.0 x1)))))))))
(+
x1
(+
(+ x1 (+ t_2 (+ (* t_3 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
t_1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -0.0022) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (x2 + x2))))));
} else if (x1 <= -9.5e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 19.5) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_4) + (t_3 * (t_6 + (t_5 * (-1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + (t_2 + ((t_3 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 3.0d0 * (x2 * (-2.0d0))
t_2 = x1 * (x1 * x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_3
t_5 = (x1 * 2.0d0) * t_4
t_6 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-0.0022d0)) then
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((t_5 * (t_4 - 3.0d0)) + t_6)) + (t_0 * (x2 + x2))))))
else if (x1 <= (-9.5d-166)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 19.5d0) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else if (x1 <= 4.2d+69) then
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_4) + (t_3 * (t_6 + (t_5 * ((-1.0d0) / x1))))))))
else
tmp = x1 + ((x1 + (t_2 + ((t_3 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + t_1)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 3.0 * (x2 * -2.0);
double t_2 = x1 * (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3;
double t_5 = (x1 * 2.0) * t_4;
double t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -0.0022) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (x2 + x2))))));
} else if (x1 <= -9.5e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 19.5) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else if (x1 <= 4.2e+69) {
tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_4) + (t_3 * (t_6 + (t_5 * (-1.0 / x1))))))));
} else {
tmp = x1 + ((x1 + (t_2 + ((t_3 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 3.0 * (x2 * -2.0) t_2 = x1 * (x1 * x1) t_3 = (x1 * x1) + 1.0 t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3 t_5 = (x1 * 2.0) * t_4 t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -0.0022: tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (x2 + x2)))))) elif x1 <= -9.5e-166: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 19.5: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) elif x1 <= 4.2e+69: tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_4) + (t_3 * (t_6 + (t_5 * (-1.0 / x1)))))))) else: tmp = x1 + ((x1 + (t_2 + ((t_3 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(3.0 * Float64(x2 * -2.0)) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(Float64(x1 * 2.0) * t_4) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -0.0022) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * Float64(Float64(t_5 * Float64(t_4 - 3.0)) + t_6)) + Float64(t_0 * Float64(x2 + x2))))))); elseif (x1 <= -9.5e-166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 19.5) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); elseif (x1 <= 4.2e+69) tmp = Float64(x1 + Float64(t_1 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * t_4) + Float64(t_3 * Float64(t_6 + Float64(t_5 * Float64(-1.0 / x1))))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + t_1)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 3.0 * (x2 * -2.0); t_2 = x1 * (x1 * x1); t_3 = (x1 * x1) + 1.0; t_4 = ((t_0 + (2.0 * x2)) - x1) / t_3; t_5 = (x1 * 2.0) * t_4; t_6 = (x1 * x1) * ((t_4 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_1 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -0.0022) tmp = x1 + (t_1 + (x1 + (t_2 + ((t_3 * ((t_5 * (t_4 - 3.0)) + t_6)) + (t_0 * (x2 + x2)))))); elseif (x1 <= -9.5e-166) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 19.5) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); elseif (x1 <= 4.2e+69) tmp = x1 + (t_1 + (x1 + (t_2 + ((t_0 * t_4) + (t_3 * (t_6 + (t_5 * (-1.0 / x1)))))))); else tmp = x1 + ((x1 + (t_2 + ((t_3 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_1); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$1 + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.0022], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * N[(N[(t$95$5 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.5e-166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 19.5], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.2e+69], N[(x1 + N[(t$95$1 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$3 * N[(t$95$6 + N[(t$95$5 * N[(-1.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 3 \cdot \left(x2 \cdot -2\right)\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_3}\\
t_5 := \left(x1 \cdot 2\right) \cdot t_4\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.0022:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_3 \cdot \left(t_5 \cdot \left(t_4 - 3\right) + t_6\right) + t_0 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -9.5 \cdot 10^{-166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 19.5:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_3} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;x1 + \left(t_1 + \left(x1 + \left(t_2 + \left(t_0 \cdot t_4 + t_3 \cdot \left(t_6 + t_5 \cdot \frac{-1}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_2 + \left(t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + t_1\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
unpow265.4%
Simplified65.4%
if -5.60000000000000037e102 < x1 < -0.00220000000000000013Initial program 99.4%
Taylor expanded in x1 around 0 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in x1 around 0 88.4%
count-288.4%
Simplified88.4%
if -0.00220000000000000013 < x1 < -9.50000000000000046e-166Initial program 99.2%
Taylor expanded in x1 around 0 86.6%
Taylor expanded in x1 around 0 87.2%
if -9.50000000000000046e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.89999999999999975e-285 < x1 < 19.5Initial program 97.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
unpow291.7%
Simplified91.7%
if 19.5 < x1 < 4.2000000000000003e69Initial program 99.1%
Taylor expanded in x1 around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x1 around inf 88.7%
if 4.2000000000000003e69 < x1 Initial program 47.1%
Taylor expanded in x1 around 0 47.1%
*-commutative47.1%
Simplified47.1%
Taylor expanded in x1 around inf 47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x1 around inf 98.1%
*-commutative98.1%
unpow298.1%
Simplified98.1%
Final simplification88.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+ (* t_1 (* (* x1 x1) 6.0)) (* (* x1 x1) 9.0))))
t_0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_0 (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -2.6e+34)
t_2
(if (<= x1 -8.5e-166)
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 650000.0)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
t_2)))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -2.6e+34) {
tmp = t_2;
} else if (x1 <= -8.5e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 650000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} 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) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((x1 * x1) * 6.0d0)) + ((x1 * x1) * 9.0d0)))) + t_0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-2.6d+34)) then
tmp = t_2
else if (x1 <= (-8.5d-166)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 650000.0d0) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -2.6e+34) {
tmp = t_2;
} else if (x1 <= -8.5e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 650000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -2.6e+34: tmp = t_2 elif x1 <= -8.5e-166: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 650000.0: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(x1 * x1) * 6.0)) + Float64(Float64(x1 * x1) * 9.0)))) + t_0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -2.6e+34) tmp = t_2; elseif (x1 <= -8.5e-166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 650000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((x1 * x1) * 6.0)) + ((x1 * x1) * 9.0)))) + t_0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -2.6e+34) tmp = t_2; elseif (x1 <= -8.5e-166) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 650000.0) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.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[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$0 + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.6e+34], t$95$2, If[LessEqual[x1, -8.5e-166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 650000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right) + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + t_0\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.6 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x1 \leq -8.5 \cdot 10^{-166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 650000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
unpow265.4%
Simplified65.4%
if -5.60000000000000037e102 < x1 < -2.59999999999999997e34 or 6.5e5 < x1 Initial program 65.9%
Taylor expanded in x1 around 0 65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x1 around inf 56.3%
*-commutative56.3%
unpow256.3%
Simplified56.3%
Taylor expanded in x1 around inf 88.7%
*-commutative88.7%
unpow288.7%
Simplified88.7%
if -2.59999999999999997e34 < x1 < -8.5e-166Initial program 99.2%
Taylor expanded in x1 around 0 76.6%
Taylor expanded in x1 around 0 77.6%
if -8.5e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.89999999999999975e-285 < x1 < 6.5e5Initial program 97.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
unpow291.7%
Simplified91.7%
Final simplification84.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (* x2 -2.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* t_2 (* (* x1 x1) 6.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ t_0 (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -23000000000000.0)
(+ x1 (+ t_0 (+ x1 (+ t_1 (+ t_3 (* x2 (* x1 (* x1 6.0))))))))
(if (<= x1 -8.4e-166)
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 96000000.0)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) t_2))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
(+ x1 (+ (+ x1 (+ t_1 (+ t_3 (* (* x1 x1) 9.0)))) t_0)))))))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = t_2 * ((x1 * x1) * 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -23000000000000.0) {
tmp = x1 + (t_0 + (x1 + (t_1 + (t_3 + (x2 * (x1 * (x1 * 6.0)))))));
} else if (x1 <= -8.4e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 96000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else {
tmp = x1 + ((x1 + (t_1 + (t_3 + ((x1 * x1) * 9.0)))) + t_0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = 3.0d0 * (x2 * (-2.0d0))
t_1 = x1 * (x1 * x1)
t_2 = (x1 * x1) + 1.0d0
t_3 = t_2 * ((x1 * x1) * 6.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-23000000000000.0d0)) then
tmp = x1 + (t_0 + (x1 + (t_1 + (t_3 + (x2 * (x1 * (x1 * 6.0d0)))))))
else if (x1 <= (-8.4d-166)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 96000000.0d0) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / t_2)) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else
tmp = x1 + ((x1 + (t_1 + (t_3 + ((x1 * x1) * 9.0d0)))) + t_0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 3.0 * (x2 * -2.0);
double t_1 = x1 * (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = t_2 * ((x1 * x1) * 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -23000000000000.0) {
tmp = x1 + (t_0 + (x1 + (t_1 + (t_3 + (x2 * (x1 * (x1 * 6.0)))))));
} else if (x1 <= -8.4e-166) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 96000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else {
tmp = x1 + ((x1 + (t_1 + (t_3 + ((x1 * x1) * 9.0)))) + t_0);
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * (x2 * -2.0) t_1 = x1 * (x1 * x1) t_2 = (x1 * x1) + 1.0 t_3 = t_2 * ((x1 * x1) * 6.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -23000000000000.0: tmp = x1 + (t_0 + (x1 + (t_1 + (t_3 + (x2 * (x1 * (x1 * 6.0))))))) elif x1 <= -8.4e-166: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 96000000.0: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) else: tmp = x1 + ((x1 + (t_1 + (t_3 + ((x1 * x1) * 9.0)))) + t_0) return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(x2 * -2.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(t_2 * Float64(Float64(x1 * x1) * 6.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -23000000000000.0) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_1 + Float64(t_3 + Float64(x2 * Float64(x1 * Float64(x1 * 6.0)))))))); elseif (x1 <= -8.4e-166) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 96000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(t_3 + Float64(Float64(x1 * x1) * 9.0)))) + t_0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 3.0 * (x2 * -2.0); t_1 = x1 * (x1 * x1); t_2 = (x1 * x1) + 1.0; t_3 = t_2 * ((x1 * x1) * 6.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (t_0 + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -23000000000000.0) tmp = x1 + (t_0 + (x1 + (t_1 + (t_3 + (x2 * (x1 * (x1 * 6.0))))))); elseif (x1 <= -8.4e-166) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 96000000.0) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / t_2)) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); else tmp = x1 + ((x1 + (t_1 + (t_3 + ((x1 * x1) * 9.0)))) + t_0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$0 + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -23000000000000.0], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$1 + N[(t$95$3 + N[(x2 * N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.4e-166], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 96000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(t$95$3 + N[(N[(x1 * x1), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x2 \cdot -2\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -23000000000000:\\
\;\;\;\;x1 + \left(t_0 + \left(x1 + \left(t_1 + \left(t_3 + x2 \cdot \left(x1 \cdot \left(x1 \cdot 6\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 96000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t_1 + \left(t_3 + \left(x1 \cdot x1\right) \cdot 9\right)\right)\right) + t_0\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.2%
Taylor expanded in x1 around 0 2.2%
*-commutative2.2%
Simplified2.2%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
unpow20.0%
Simplified0.0%
Taylor expanded in x1 around 0 65.4%
unpow265.4%
Simplified65.4%
if -5.60000000000000037e102 < x1 < -2.3e13Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around inf 79.8%
*-commutative79.8%
unpow279.8%
Simplified79.8%
Taylor expanded in x1 around 0 88.7%
*-commutative88.7%
*-commutative88.7%
associate-*l*88.7%
unpow288.7%
associate-*l*88.7%
Simplified88.7%
if -2.3e13 < x1 < -8.3999999999999998e-166Initial program 99.2%
Taylor expanded in x1 around 0 79.7%
Taylor expanded in x1 around 0 80.6%
if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.89999999999999975e-285 < x1 < 9.6e7Initial program 97.8%
Taylor expanded in x1 around 0 91.7%
Taylor expanded in x2 around inf 91.7%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
unpow291.7%
Simplified91.7%
if 9.6e7 < x1 Initial program 58.0%
Taylor expanded in x1 around 0 58.0%
*-commutative58.0%
Simplified58.0%
Taylor expanded in x1 around inf 49.0%
*-commutative49.0%
unpow249.0%
Simplified49.0%
Taylor expanded in x1 around inf 89.2%
*-commutative89.2%
unpow289.2%
Simplified89.2%
Final simplification85.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.15e+53)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -1.05e-165)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 1.35e+154)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* 2.0 (* x2 x2)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.15e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -1.05e-165) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.15d+53)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-1.05d-165)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (2.0d0 * (x2 * x2))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.15e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -1.05e-165) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.15e+53: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -1.05e-165: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.15e+53) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -1.05e-165) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(2.0 * Float64(x2 * x2))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.15e+53) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -1.05e-165) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (2.0 * (x2 * x2)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.15e+53], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.05e-165], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(2.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.05 \cdot 10^{-165}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(2 \cdot \left(x2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.1500000000000001e53Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 17.8%
*-commutative17.8%
unpow217.8%
Simplified17.8%
Taylor expanded in x1 around 0 54.5%
unpow254.5%
Simplified54.5%
if -1.1500000000000001e53 < x1 < -1.04999999999999997e-165Initial program 99.2%
Taylor expanded in x1 around 0 70.6%
Taylor expanded in x1 around 0 71.6%
if -1.04999999999999997e-165 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 4.89999999999999975e-285 < x1 < 1.35000000000000003e154Initial program 97.5%
Taylor expanded in x1 around 0 67.9%
Taylor expanded in x2 around inf 67.9%
associate-*r*67.9%
*-commutative67.9%
associate-*l*67.9%
unpow267.9%
Simplified67.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.8%
*-commutative6.8%
Simplified6.8%
flip-+74.1%
Applied egg-rr74.1%
swap-sqr74.1%
metadata-eval74.1%
*-commutative74.1%
Simplified74.1%
Final simplification69.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x2 -12.0) -1.0)))
(t_1
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -5.5e+66)
t_0
(if (<= x1 -8.4e-166)
t_1
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) t_0)
(if (<= x1 6.2e+147)
t_1
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + -1.0);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -5.5e+66) {
tmp = t_0;
} else if (x1 <= -8.4e-166) {
tmp = t_1;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= 6.2e+147) {
tmp = t_1;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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) :: t_1
real(8) :: tmp
t_0 = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-5.5d+66)) then
tmp = t_0
else if (x1 <= (-8.4d-166)) then
tmp = t_1
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + t_0
else if (x1 <= 6.2d+147) then
tmp = t_1
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + -1.0);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -5.5e+66) {
tmp = t_0;
} else if (x1 <= -8.4e-166) {
tmp = t_1;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= 6.2e+147) {
tmp = t_1;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x2 * -12.0) + -1.0) t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -5.5e+66: tmp = t_0 elif x1 <= -8.4e-166: tmp = t_1 elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + t_0 elif x1 <= 6.2e+147: tmp = t_1 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -5.5e+66) tmp = t_0; elseif (x1 <= -8.4e-166) tmp = t_1; elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + t_0); elseif (x1 <= 6.2e+147) tmp = t_1; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x2 * -12.0) + -1.0); t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -5.5e+66) tmp = t_0; elseif (x1 <= -8.4e-166) tmp = t_1; elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + t_0; elseif (x1 <= 6.2e+147) tmp = t_1; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+66], t$95$0, If[LessEqual[x1, -8.4e-166], t$95$1, If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, 6.2e+147], t$95$1, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x2 \cdot -12 + -1\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + t_0\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.5e66Initial program 13.4%
Taylor expanded in x1 around 0 2.0%
Taylor expanded in x2 around 0 7.8%
associate-*r*7.8%
Simplified7.8%
Taylor expanded in x1 around 0 22.1%
fma-def22.1%
*-commutative22.1%
fma-neg22.1%
metadata-eval22.1%
Simplified22.1%
Taylor expanded in x1 around inf 22.1%
if -5.5e66 < x1 < -8.3999999999999998e-166 or 4.89999999999999975e-285 < x1 < 6.2000000000000001e147Initial program 98.0%
Taylor expanded in x1 around 0 68.6%
Taylor expanded in x1 around 0 68.5%
if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 6.2000000000000001e147 < x1 Initial program 12.9%
Taylor expanded in x1 around 0 0.6%
Taylor expanded in x1 around 0 6.5%
*-commutative6.5%
Simplified6.5%
flip-+65.1%
Applied egg-rr65.1%
swap-sqr65.1%
metadata-eval65.1%
*-commutative65.1%
Simplified65.1%
Final simplification62.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -1.22e+53)
(+ x1 (+ (* 3.0 (* x2 -2.0)) (+ x1 (* (* x1 x1) (+ 6.0 (* x2 6.0))))))
(if (<= x1 -8.4e-166)
t_0
(if (<= x1 4.9e-285)
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))
(if (<= x1 7.6e+147)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -8.4e-166) {
tmp = t_0;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 7.6e+147) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-1.22d+53)) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * x1) * (6.0d0 + (x2 * 6.0d0)))))
else if (x1 <= (-8.4d-166)) then
tmp = t_0
else if (x1 <= 4.9d-285) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
else if (x1 <= 7.6d+147) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0)))));
} else if (x1 <= -8.4e-166) {
tmp = t_0;
} else if (x1 <= 4.9e-285) {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
} else if (x1 <= 7.6e+147) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -1.22e+53: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))) elif x1 <= -8.4e-166: tmp = t_0 elif x1 <= 4.9e-285: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) elif x1 <= 7.6e+147: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -1.22e+53) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(x2 * 6.0)))))); elseif (x1 <= -8.4e-166) tmp = t_0; elseif (x1 <= 4.9e-285) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); elseif (x1 <= 7.6e+147) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -1.22e+53) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * x1) * (6.0 + (x2 * 6.0))))); elseif (x1 <= -8.4e-166) tmp = t_0; elseif (x1 <= 4.9e-285) tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); elseif (x1 <= 7.6e+147) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.22e+53], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(x2 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -8.4e-166], t$95$0, If[LessEqual[x1, 4.9e-285], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.6e+147], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot x1\right) \cdot \left(6 + x2 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -8.4 \cdot 10^{-166}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 4.9 \cdot 10^{-285}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.21999999999999999e53Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 17.8%
*-commutative17.8%
unpow217.8%
Simplified17.8%
Taylor expanded in x1 around 0 54.5%
unpow254.5%
Simplified54.5%
if -1.21999999999999999e53 < x1 < -8.3999999999999998e-166 or 4.89999999999999975e-285 < x1 < 7.59999999999999941e147Initial program 98.0%
Taylor expanded in x1 around 0 70.5%
Taylor expanded in x1 around 0 70.3%
if -8.3999999999999998e-166 < x1 < 4.89999999999999975e-285Initial program 99.3%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around 0 99.3%
associate-*r*99.3%
Simplified99.3%
Taylor expanded in x1 around 0 99.7%
fma-def99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x1 around 0 99.8%
if 7.59999999999999941e147 < x1 Initial program 12.9%
Taylor expanded in x1 around 0 0.6%
Taylor expanded in x1 around 0 6.5%
*-commutative6.5%
Simplified6.5%
flip-+65.1%
Applied egg-rr65.1%
swap-sqr65.1%
metadata-eval65.1%
*-commutative65.1%
Simplified65.1%
Final simplification69.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x2 -12.0) -1.0))))
(if (<= x1 -1.2e+52)
t_0
(if (<= x1 -4.4e-27)
(* x1 (* x2 (* x2 8.0)))
(if (<= x1 8e-28)
(+ (* x2 -6.0) t_0)
(if (<= x1 1.35e+154)
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + -1.0);
double tmp;
if (x1 <= -1.2e+52) {
tmp = t_0;
} else if (x1 <= -4.4e-27) {
tmp = x1 * (x2 * (x2 * 8.0));
} else if (x1 <= 8e-28) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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 * ((x2 * (-12.0d0)) + (-1.0d0))
if (x1 <= (-1.2d+52)) then
tmp = t_0
else if (x1 <= (-4.4d-27)) then
tmp = x1 * (x2 * (x2 * 8.0d0))
else if (x1 <= 8d-28) then
tmp = (x2 * (-6.0d0)) + t_0
else if (x1 <= 1.35d+154) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + -1.0);
double tmp;
if (x1 <= -1.2e+52) {
tmp = t_0;
} else if (x1 <= -4.4e-27) {
tmp = x1 * (x2 * (x2 * 8.0));
} else if (x1 <= 8e-28) {
tmp = (x2 * -6.0) + t_0;
} else if (x1 <= 1.35e+154) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x2 * -12.0) + -1.0) tmp = 0 if x1 <= -1.2e+52: tmp = t_0 elif x1 <= -4.4e-27: tmp = x1 * (x2 * (x2 * 8.0)) elif x1 <= 8e-28: tmp = (x2 * -6.0) + t_0 elif x1 <= 1.35e+154: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)) tmp = 0.0 if (x1 <= -1.2e+52) tmp = t_0; elseif (x1 <= -4.4e-27) tmp = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))); elseif (x1 <= 8e-28) tmp = Float64(Float64(x2 * -6.0) + t_0); elseif (x1 <= 1.35e+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(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x2 * -12.0) + -1.0); tmp = 0.0; if (x1 <= -1.2e+52) tmp = t_0; elseif (x1 <= -4.4e-27) tmp = x1 * (x2 * (x2 * 8.0)); elseif (x1 <= 8e-28) tmp = (x2 * -6.0) + t_0; elseif (x1 <= 1.35e+154) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.2e+52], t$95$0, If[LessEqual[x1, -4.4e-27], N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 8e-28], N[(N[(x2 * -6.0), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x1, 1.35e+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[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -4.4 \cdot 10^{-27}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;x1 \leq 8 \cdot 10^{-28}:\\
\;\;\;\;x2 \cdot -6 + t_0\\
\mathbf{elif}\;x1 \leq 1.35 \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 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.2e52Initial program 19.5%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x2 around 0 7.2%
associate-*r*7.2%
Simplified7.2%
Taylor expanded in x1 around 0 20.8%
fma-def20.8%
*-commutative20.8%
fma-neg20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in x1 around inf 20.8%
if -1.2e52 < x1 < -4.39999999999999974e-27Initial program 99.3%
Taylor expanded in x1 around 0 45.4%
Taylor expanded in x2 around inf 45.4%
Taylor expanded in x2 around inf 45.6%
*-commutative45.6%
unpow245.6%
associate-*l*45.6%
associate-*l*45.6%
Simplified45.6%
if -4.39999999999999974e-27 < x1 < 7.99999999999999977e-28Initial program 99.3%
Taylor expanded in x1 around 0 87.4%
Taylor expanded in x2 around 0 76.3%
associate-*r*76.3%
Simplified76.3%
Taylor expanded in x1 around 0 76.8%
fma-def76.9%
*-commutative76.9%
fma-neg76.9%
metadata-eval76.9%
Simplified76.9%
Taylor expanded in x1 around 0 76.8%
if 7.99999999999999977e-28 < x1 < 1.35000000000000003e154Initial program 95.1%
Taylor expanded in x1 around 0 36.4%
Taylor expanded in x1 around inf 36.5%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 6.8%
*-commutative6.8%
Simplified6.8%
flip-+74.1%
Applied egg-rr74.1%
swap-sqr74.1%
metadata-eval74.1%
*-commutative74.1%
Simplified74.1%
Final simplification55.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x2 (* x2 8.0)))) (t_1 (+ x1 (* x2 -6.0))))
(if (<= x2 -1.36e+216)
t_0
(if (<= x2 -1.35e+126)
(* x2 -6.0)
(if (<= x2 -2e+57)
t_0
(if (<= x2 -1.92e-190)
t_1
(if (<= x2 3e-243) (- x1) (if (<= x2 2.4e+118) t_1 t_0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x2 * (x2 * 8.0));
double t_1 = x1 + (x2 * -6.0);
double tmp;
if (x2 <= -1.36e+216) {
tmp = t_0;
} else if (x2 <= -1.35e+126) {
tmp = x2 * -6.0;
} else if (x2 <= -2e+57) {
tmp = t_0;
} else if (x2 <= -1.92e-190) {
tmp = t_1;
} else if (x2 <= 3e-243) {
tmp = -x1;
} else if (x2 <= 2.4e+118) {
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 * (x2 * (x2 * 8.0d0))
t_1 = x1 + (x2 * (-6.0d0))
if (x2 <= (-1.36d+216)) then
tmp = t_0
else if (x2 <= (-1.35d+126)) then
tmp = x2 * (-6.0d0)
else if (x2 <= (-2d+57)) then
tmp = t_0
else if (x2 <= (-1.92d-190)) then
tmp = t_1
else if (x2 <= 3d-243) then
tmp = -x1
else if (x2 <= 2.4d+118) 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 * (x2 * (x2 * 8.0));
double t_1 = x1 + (x2 * -6.0);
double tmp;
if (x2 <= -1.36e+216) {
tmp = t_0;
} else if (x2 <= -1.35e+126) {
tmp = x2 * -6.0;
} else if (x2 <= -2e+57) {
tmp = t_0;
} else if (x2 <= -1.92e-190) {
tmp = t_1;
} else if (x2 <= 3e-243) {
tmp = -x1;
} else if (x2 <= 2.4e+118) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x2 * (x2 * 8.0)) t_1 = x1 + (x2 * -6.0) tmp = 0 if x2 <= -1.36e+216: tmp = t_0 elif x2 <= -1.35e+126: tmp = x2 * -6.0 elif x2 <= -2e+57: tmp = t_0 elif x2 <= -1.92e-190: tmp = t_1 elif x2 <= 3e-243: tmp = -x1 elif x2 <= 2.4e+118: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))) t_1 = Float64(x1 + Float64(x2 * -6.0)) tmp = 0.0 if (x2 <= -1.36e+216) tmp = t_0; elseif (x2 <= -1.35e+126) tmp = Float64(x2 * -6.0); elseif (x2 <= -2e+57) tmp = t_0; elseif (x2 <= -1.92e-190) tmp = t_1; elseif (x2 <= 3e-243) tmp = Float64(-x1); elseif (x2 <= 2.4e+118) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x2 * (x2 * 8.0)); t_1 = x1 + (x2 * -6.0); tmp = 0.0; if (x2 <= -1.36e+216) tmp = t_0; elseif (x2 <= -1.35e+126) tmp = x2 * -6.0; elseif (x2 <= -2e+57) tmp = t_0; elseif (x2 <= -1.92e-190) tmp = t_1; elseif (x2 <= 3e-243) tmp = -x1; elseif (x2 <= 2.4e+118) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1.36e+216], t$95$0, If[LessEqual[x2, -1.35e+126], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, -2e+57], t$95$0, If[LessEqual[x2, -1.92e-190], t$95$1, If[LessEqual[x2, 3e-243], (-x1), If[LessEqual[x2, 2.4e+118], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
t_1 := x1 + x2 \cdot -6\\
\mathbf{if}\;x2 \leq -1.36 \cdot 10^{+216}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -1.35 \cdot 10^{+126}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x2 \leq -1.92 \cdot 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\
\;\;\;\;-x1\\
\mathbf{elif}\;x2 \leq 2.4 \cdot 10^{+118}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x2 < -1.36000000000000007e216 or -1.35000000000000001e126 < x2 < -2.0000000000000001e57 or 2.4e118 < x2 Initial program 64.0%
Taylor expanded in x1 around 0 52.0%
Taylor expanded in x2 around inf 62.4%
Taylor expanded in x2 around inf 62.4%
*-commutative62.4%
unpow262.4%
associate-*l*62.4%
associate-*l*62.4%
Simplified62.4%
if -1.36000000000000007e216 < x2 < -1.35000000000000001e126Initial program 55.5%
Taylor expanded in x1 around 0 13.0%
Taylor expanded in x1 around 0 42.2%
*-commutative42.2%
Simplified42.2%
Taylor expanded in x1 around 0 42.2%
if -2.0000000000000001e57 < x2 < -1.9199999999999999e-190 or 3.0000000000000001e-243 < x2 < 2.4e118Initial program 79.3%
Taylor expanded in x1 around 0 51.6%
Taylor expanded in x1 around 0 37.6%
*-commutative37.6%
Simplified37.6%
if -1.9199999999999999e-190 < x2 < 3.0000000000000001e-243Initial program 64.2%
Taylor expanded in x1 around 0 44.7%
Taylor expanded in x2 around 0 44.7%
associate-*r*44.7%
Simplified44.7%
Taylor expanded in x1 around 0 47.1%
fma-def47.1%
*-commutative47.1%
fma-neg47.1%
metadata-eval47.1%
Simplified47.1%
Taylor expanded in x2 around 0 40.5%
distribute-rgt1-in40.5%
metadata-eval40.5%
neg-mul-140.5%
Simplified40.5%
Final simplification45.9%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x2 -7.8e+183)
(and (not (<= x2 -3.6e+125))
(or (<= x2 -1e+57) (not (<= x2 9.5e+111)))))
(+ x1 (* 8.0 (* x2 (* x1 x2))))
(+ (* x2 -6.0) (* x1 (+ (* x2 -12.0) -1.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.8e+183) || (!(x2 <= -3.6e+125) && ((x2 <= -1e+57) || !(x2 <= 9.5e+111)))) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-7.8d+183)) .or. (.not. (x2 <= (-3.6d+125))) .and. (x2 <= (-1d+57)) .or. (.not. (x2 <= 9.5d+111))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.8e+183) || (!(x2 <= -3.6e+125) && ((x2 <= -1e+57) || !(x2 <= 9.5e+111)))) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -7.8e+183) or (not (x2 <= -3.6e+125) and ((x2 <= -1e+57) or not (x2 <= 9.5e+111))): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -7.8e+183) || (!(x2 <= -3.6e+125) && ((x2 <= -1e+57) || !(x2 <= 9.5e+111)))) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -7.8e+183) || (~((x2 <= -3.6e+125)) && ((x2 <= -1e+57) || ~((x2 <= 9.5e+111))))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = (x2 * -6.0) + (x1 * ((x2 * -12.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -7.8e+183], And[N[Not[LessEqual[x2, -3.6e+125]], $MachinePrecision], Or[LessEqual[x2, -1e+57], N[Not[LessEqual[x2, 9.5e+111]], $MachinePrecision]]]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.8 \cdot 10^{+183} \lor \neg \left(x2 \leq -3.6 \cdot 10^{+125}\right) \land \left(x2 \leq -1 \cdot 10^{+57} \lor \neg \left(x2 \leq 9.5 \cdot 10^{+111}\right)\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\end{array}
\end{array}
if x2 < -7.7999999999999998e183 or -3.6000000000000003e125 < x2 < -1.00000000000000005e57 or 9.50000000000000019e111 < x2 Initial program 62.9%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around inf 57.3%
pow157.3%
unpow257.3%
Applied egg-rr57.3%
unpow157.3%
*-commutative57.3%
associate-*l*63.8%
Simplified63.8%
if -7.7999999999999998e183 < x2 < -3.6000000000000003e125 or -1.00000000000000005e57 < x2 < 9.50000000000000019e111Initial program 74.8%
Taylor expanded in x1 around 0 47.8%
Taylor expanded in x2 around 0 49.0%
associate-*r*49.0%
Simplified49.0%
Taylor expanded in x1 around 0 50.4%
fma-def50.5%
*-commutative50.5%
fma-neg50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in x1 around 0 50.4%
Final simplification55.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.22e+53)
(* x1 (+ (* x2 -12.0) -1.0))
(if (or (<= x1 -2.1e-126) (not (<= x1 3.5e-158)))
(+ x1 (* 8.0 (* x2 (* x1 x2))))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if ((x1 <= -2.1e-126) || !(x1 <= 3.5e-158)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.22d+53)) then
tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
else if ((x1 <= (-2.1d-126)) .or. (.not. (x1 <= 3.5d-158))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if ((x1 <= -2.1e-126) || !(x1 <= 3.5e-158)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.22e+53: tmp = x1 * ((x2 * -12.0) + -1.0) elif (x1 <= -2.1e-126) or not (x1 <= 3.5e-158): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.22e+53) tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)); elseif ((x1 <= -2.1e-126) || !(x1 <= 3.5e-158)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.22e+53) tmp = x1 * ((x2 * -12.0) + -1.0); elseif ((x1 <= -2.1e-126) || ~((x1 <= 3.5e-158))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.22e+53], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -2.1e-126], N[Not[LessEqual[x1, 3.5e-158]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq -2.1 \cdot 10^{-126} \lor \neg \left(x1 \leq 3.5 \cdot 10^{-158}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.21999999999999999e53Initial program 19.5%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x2 around 0 7.2%
associate-*r*7.2%
Simplified7.2%
Taylor expanded in x1 around 0 20.8%
fma-def20.8%
*-commutative20.8%
fma-neg20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in x1 around inf 20.8%
if -1.21999999999999999e53 < x1 < -2.0999999999999999e-126 or 3.50000000000000012e-158 < x1 Initial program 78.8%
Taylor expanded in x1 around 0 49.8%
Taylor expanded in x2 around inf 40.0%
pow140.0%
unpow240.0%
Applied egg-rr40.0%
unpow140.0%
*-commutative40.0%
associate-*l*43.8%
Simplified43.8%
if -2.0999999999999999e-126 < x1 < 3.50000000000000012e-158Initial program 99.3%
Taylor expanded in x1 around 0 86.4%
Taylor expanded in x1 around 0 71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in x1 around 0 71.7%
Final simplification45.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.05e+53)
(* x1 (+ (* x2 -12.0) -1.0))
(if (<= x1 -4.3e-109)
(* x1 (* x2 (* x2 8.0)))
(if (<= x1 5.7e-158) (* x2 -6.0) (* x1 (+ 1.0 (* (* x2 x2) 8.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if (x1 <= -4.3e-109) {
tmp = x1 * (x2 * (x2 * 8.0));
} else if (x1 <= 5.7e-158) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (1.0 + ((x2 * x2) * 8.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.05d+53)) then
tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
else if (x1 <= (-4.3d-109)) then
tmp = x1 * (x2 * (x2 * 8.0d0))
else if (x1 <= 5.7d-158) then
tmp = x2 * (-6.0d0)
else
tmp = x1 * (1.0d0 + ((x2 * x2) * 8.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.05e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if (x1 <= -4.3e-109) {
tmp = x1 * (x2 * (x2 * 8.0));
} else if (x1 <= 5.7e-158) {
tmp = x2 * -6.0;
} else {
tmp = x1 * (1.0 + ((x2 * x2) * 8.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.05e+53: tmp = x1 * ((x2 * -12.0) + -1.0) elif x1 <= -4.3e-109: tmp = x1 * (x2 * (x2 * 8.0)) elif x1 <= 5.7e-158: tmp = x2 * -6.0 else: tmp = x1 * (1.0 + ((x2 * x2) * 8.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.05e+53) tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)); elseif (x1 <= -4.3e-109) tmp = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))); elseif (x1 <= 5.7e-158) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 * Float64(1.0 + Float64(Float64(x2 * x2) * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.05e+53) tmp = x1 * ((x2 * -12.0) + -1.0); elseif (x1 <= -4.3e-109) tmp = x1 * (x2 * (x2 * 8.0)); elseif (x1 <= 5.7e-158) tmp = x2 * -6.0; else tmp = x1 * (1.0 + ((x2 * x2) * 8.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.05e+53], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.3e-109], N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.7e-158], N[(x2 * -6.0), $MachinePrecision], N[(x1 * N[(1.0 + N[(N[(x2 * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.05 \cdot 10^{+53}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq -4.3 \cdot 10^{-109}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;x1 \leq 5.7 \cdot 10^{-158}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(1 + \left(x2 \cdot x2\right) \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -1.0500000000000001e53Initial program 19.5%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x2 around 0 7.2%
associate-*r*7.2%
Simplified7.2%
Taylor expanded in x1 around 0 20.8%
fma-def20.8%
*-commutative20.8%
fma-neg20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in x1 around inf 20.8%
if -1.0500000000000001e53 < x1 < -4.2999999999999997e-109Initial program 99.3%
Taylor expanded in x1 around 0 68.5%
Taylor expanded in x2 around inf 39.8%
Taylor expanded in x2 around inf 40.0%
*-commutative40.0%
unpow240.0%
associate-*l*40.0%
associate-*l*40.0%
Simplified40.0%
if -4.2999999999999997e-109 < x1 < 5.69999999999999982e-158Initial program 99.2%
Taylor expanded in x1 around 0 84.3%
Taylor expanded in x1 around 0 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in x1 around 0 69.1%
if 5.69999999999999982e-158 < x1 Initial program 71.2%
Taylor expanded in x1 around 0 43.5%
Taylor expanded in x2 around inf 41.4%
Taylor expanded in x1 around 0 41.4%
unpow241.4%
Simplified41.4%
Final simplification43.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.22e+53)
(* x1 (+ (* x2 -12.0) -1.0))
(if (or (<= x1 -5.5e-109) (not (<= x1 5.7e-158)))
(* x1 (* x2 (* x2 8.0)))
(* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if ((x1 <= -5.5e-109) || !(x1 <= 5.7e-158)) {
tmp = x1 * (x2 * (x2 * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.22d+53)) then
tmp = x1 * ((x2 * (-12.0d0)) + (-1.0d0))
else if ((x1 <= (-5.5d-109)) .or. (.not. (x1 <= 5.7d-158))) then
tmp = x1 * (x2 * (x2 * 8.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.22e+53) {
tmp = x1 * ((x2 * -12.0) + -1.0);
} else if ((x1 <= -5.5e-109) || !(x1 <= 5.7e-158)) {
tmp = x1 * (x2 * (x2 * 8.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.22e+53: tmp = x1 * ((x2 * -12.0) + -1.0) elif (x1 <= -5.5e-109) or not (x1 <= 5.7e-158): tmp = x1 * (x2 * (x2 * 8.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.22e+53) tmp = Float64(x1 * Float64(Float64(x2 * -12.0) + -1.0)); elseif ((x1 <= -5.5e-109) || !(x1 <= 5.7e-158)) tmp = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.22e+53) tmp = x1 * ((x2 * -12.0) + -1.0); elseif ((x1 <= -5.5e-109) || ~((x1 <= 5.7e-158))) tmp = x1 * (x2 * (x2 * 8.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.22e+53], N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -5.5e-109], N[Not[LessEqual[x1, 5.7e-158]], $MachinePrecision]], N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{+53}:\\
\;\;\;\;x1 \cdot \left(x2 \cdot -12 + -1\right)\\
\mathbf{elif}\;x1 \leq -5.5 \cdot 10^{-109} \lor \neg \left(x1 \leq 5.7 \cdot 10^{-158}\right):\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.21999999999999999e53Initial program 19.5%
Taylor expanded in x1 around 0 1.9%
Taylor expanded in x2 around 0 7.2%
associate-*r*7.2%
Simplified7.2%
Taylor expanded in x1 around 0 20.8%
fma-def20.8%
*-commutative20.8%
fma-neg20.8%
metadata-eval20.8%
Simplified20.8%
Taylor expanded in x1 around inf 20.8%
if -1.21999999999999999e53 < x1 < -5.5000000000000003e-109 or 5.69999999999999982e-158 < x1 Initial program 78.2%
Taylor expanded in x1 around 0 49.7%
Taylor expanded in x2 around inf 41.0%
Taylor expanded in x2 around inf 40.3%
*-commutative40.3%
unpow240.3%
associate-*l*40.3%
associate-*l*40.3%
Simplified40.3%
if -5.5000000000000003e-109 < x1 < 5.69999999999999982e-158Initial program 99.2%
Taylor expanded in x1 around 0 84.3%
Taylor expanded in x1 around 0 68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in x1 around 0 69.1%
Final simplification43.2%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -2.8e-190) (* x2 -6.0) (if (<= x2 3e-243) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -2.8e-190) {
tmp = x2 * -6.0;
} else if (x2 <= 3e-243) {
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 <= (-2.8d-190)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 3d-243) 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 <= -2.8e-190) {
tmp = x2 * -6.0;
} else if (x2 <= 3e-243) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -2.8e-190: tmp = x2 * -6.0 elif x2 <= 3e-243: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -2.8e-190) tmp = Float64(x2 * -6.0); elseif (x2 <= 3e-243) 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 <= -2.8e-190) tmp = x2 * -6.0; elseif (x2 <= 3e-243) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -2.8e-190], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3e-243], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{-190}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -2.80000000000000005e-190Initial program 66.4%
Taylor expanded in x1 around 0 40.8%
Taylor expanded in x1 around 0 27.8%
*-commutative27.8%
Simplified27.8%
Taylor expanded in x1 around 0 27.8%
if -2.80000000000000005e-190 < x2 < 3.0000000000000001e-243Initial program 64.2%
Taylor expanded in x1 around 0 44.7%
Taylor expanded in x2 around 0 44.7%
associate-*r*44.7%
Simplified44.7%
Taylor expanded in x1 around 0 47.1%
fma-def47.1%
*-commutative47.1%
fma-neg47.1%
metadata-eval47.1%
Simplified47.1%
Taylor expanded in x2 around 0 40.5%
distribute-rgt1-in40.5%
metadata-eval40.5%
neg-mul-140.5%
Simplified40.5%
if 3.0000000000000001e-243 < x2 Initial program 77.0%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x1 around 0 25.9%
*-commutative25.9%
Simplified25.9%
Final simplification29.0%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -2.8e-190) (* x2 -6.0) (if (<= x2 3e-243) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -2.8e-190) {
tmp = x2 * -6.0;
} else if (x2 <= 3e-243) {
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 <= (-2.8d-190)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 3d-243) 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 <= -2.8e-190) {
tmp = x2 * -6.0;
} else if (x2 <= 3e-243) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -2.8e-190: tmp = x2 * -6.0 elif x2 <= 3e-243: tmp = -x1 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -2.8e-190) tmp = Float64(x2 * -6.0); elseif (x2 <= 3e-243) tmp = Float64(-x1); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -2.8e-190) tmp = x2 * -6.0; elseif (x2 <= 3e-243) tmp = -x1; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -2.8e-190], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3e-243], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.8 \cdot 10^{-190}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 3 \cdot 10^{-243}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -2.80000000000000005e-190 or 3.0000000000000001e-243 < x2 Initial program 71.8%
Taylor expanded in x1 around 0 48.5%
Taylor expanded in x1 around 0 26.8%
*-commutative26.8%
Simplified26.8%
Taylor expanded in x1 around 0 26.7%
if -2.80000000000000005e-190 < x2 < 3.0000000000000001e-243Initial program 64.2%
Taylor expanded in x1 around 0 44.7%
Taylor expanded in x2 around 0 44.7%
associate-*r*44.7%
Simplified44.7%
Taylor expanded in x1 around 0 47.1%
fma-def47.1%
*-commutative47.1%
fma-neg47.1%
metadata-eval47.1%
Simplified47.1%
Taylor expanded in x2 around 0 40.5%
distribute-rgt1-in40.5%
metadata-eval40.5%
neg-mul-140.5%
Simplified40.5%
Final simplification28.9%
(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 70.6%
Taylor expanded in x1 around 0 47.9%
Taylor expanded in x2 around 0 36.1%
associate-*r*36.1%
Simplified36.1%
Taylor expanded in x1 around 0 41.8%
fma-def41.8%
*-commutative41.8%
fma-neg41.8%
metadata-eval41.8%
Simplified41.8%
Taylor expanded in x2 around 0 13.0%
distribute-rgt1-in13.0%
metadata-eval13.0%
neg-mul-113.0%
Simplified13.0%
Final simplification13.0%
(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 70.6%
Taylor expanded in x1 around 0 47.9%
Taylor expanded in x1 around 0 23.7%
*-commutative23.7%
Simplified23.7%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2023297
(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))))))