
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1)))))
(t_1 (fma x1 (fma 3.0 x1 -1.0) (* 2.0 x2)))
(t_2 (/ t_1 (fma x1 x1 1.0))))
(if (<= x1 -1.3e+101)
t_0
(if (<= x1 4.5e+30)
(fma
(/ (- (* 3.0 (* x1 x1)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
3.0
(+
x1
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_1 (/ 4.0 (fma x1 x1 1.0)) -6.0))
(* (+ -3.0 t_2) (/ (* 2.0 (* x1 t_1)) (fma x1 x1 1.0))))
(fma x1 (fma x1 x1 (* (* x1 3.0) t_2)) x1))))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)));
double t_1 = fma(x1, fma(3.0, x1, -1.0), (2.0 * x2));
double t_2 = t_1 / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -1.3e+101) {
tmp = t_0;
} else if (x1 <= 4.5e+30) {
tmp = fma((((3.0 * (x1 * x1)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_1, (4.0 / fma(x1, x1, 1.0)), -6.0)), ((-3.0 + t_2) * ((2.0 * (x1 * t_1)) / fma(x1, x1, 1.0)))), fma(x1, fma(x1, x1, ((x1 * 3.0) * t_2)), x1))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)))) t_1 = fma(x1, fma(3.0, x1, -1.0), Float64(2.0 * x2)) t_2 = Float64(t_1 / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -1.3e+101) tmp = t_0; elseif (x1 <= 4.5e+30) tmp = fma(Float64(Float64(Float64(3.0 * Float64(x1 * x1)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_1, Float64(4.0 / fma(x1, x1, 1.0)), -6.0)), Float64(Float64(-3.0 + t_2) * Float64(Float64(2.0 * Float64(x1 * t_1)) / fma(x1, x1, 1.0)))), fma(x1, fma(x1, x1, Float64(Float64(x1 * 3.0) * t_2)), x1)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(3.0 * x1 + -1.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.3e+101], t$95$0, If[LessEqual[x1, 4.5e+30], N[(N[(N[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * 3.0 + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$1 * N[(4.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-3.0 + t$95$2), $MachinePrecision] * N[(N[(2.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1 + N[(N[(x1 * 3.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
t_1 := \mathsf{fma}\left(x1, \mathsf{fma}\left(3, x1, -1\right), 2 \cdot x2\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{+101}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(\frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_1, \frac{4}{\mathsf{fma}\left(x1, x1, 1\right)}, -6\right), \left(-3 + t\_2\right) \cdot \frac{2 \cdot \left(x1 \cdot t\_1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, x1, \left(x1 \cdot 3\right) \cdot t\_2\right), x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.3e101 or 4.49999999999999995e30 < x1 Initial program 20.9%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites100.0%
if -1.3e101 < x1 < 4.49999999999999995e30Initial program 98.6%
Applied rewrites98.8%
Applied rewrites99.1%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* 8.0 (* x2 x2))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+224)
t_1
(if (<= t_4 -2.0)
(fma x2 -6.0 x1)
(if (<= t_4 -5e-129)
(* x1 (fma x1 9.0 -1.0))
(if (<= t_4 2e+228)
(* x2 -6.0)
(if (<= t_4 INFINITY) t_1 (fma x1 (* x1 9.0) x1))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (8.0 * (x2 * x2));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+224) {
tmp = t_1;
} else if (t_4 <= -2.0) {
tmp = fma(x2, -6.0, x1);
} else if (t_4 <= -5e-129) {
tmp = x1 * fma(x1, 9.0, -1.0);
} else if (t_4 <= 2e+228) {
tmp = x2 * -6.0;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(x1, (x1 * 9.0), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(8.0 * Float64(x2 * x2))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+224) tmp = t_1; elseif (t_4 <= -2.0) tmp = fma(x2, -6.0, x1); elseif (t_4 <= -5e-129) tmp = Float64(x1 * fma(x1, 9.0, -1.0)); elseif (t_4 <= 2e+228) tmp = Float64(x2 * -6.0); elseif (t_4 <= Inf) tmp = t_1; else tmp = fma(x1, Float64(x1 * 9.0), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $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$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+224], t$95$1, If[LessEqual[t$95$4, -2.0], N[(x2 * -6.0 + x1), $MachinePrecision], If[LessEqual[t$95$4, -5e-129], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+228], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 * N[(x1 * 9.0), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq -2:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-129}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1, x1 \cdot 9, x1\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999994e224 or 1.9999999999999998e228 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.9%
Taylor expanded in x1 around 0
Applied rewrites66.6%
Taylor expanded in x2 around 0
Applied rewrites64.9%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.2
Applied rewrites64.2%
if -1.99999999999999994e224 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -2Initial program 99.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6479.9
Applied rewrites79.9%
if -2 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -5.00000000000000027e-129Initial program 98.8%
Taylor expanded in x1 around 0
Applied rewrites99.7%
Taylor expanded in x2 around 0
Applied rewrites99.7%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6481.9
Applied rewrites81.9%
if -5.00000000000000027e-129 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.9999999999999998e228Initial program 99.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6452.7
Applied rewrites52.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6453.3
Applied rewrites53.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites56.9%
Taylor expanded in x2 around 0
Applied rewrites69.4%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in x1 around inf
distribute-rgt-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
*-lft-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Final simplification70.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
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 -2e+224)
(* x1 (* 8.0 (* x2 x2)))
(if (<= t_3 1e+245)
(fma x2 -6.0 (* x1 (fma x1 9.0 -1.0)))
(if (<= t_3 INFINITY)
(+ x1 (* 8.0 (* x1 (* x2 x2))))
(fma x1 (* x1 9.0) x1))))))
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 <= -2e+224) {
tmp = x1 * (8.0 * (x2 * x2));
} else if (t_3 <= 1e+245) {
tmp = fma(x2, -6.0, (x1 * fma(x1, 9.0, -1.0)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = x1 + (8.0 * (x1 * (x2 * x2)));
} else {
tmp = fma(x1, (x1 * 9.0), x1);
}
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 <= -2e+224) tmp = Float64(x1 * Float64(8.0 * Float64(x2 * x2))); elseif (t_3 <= 1e+245) tmp = fma(x2, -6.0, Float64(x1 * fma(x1, 9.0, -1.0))); elseif (t_3 <= Inf) tmp = Float64(x1 + Float64(8.0 * Float64(x1 * Float64(x2 * x2)))); else tmp = fma(x1, Float64(x1 * 9.0), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(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, -2e+224], N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+245], N[(x2 * -6.0 + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(x1 + N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0), $MachinePrecision] + x1), $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 -2 \cdot 10^{+224}:\\
\;\;\;\;x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+245}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;x1 + 8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1, x1 \cdot 9, x1\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999994e224Initial program 99.9%
Taylor expanded in x1 around 0
Applied rewrites80.4%
Taylor expanded in x2 around 0
Applied rewrites80.4%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.4
Applied rewrites80.4%
if -1.99999999999999994e224 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.00000000000000004e245Initial program 99.1%
Taylor expanded in x1 around 0
Applied rewrites79.1%
Taylor expanded in x2 around 0
Applied rewrites79.1%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites88.0%
Taylor expanded in x1 around 0
Applied rewrites80.1%
if 1.00000000000000004e245 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 100.0%
Taylor expanded in x1 around 0
Applied rewrites61.4%
Taylor expanded in x2 around inf
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.6
Applied rewrites57.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites56.9%
Taylor expanded in x2 around 0
Applied rewrites69.4%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in x1 around inf
distribute-rgt-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
*-lft-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Final simplification80.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* 8.0 (* x2 x2))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+224)
t_1
(if (<= t_4 1e+245)
(fma x2 -6.0 (* x1 (fma x1 9.0 -1.0)))
(if (<= t_4 INFINITY) t_1 (fma x1 (* x1 9.0) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (8.0 * (x2 * x2));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+224) {
tmp = t_1;
} else if (t_4 <= 1e+245) {
tmp = fma(x2, -6.0, (x1 * fma(x1, 9.0, -1.0)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(x1, (x1 * 9.0), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(8.0 * Float64(x2 * x2))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+224) tmp = t_1; elseif (t_4 <= 1e+245) tmp = fma(x2, -6.0, Float64(x1 * fma(x1, 9.0, -1.0))); elseif (t_4 <= Inf) tmp = t_1; else tmp = fma(x1, Float64(x1 * 9.0), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $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$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+224], t$95$1, If[LessEqual[t$95$4, 1e+245], N[(x2 * -6.0 + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 * N[(x1 * 9.0), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{+245}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1, x1 \cdot 9, x1\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999994e224 or 1.00000000000000004e245 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 100.0%
Taylor expanded in x1 around 0
Applied rewrites69.3%
Taylor expanded in x2 around 0
Applied rewrites67.5%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6466.8
Applied rewrites66.8%
if -1.99999999999999994e224 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.00000000000000004e245Initial program 99.1%
Taylor expanded in x1 around 0
Applied rewrites79.1%
Taylor expanded in x2 around 0
Applied rewrites79.1%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites88.0%
Taylor expanded in x1 around 0
Applied rewrites80.1%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites56.9%
Taylor expanded in x2 around 0
Applied rewrites69.4%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in x1 around inf
distribute-rgt-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
*-lft-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Final simplification80.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* 8.0 (* x2 x2))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+224)
t_1
(if (<= t_4 1e+245)
(fma x1 (fma x1 9.0 -1.0) (* x2 -6.0))
(if (<= t_4 INFINITY) t_1 (fma x1 (* x1 9.0) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (8.0 * (x2 * x2));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+224) {
tmp = t_1;
} else if (t_4 <= 1e+245) {
tmp = fma(x1, fma(x1, 9.0, -1.0), (x2 * -6.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(x1, (x1 * 9.0), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(8.0 * Float64(x2 * x2))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+224) tmp = t_1; elseif (t_4 <= 1e+245) tmp = fma(x1, fma(x1, 9.0, -1.0), Float64(x2 * -6.0)); elseif (t_4 <= Inf) tmp = t_1; else tmp = fma(x1, Float64(x1 * 9.0), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $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$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+224], t$95$1, If[LessEqual[t$95$4, 1e+245], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 * N[(x1 * 9.0), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+224}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{+245}:\\
\;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 9, -1\right), x2 \cdot -6\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1, x1 \cdot 9, x1\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999994e224 or 1.00000000000000004e245 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 100.0%
Taylor expanded in x1 around 0
Applied rewrites69.3%
Taylor expanded in x2 around 0
Applied rewrites67.5%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6466.8
Applied rewrites66.8%
if -1.99999999999999994e224 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 1.00000000000000004e245Initial program 99.1%
Applied rewrites99.3%
Taylor expanded in x1 around 0
Applied rewrites79.2%
Taylor expanded in x2 around 0
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6480.1
Applied rewrites80.1%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Applied rewrites56.9%
Taylor expanded in x2 around 0
Applied rewrites69.4%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in x1 around inf
distribute-rgt-inN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
*-lft-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
Final simplification80.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -2e+224)
(* x1 (* 8.0 (* x2 x2)))
(if (<= t_4 2e+208)
(fma x2 -6.0 (* x1 (fma x1 9.0 -1.0)))
(* 6.0 (* x1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -2e+224) {
tmp = x1 * (8.0 * (x2 * x2));
} else if (t_4 <= 2e+208) {
tmp = fma(x2, -6.0, (x1 * fma(x1, 9.0, -1.0)));
} else {
tmp = 6.0 * (x1 * t_0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -2e+224) tmp = Float64(x1 * Float64(8.0 * Float64(x2 * x2))); elseif (t_4 <= 2e+208) tmp = fma(x2, -6.0, Float64(x1 * fma(x1, 9.0, -1.0))); else tmp = Float64(6.0 * Float64(x1 * t_0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+224], N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+208], N[(x2 * -6.0 + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+224}:\\
\;\;\;\;x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x1 \cdot t\_0\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < -1.99999999999999994e224Initial program 99.9%
Taylor expanded in x1 around 0
Applied rewrites80.4%
Taylor expanded in x2 around 0
Applied rewrites80.4%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.4
Applied rewrites80.4%
if -1.99999999999999994e224 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < 2e208Initial program 99.1%
Taylor expanded in x1 around 0
Applied rewrites84.7%
Taylor expanded in x2 around 0
Applied rewrites84.7%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites93.4%
Taylor expanded in x1 around 0
Applied rewrites84.9%
if 2e208 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 30.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6489.1
Applied rewrites89.1%
lift-pow.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6489.0
lift-pow.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6489.0
Applied rewrites89.0%
Final simplification86.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (fma 3.0 x1 -1.0) (* 2.0 x2)))
(t_1 (/ t_0 (fma x1 x1 1.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_3
(+
(* (* (* x1 2.0) t_4) (- t_4 3.0))
(* (* x1 x1) (- (* t_4 4.0) 6.0))))
(* t_2 t_4))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3))))
INFINITY)
(+
x1
(+
x1
(fma
3.0
(/ (- t_2 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
(fma x1 x1 1.0)
(fma
(* (* x1 2.0) (+ -3.0 t_1))
t_1
(* x1 (* x1 (fma t_0 (/ 4.0 (fma x1 x1 1.0)) -6.0))))
(fma
x1
(* x1 x1)
(*
t_2
(/ (fma 2.0 x2 (fma x1 (* x1 3.0) (- x1))) (fma x1 x1 1.0))))))))
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1)))))))
double code(double x1, double x2) {
double t_0 = fma(x1, fma(3.0, x1, -1.0), (2.0 * x2));
double t_1 = t_0 / fma(x1, x1, 1.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double tmp;
if ((x1 + ((x1 + (((t_3 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + (t_2 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3)))) <= ((double) INFINITY)) {
tmp = x1 + (x1 + fma(3.0, ((t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(fma(x1, x1, 1.0), fma(((x1 * 2.0) * (-3.0 + t_1)), t_1, (x1 * (x1 * fma(t_0, (4.0 / fma(x1, x1, 1.0)), -6.0)))), fma(x1, (x1 * x1), (t_2 * (fma(2.0, x2, fma(x1, (x1 * 3.0), -x1)) / fma(x1, x1, 1.0)))))));
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, fma(3.0, x1, -1.0), Float64(2.0 * x2)) t_1 = Float64(t_0 / fma(x1, x1, 1.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_3 * 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_2 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)))) <= Inf) tmp = Float64(x1 + Float64(x1 + fma(3.0, Float64(Float64(t_2 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(fma(x1, x1, 1.0), fma(Float64(Float64(x1 * 2.0) * Float64(-3.0 + t_1)), t_1, Float64(x1 * Float64(x1 * fma(t_0, Float64(4.0 / fma(x1, x1, 1.0)), -6.0)))), fma(x1, Float64(x1 * x1), Float64(t_2 * Float64(fma(2.0, x2, fma(x1, Float64(x1 * 3.0), Float64(-x1))) / fma(x1, x1, 1.0)))))))); else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(3.0 * x1 + -1.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$3 * 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$2 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(x1 + N[(3.0 * N[(N[(t$95$2 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(-3.0 + t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(x1 * N[(x1 * N[(t$95$0 * N[(4.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision] + N[(t$95$2 * N[(N[(2.0 * x2 + N[(x1 * N[(x1 * 3.0), $MachinePrecision] + (-x1)), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(3, x1, -1\right), 2 \cdot x2\right)\\
t_1 := \frac{t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_3 \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\_2 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3}\right) \leq \infty:\\
\;\;\;\;x1 + \left(x1 + \mathsf{fma}\left(3, \frac{t\_2 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot \left(-3 + t\_1\right), t\_1, x1 \cdot \left(x1 \cdot \mathsf{fma}\left(t\_0, \frac{4}{\mathsf{fma}\left(x1, x1, 1\right)}, -6\right)\right)\right), \mathsf{fma}\left(x1, x1 \cdot x1, t\_2 \cdot \frac{\mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.3%
Applied rewrites95.5%
Applied rewrites99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites98.8%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1)))))
(t_1 (fma 2.0 x2 (fma x1 (* x1 3.0) (- x1))))
(t_2 (/ t_1 (fma x1 x1 1.0))))
(if (<= x1 -1.3e+101)
t_0
(if (<= x1 4.5e+30)
(+
x1
(+
x1
(fma
3.0
(/ (- (* x1 (* x1 3.0)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_2 4.0 -6.0))
(/ (* (+ -3.0 t_2) (* (* x1 2.0) t_1)) (fma x1 x1 1.0)))
(* x1 (* x1 x1))))))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)));
double t_1 = fma(2.0, x2, fma(x1, (x1 * 3.0), -x1));
double t_2 = t_1 / fma(x1, x1, 1.0);
double tmp;
if (x1 <= -1.3e+101) {
tmp = t_0;
} else if (x1 <= 4.5e+30) {
tmp = x1 + (x1 + fma(3.0, (((x1 * (x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_2, 4.0, -6.0)), (((-3.0 + t_2) * ((x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), (x1 * (x1 * x1)))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)))) t_1 = fma(2.0, x2, fma(x1, Float64(x1 * 3.0), Float64(-x1))) t_2 = Float64(t_1 / fma(x1, x1, 1.0)) tmp = 0.0 if (x1 <= -1.3e+101) tmp = t_0; elseif (x1 <= 4.5e+30) tmp = Float64(x1 + Float64(x1 + fma(3.0, Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_2, 4.0, -6.0)), Float64(Float64(Float64(-3.0 + t_2) * Float64(Float64(x1 * 2.0) * t_1)) / fma(x1, x1, 1.0))), Float64(x1 * Float64(x1 * x1)))))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * x2 + N[(x1 * N[(x1 * 3.0), $MachinePrecision] + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.3e+101], t$95$0, If[LessEqual[x1, 4.5e+30], N[(x1 + N[(x1 + N[(3.0 * N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-3.0 + t$95$2), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
t_1 := \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\\
t_2 := \frac{t\_1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{+101}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;x1 + \left(x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_2, 4, -6\right), \frac{\left(-3 + t\_2\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.3e101 or 4.49999999999999995e30 < x1 Initial program 20.9%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites100.0%
if -1.3e101 < x1 < 4.49999999999999995e30Initial program 98.6%
Applied rewrites98.8%
Taylor expanded in x1 around inf
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6497.9
Applied rewrites97.9%
Final simplification98.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1))))))
(if (<= x1 -2100000.0)
t_0
(if (<= x1 215000000.0)
(fma x2 (fma x1 (fma 8.0 x2 -12.0) -6.0) (* x1 (fma x1 9.0 -1.0)))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)));
double tmp;
if (x1 <= -2100000.0) {
tmp = t_0;
} else if (x1 <= 215000000.0) {
tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), (x1 * fma(x1, 9.0, -1.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)))) tmp = 0.0 if (x1 <= -2100000.0) tmp = t_0; elseif (x1 <= 215000000.0) tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), Float64(x1 * fma(x1, 9.0, -1.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2100000.0], t$95$0, If[LessEqual[x1, 215000000.0], N[(x2 * N[(x1 * N[(8.0 * x2 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
\mathbf{if}\;x1 \leq -2100000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 215000000:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(8, x2, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.1e6 or 2.15e8 < x1 Initial program 31.1%
Taylor expanded in x1 around -inf
lower-*.f64N/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites95.8%
if -2.1e6 < x1 < 2.15e8Initial program 98.6%
Taylor expanded in x1 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.2%
Final simplification97.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 (* x1 x1)))))
(if (<= x1 -145000000000.0)
(* 6.0 t_0)
(if (<= x1 215000000.0)
(fma x2 (fma x1 (fma 8.0 x2 -12.0) -6.0) (* x1 (fma x1 9.0 -1.0)))
(+ x1 (* t_0 (+ 6.0 (/ -3.0 x1))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * (x1 * x1));
double tmp;
if (x1 <= -145000000000.0) {
tmp = 6.0 * t_0;
} else if (x1 <= 215000000.0) {
tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), (x1 * fma(x1, 9.0, -1.0)));
} else {
tmp = x1 + (t_0 * (6.0 + (-3.0 / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * Float64(x1 * x1))) tmp = 0.0 if (x1 <= -145000000000.0) tmp = Float64(6.0 * t_0); elseif (x1 <= 215000000.0) tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), Float64(x1 * fma(x1, 9.0, -1.0))); else tmp = Float64(x1 + Float64(t_0 * Float64(6.0 + Float64(-3.0 / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -145000000000.0], N[(6.0 * t$95$0), $MachinePrecision], If[LessEqual[x1, 215000000.0], N[(x2 * N[(x1 * N[(8.0 * x2 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(t$95$0 * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{if}\;x1 \leq -145000000000:\\
\;\;\;\;6 \cdot t\_0\\
\mathbf{elif}\;x1 \leq 215000000:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(8, x2, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + t\_0 \cdot \left(6 + \frac{-3}{x1}\right)\\
\end{array}
\end{array}
if x1 < -1.45e11Initial program 19.2%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6494.7
Applied rewrites94.7%
lift-pow.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6494.7
lift-pow.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6494.7
Applied rewrites94.7%
Taylor expanded in x1 around inf
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6494.7
Applied rewrites94.7%
if -1.45e11 < x1 < 2.15e8Initial program 98.6%
Taylor expanded in x1 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.2%
if 2.15e8 < x1 Initial program 42.8%
Taylor expanded in x2 around 0
Applied rewrites36.4%
Taylor expanded in x1 around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
lower-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6436.4
Applied rewrites36.4%
Taylor expanded in x1 around inf
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6491.7
Applied rewrites91.7%
Final simplification96.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 6.0 (* x1 (* x1 (* x1 x1))))))
(if (<= x1 -145000000000.0)
t_0
(if (<= x1 1260000000.0)
(fma x2 (fma x1 (fma 8.0 x2 -12.0) -6.0) (* x1 (fma x1 9.0 -1.0)))
t_0))))
double code(double x1, double x2) {
double t_0 = 6.0 * (x1 * (x1 * (x1 * x1)));
double tmp;
if (x1 <= -145000000000.0) {
tmp = t_0;
} else if (x1 <= 1260000000.0) {
tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), (x1 * fma(x1, 9.0, -1.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(6.0 * Float64(x1 * Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (x1 <= -145000000000.0) tmp = t_0; elseif (x1 <= 1260000000.0) tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), Float64(x1 * fma(x1, 9.0, -1.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(6.0 * N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -145000000000.0], t$95$0, If[LessEqual[x1, 1260000000.0], N[(x2 * N[(x1 * N[(8.0 * x2 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -145000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1260000000:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(8, x2, -12\right), -6\right), x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.45e11 or 1.26e9 < x1 Initial program 31.1%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6492.9
Applied rewrites92.9%
lift-pow.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.9
lift-pow.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.0%
if -1.45e11 < x1 < 1.26e9Initial program 98.6%
Taylor expanded in x1 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.2%
Final simplification95.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (fma x1 (fma x1 -19.0 9.0) -1.0))))
(if (<= x1 -8.6e-88)
t_0
(if (<= x1 9e-132)
(* x2 -6.0)
(if (<= x1 0.0095)
t_0
(if (<= x1 2.7e+142) (* x1 (* 8.0 (* x2 x2))) (* x1 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0);
double tmp;
if (x1 <= -8.6e-88) {
tmp = t_0;
} else if (x1 <= 9e-132) {
tmp = x2 * -6.0;
} else if (x1 <= 0.0095) {
tmp = t_0;
} else if (x1 <= 2.7e+142) {
tmp = x1 * (8.0 * (x2 * x2));
} else {
tmp = x1 * (x1 * 9.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * fma(x1, fma(x1, -19.0, 9.0), -1.0)) tmp = 0.0 if (x1 <= -8.6e-88) tmp = t_0; elseif (x1 <= 9e-132) tmp = Float64(x2 * -6.0); elseif (x1 <= 0.0095) tmp = t_0; elseif (x1 <= 2.7e+142) tmp = Float64(x1 * Float64(8.0 * Float64(x2 * x2))); else tmp = Float64(x1 * Float64(x1 * 9.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * -19.0 + 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.6e-88], t$95$0, If[LessEqual[x1, 9e-132], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 0.0095], t$95$0, If[LessEqual[x1, 2.7e+142], N[(x1 * N[(8.0 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, -19, 9\right), -1\right)\\
\mathbf{if}\;x1 \leq -8.6 \cdot 10^{-88}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-132}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 0.0095:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.7 \cdot 10^{+142}:\\
\;\;\;\;x1 \cdot \left(8 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -8.5999999999999995e-88 or 8.9999999999999999e-132 < x1 < 0.00949999999999999976Initial program 55.2%
Applied rewrites55.3%
Taylor expanded in x1 around 0
Applied rewrites71.9%
Taylor expanded in x2 around 0
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.8
Applied rewrites69.8%
if -8.5999999999999995e-88 < x1 < 8.9999999999999999e-132Initial program 98.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
if 0.00949999999999999976 < x1 < 2.69999999999999983e142Initial program 95.7%
Taylor expanded in x1 around 0
Applied rewrites41.5%
Taylor expanded in x2 around 0
Applied rewrites42.1%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6440.9
Applied rewrites40.9%
if 2.69999999999999983e142 < x1 Initial program 5.9%
Taylor expanded in x1 around 0
Applied rewrites79.7%
Taylor expanded in x2 around 0
Applied rewrites94.7%
Taylor expanded in x1 around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.7
Applied rewrites94.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 9.0))) (t_1 (+ x1 (* x1 -2.0))))
(if (<= x1 -1450000.0)
t_0
(if (<= x1 -8.6e-88)
t_1
(if (<= x1 9e-132) (* x2 -6.0) (if (<= x1 0.04) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = x1 + (x1 * -2.0);
double tmp;
if (x1 <= -1450000.0) {
tmp = t_0;
} else if (x1 <= -8.6e-88) {
tmp = t_1;
} else if (x1 <= 9e-132) {
tmp = x2 * -6.0;
} else if (x1 <= 0.04) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * (x1 * 9.0d0)
t_1 = x1 + (x1 * (-2.0d0))
if (x1 <= (-1450000.0d0)) then
tmp = t_0
else if (x1 <= (-8.6d-88)) then
tmp = t_1
else if (x1 <= 9d-132) then
tmp = x2 * (-6.0d0)
else if (x1 <= 0.04d0) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = x1 + (x1 * -2.0);
double tmp;
if (x1 <= -1450000.0) {
tmp = t_0;
} else if (x1 <= -8.6e-88) {
tmp = t_1;
} else if (x1 <= 9e-132) {
tmp = x2 * -6.0;
} else if (x1 <= 0.04) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 9.0) t_1 = x1 + (x1 * -2.0) tmp = 0 if x1 <= -1450000.0: tmp = t_0 elif x1 <= -8.6e-88: tmp = t_1 elif x1 <= 9e-132: tmp = x2 * -6.0 elif x1 <= 0.04: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 9.0)) t_1 = Float64(x1 + Float64(x1 * -2.0)) tmp = 0.0 if (x1 <= -1450000.0) tmp = t_0; elseif (x1 <= -8.6e-88) tmp = t_1; elseif (x1 <= 9e-132) tmp = Float64(x2 * -6.0); elseif (x1 <= 0.04) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 9.0); t_1 = x1 + (x1 * -2.0); tmp = 0.0; if (x1 <= -1450000.0) tmp = t_0; elseif (x1 <= -8.6e-88) tmp = t_1; elseif (x1 <= 9e-132) tmp = x2 * -6.0; elseif (x1 <= 0.04) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1450000.0], t$95$0, If[LessEqual[x1, -8.6e-88], t$95$1, If[LessEqual[x1, 9e-132], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 0.04], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 + x1 \cdot -2\\
\mathbf{if}\;x1 \leq -1450000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -8.6 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-132}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 0.04:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.45e6 or 0.0400000000000000008 < x1 Initial program 32.9%
Taylor expanded in x1 around 0
Applied rewrites51.9%
Taylor expanded in x2 around 0
Applied rewrites59.7%
Taylor expanded in x1 around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites61.6%
if -1.45e6 < x1 < -8.5999999999999995e-88 or 8.9999999999999999e-132 < x1 < 0.0400000000000000008Initial program 98.9%
Taylor expanded in x2 around 0
Applied rewrites55.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6451.7
Applied rewrites51.7%
if -8.5999999999999995e-88 < x1 < 8.9999999999999999e-132Initial program 98.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 6.0 (* x1 (* x1 (* x1 x1))))))
(if (<= x1 -145000000000.0)
t_0
(if (<= x1 1200000000.0)
(fma x2 (fma x1 (fma 8.0 x2 -12.0) -6.0) (- x1))
t_0))))
double code(double x1, double x2) {
double t_0 = 6.0 * (x1 * (x1 * (x1 * x1)));
double tmp;
if (x1 <= -145000000000.0) {
tmp = t_0;
} else if (x1 <= 1200000000.0) {
tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), -x1);
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(6.0 * Float64(x1 * Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (x1 <= -145000000000.0) tmp = t_0; elseif (x1 <= 1200000000.0) tmp = fma(x2, fma(x1, fma(8.0, x2, -12.0), -6.0), Float64(-x1)); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(6.0 * N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -145000000000.0], t$95$0, If[LessEqual[x1, 1200000000.0], N[(x2 * N[(x1 * N[(8.0 * x2 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision] + (-x1)), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\mathbf{if}\;x1 \leq -145000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 1200000000:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, \mathsf{fma}\left(8, x2, -12\right), -6\right), -x1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.45e11 or 1.2e9 < x1 Initial program 31.1%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f6492.9
Applied rewrites92.9%
lift-pow.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6492.9
lift-pow.f64N/A
metadata-evalN/A
pow-sqrN/A
pow2N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
Taylor expanded in x1 around inf
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6493.0
Applied rewrites93.0%
if -1.45e11 < x1 < 1.2e9Initial program 98.6%
Taylor expanded in x1 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
Applied rewrites86.0%
Taylor expanded in x2 around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites98.2%
Taylor expanded in x1 around 0
mul-1-negN/A
lower-neg.f6497.4
Applied rewrites97.4%
Final simplification95.4%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) -2e-174) (* x2 -6.0) (if (<= (* 2.0 x2) 1e-190) (+ x1 (* x1 -2.0)) (fma x2 -6.0 x1))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -2e-174) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 1e-190) {
tmp = x1 + (x1 * -2.0);
} else {
tmp = fma(x2, -6.0, x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= -2e-174) tmp = Float64(x2 * -6.0); elseif (Float64(2.0 * x2) <= 1e-190) tmp = Float64(x1 + Float64(x1 * -2.0)); else tmp = fma(x2, -6.0, x1); end return tmp end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], -2e-174], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e-190], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0 + x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -2 \cdot 10^{-174}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;2 \cdot x2 \leq 10^{-190}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -2e-174Initial program 68.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6436.5
Applied rewrites36.5%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6436.9
Applied rewrites36.9%
if -2e-174 < (*.f64 #s(literal 2 binary64) x2) < 1e-190Initial program 74.5%
Taylor expanded in x2 around 0
Applied rewrites63.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
if 1e-190 < (*.f64 #s(literal 2 binary64) x2) Initial program 64.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6428.1
Applied rewrites28.1%
(FPCore (x1 x2) :precision binary64 (let* ((t_0 (* x1 (fma x1 9.0 -1.0)))) (if (<= x1 -8.6e-88) t_0 (if (<= x1 9e-132) (* x2 -6.0) t_0))))
double code(double x1, double x2) {
double t_0 = x1 * fma(x1, 9.0, -1.0);
double tmp;
if (x1 <= -8.6e-88) {
tmp = t_0;
} else if (x1 <= 9e-132) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * fma(x1, 9.0, -1.0)) tmp = 0.0 if (x1 <= -8.6e-88) tmp = t_0; elseif (x1 <= 9e-132) tmp = Float64(x2 * -6.0); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.6e-88], t$95$0, If[LessEqual[x1, 9e-132], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
\mathbf{if}\;x1 \leq -8.6 \cdot 10^{-88}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{-132}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -8.5999999999999995e-88 or 8.9999999999999999e-132 < x1 Initial program 51.7%
Taylor expanded in x1 around 0
Applied rewrites63.6%
Taylor expanded in x2 around 0
Applied rewrites69.1%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
associate-+l-N/A
metadata-evalN/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6459.5
Applied rewrites59.5%
if -8.5999999999999995e-88 < x1 < 8.9999999999999999e-132Initial program 98.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
(FPCore (x1 x2) :precision binary64 (fma x2 -6.0 x1))
double code(double x1, double x2) {
return fma(x2, -6.0, x1);
}
function code(x1, x2) return fma(x2, -6.0, x1) end
code[x1_, x2_] := N[(x2 * -6.0 + x1), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x2, -6, x1\right)
\end{array}
Initial program 68.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6427.9
Applied rewrites27.9%
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6427.9
Applied rewrites27.9%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 68.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6427.9
Applied rewrites27.9%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6427.7
Applied rewrites27.7%
herbie shell --seed 2024216
(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))))))