
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma 2.0 x2 (fma x1 (* x1 3.0) (- x1))))
(t_1 (/ t_0 (fma x1 x1 1.0)))
(t_2 (fma 4.0 (fma x2 2.0 -3.0) 9.0)))
(if (<= x1 -2.6e+50)
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ (- (/ t_2 x1) 3.0) x1))))
(if (<= x1 2.55e+69)
(+
x1
(fma
(/ (- (* x1 (* x1 3.0)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
3.0
(fma
(fma x1 x1 1.0)
(fma
x1
(* x1 (fma t_1 4.0 -6.0))
(/ (* (+ -3.0 t_1) (* (* x1 2.0) t_0)) (fma x1 x1 1.0)))
(fma x1 (* (* x1 3.0) t_1) (fma x1 (* x1 x1) x1)))))
(fma
x1
(fma x1 (fma x1 (fma x1 6.0 -3.0) t_2) (* 6.0 (fma x2 2.0 -3.0)))
x1)))))
double code(double x1, double x2) {
double t_0 = fma(2.0, x2, fma(x1, (x1 * 3.0), -x1));
double t_1 = t_0 / fma(x1, x1, 1.0);
double t_2 = fma(4.0, fma(x2, 2.0, -3.0), 9.0);
double tmp;
if (x1 <= -2.6e+50) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (((t_2 / x1) - 3.0) / x1)));
} else if (x1 <= 2.55e+69) {
tmp = x1 + fma((((x1 * (x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_1, 4.0, -6.0)), (((-3.0 + t_1) * ((x1 * 2.0) * t_0)) / fma(x1, x1, 1.0))), fma(x1, ((x1 * 3.0) * t_1), fma(x1, (x1 * x1), x1))));
} else {
tmp = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), t_2), (6.0 * fma(x2, 2.0, -3.0))), x1);
}
return tmp;
}
function code(x1, x2) t_0 = fma(2.0, x2, fma(x1, Float64(x1 * 3.0), Float64(-x1))) t_1 = Float64(t_0 / fma(x1, x1, 1.0)) t_2 = fma(4.0, fma(x2, 2.0, -3.0), 9.0) tmp = 0.0 if (x1 <= -2.6e+50) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(t_2 / x1) - 3.0) / x1)))); elseif (x1 <= 2.55e+69) tmp = Float64(x1 + fma(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), 3.0, fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_1, 4.0, -6.0)), Float64(Float64(Float64(-3.0 + t_1) * Float64(Float64(x1 * 2.0) * t_0)) / fma(x1, x1, 1.0))), fma(x1, Float64(Float64(x1 * 3.0) * t_1), fma(x1, Float64(x1 * x1), x1))))); else tmp = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), t_2), Float64(6.0 * fma(x2, 2.0, -3.0))), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(2.0 * x2 + N[(x1 * N[(x1 * 3.0), $MachinePrecision] + (-x1)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]}, If[LessEqual[x1, -2.6e+50], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(t$95$2 / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.55e+69], N[(x1 + N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * 3.0 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$1 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-3.0 + t$95$1), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, x2, \mathsf{fma}\left(x1, x1 \cdot 3, -x1\right)\right)\\
t_1 := \frac{t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\\
\mathbf{if}\;x1 \leq -2.6 \cdot 10^{+50}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{t\_2}{x1} - 3}{x1}\right)\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+69}:\\
\;\;\;\;x1 + \mathsf{fma}\left(\frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_1, 4, -6\right), \frac{\left(-3 + t\_1\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_0\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right), \mathsf{fma}\left(x1, \left(x1 \cdot 3\right) \cdot t\_1, \mathsf{fma}\left(x1, x1 \cdot x1, x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), t\_2\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
\end{array}
\end{array}
if x1 < -2.6000000000000002e50Initial program 24.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 -2.6000000000000002e50 < x1 < 2.54999999999999999e69Initial program 99.3%
Applied rewrites99.7%
if 2.54999999999999999e69 < x1 Initial program 39.2%
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%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0)))))
(t_7 (+ x1 (* x2 (* x1 (* x2 8.0))))))
(if (<= t_6 -2e+173)
t_7
(if (<= t_6 5e+228)
(- (* x2 -6.0) x1)
(if (<= t_6 INFINITY) t_7 (* x1 (fma x1 9.0 -1.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double t_7 = x1 + (x2 * (x1 * (x2 * 8.0)));
double tmp;
if (t_6 <= -2e+173) {
tmp = t_7;
} else if (t_6 <= 5e+228) {
tmp = (x2 * -6.0) - x1;
} else if (t_6 <= ((double) INFINITY)) {
tmp = t_7;
} else {
tmp = x1 * fma(x1, 9.0, -1.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) t_7 = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0)))) tmp = 0.0 if (t_6 <= -2e+173) tmp = t_7; elseif (t_6 <= 5e+228) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (t_6 <= Inf) tmp = t_7; else tmp = Float64(x1 * fma(x1, 9.0, -1.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], t$95$7, If[LessEqual[t$95$6, 5e+228], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[t$95$6, Infinity], t$95$7, N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
t_7 := x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+228}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;t\_6 \leq \infty:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\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)))))) < -2e173 or 5e228 < (+.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.8%
Taylor expanded in x1 around 0
Applied rewrites58.8%
Taylor expanded in x2 around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.1
Applied rewrites64.1%
if -2e173 < (+.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)))))) < 5e228Initial program 99.1%
Taylor expanded in x2 around 0
Applied rewrites95.9%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites82.4%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6481.3
Applied rewrites81.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 x2 around 0
Applied rewrites0.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites74.1%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6488.4
Applied rewrites88.4%
Final simplification78.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 -2e+173)
(+ x1 (* x2 (* x1 (* x2 8.0))))
(if (<= t_6 5e+59)
(+ x1 (fma x2 -6.0 (* x1 (fma x1 (fma x2 6.0 9.0) -2.0))))
(fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= -2e+173) {
tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
} else if (t_6 <= 5e+59) {
tmp = x1 + fma(x2, -6.0, (x1 * fma(x1, fma(x2, 6.0, 9.0), -2.0)));
} else {
tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= -2e+173) tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0)))); elseif (t_6 <= 5e+59) tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x1, fma(x2, 6.0, 9.0), -2.0)))); else tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 5e+59], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x1 * N[(x2 * 6.0 + 9.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, 6, 9\right), -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), 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)))))) < -2e173Initial program 99.8%
Taylor expanded in x1 around 0
Applied rewrites82.5%
Taylor expanded in x2 around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
if -2e173 < (+.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)))))) < 4.9999999999999997e59Initial program 99.2%
Taylor expanded in x2 around 0
Applied rewrites97.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites91.9%
if 4.9999999999999997e59 < (+.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 46.1%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval81.7
Applied rewrites81.7%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6481.7
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6481.7
Applied rewrites81.7%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6481.7
Applied rewrites81.7%
Final simplification85.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 -2e+173)
(+ x1 (* x2 (* x1 (* x2 8.0))))
(if (<= t_6 2e+42)
(+ x1 (fma x1 (fma x1 (* x1 -19.0) -2.0) (* x2 -6.0)))
(fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= -2e+173) {
tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
} else if (t_6 <= 2e+42) {
tmp = x1 + fma(x1, fma(x1, (x1 * -19.0), -2.0), (x2 * -6.0));
} else {
tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= -2e+173) tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0)))); elseif (t_6 <= 2e+42) tmp = Float64(x1 + fma(x1, fma(x1, Float64(x1 * -19.0), -2.0), Float64(x2 * -6.0))); else tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 2e+42], N[(x1 + N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision] + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, x1 \cdot -19, -2\right), x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), 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)))))) < -2e173Initial program 99.8%
Taylor expanded in x1 around 0
Applied rewrites82.5%
Taylor expanded in x2 around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
if -2e173 < (+.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)))))) < 2.00000000000000009e42Initial program 99.1%
Taylor expanded in x2 around 0
Applied rewrites97.0%
Taylor expanded in x1 around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites94.1%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f6493.1
Applied rewrites93.1%
if 2.00000000000000009e42 < (+.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 47.5%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval80.9
Applied rewrites80.9%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.9
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6480.9
Applied rewrites80.9%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6480.9
Applied rewrites80.9%
Final simplification85.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 -2e+173)
(+ x1 (* x2 (* x1 (* x2 8.0))))
(if (<= t_6 2e+42)
(- (* x2 -6.0) x1)
(fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= -2e+173) {
tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
} else if (t_6 <= 2e+42) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= -2e+173) tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0)))); elseif (t_6 <= 2e+42) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 2e+42], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+42}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), 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)))))) < -2e173Initial program 99.8%
Taylor expanded in x1 around 0
Applied rewrites82.5%
Taylor expanded in x2 around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
if -2e173 < (+.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)))))) < 2.00000000000000009e42Initial program 99.1%
Taylor expanded in x2 around 0
Applied rewrites97.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites93.8%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6493.0
Applied rewrites93.0%
if 2.00000000000000009e42 < (+.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 47.5%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval80.9
Applied rewrites80.9%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.9
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6480.9
Applied rewrites80.9%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6480.9
Applied rewrites80.9%
Final simplification85.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 -2e+173)
(+ x1 (* x2 (* x1 (* x2 8.0))))
(if (<= t_6 5e+59)
(- (* x2 -6.0) x1)
(fma 6.0 (* (* x1 x1) (* x1 x1)) x1)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= -2e+173) {
tmp = x1 + (x2 * (x1 * (x2 * 8.0)));
} else if (t_6 <= 5e+59) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = fma(6.0, ((x1 * x1) * (x1 * x1)), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= -2e+173) tmp = Float64(x1 + Float64(x2 * Float64(x1 * Float64(x2 * 8.0)))); elseif (t_6 <= 5e+59) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = fma(6.0, Float64(Float64(x1 * x1) * Float64(x1 * x1)), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -2e+173], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 5e+59], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_6 \leq -2 \cdot 10^{+173}:\\
\;\;\;\;x1 + x2 \cdot \left(x1 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{elif}\;t\_6 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(6, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), 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)))))) < -2e173Initial program 99.8%
Taylor expanded in x1 around 0
Applied rewrites82.5%
Taylor expanded in x2 around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.4
Applied rewrites89.4%
if -2e173 < (+.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)))))) < 4.9999999999999997e59Initial program 99.2%
Taylor expanded in x2 around 0
Applied rewrites97.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites91.9%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6490.9
Applied rewrites90.9%
if 4.9999999999999997e59 < (+.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 46.1%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval81.7
Applied rewrites81.7%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6481.7
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6481.7
Applied rewrites81.7%
Taylor expanded in x1 around inf
Applied rewrites81.7%
Final simplification85.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_6 INFINITY) t_6 (fma 6.0 (* (* x1 x1) (* x1 x1)) x1))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double t_6 = x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_6 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = fma(6.0, ((x1 * x1) * (x1 * x1)), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_6 <= Inf) tmp = t_6; else tmp = fma(6.0, Float64(Float64(x1 * x1) * Float64(x1 * x1)), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, Infinity], t$95$6, N[(6.0 * N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_6 \leq \infty:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(6, \left(x1 \cdot x1\right) \cdot \left(x1 \cdot x1\right), 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.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval100.0
Applied rewrites100.0%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x1 around inf
Applied rewrites100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
2e+255)
(- (* x2 -6.0) x1)
(* x1 (fma x1 9.0 -1.0)))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double tmp;
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 2e+255) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 * fma(x1, 9.0, -1.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= 2e+255) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 * fma(x1, 9.0, -1.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+255], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right) \leq 2 \cdot 10^{+255}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\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.99999999999999998e255Initial program 99.3%
Taylor expanded in x2 around 0
Applied rewrites75.9%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites68.8%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
if 1.99999999999999998e255 < (+.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 37.2%
Taylor expanded in x2 around 0
Applied rewrites24.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites52.8%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6457.2
Applied rewrites57.2%
Final simplification60.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ t_2 t_4)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* (* x1 2.0) t_3) (+ 3.0 t_5)))
t_4)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))
4e+305)
(- (* x2 -6.0) x1)
(* (* x1 x2) 12.0))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double tmp;
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = (x1 * x2) * 12.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (t_1 + (2.0d0 * x2)) - x1
t_3 = t_2 / t_0
t_4 = (-1.0d0) - (x1 * x1)
t_5 = t_2 / t_4
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0d0 + (4.0d0 * t_5))) + (((x1 * 2.0d0) * t_3) * (3.0d0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)))) <= 4d+305) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = (x1 * x2) * 12.0d0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = t_2 / t_4;
double tmp;
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = (x1 * x2) * 12.0;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = t_2 / t_0 t_4 = -1.0 - (x1 * x1) t_5 = t_2 / t_4 tmp = 0 if (x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305: tmp = (x2 * -6.0) - x1 else: tmp = (x1 * x2) * 12.0 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(t_2 / t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + t_5))) * t_4) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) <= 4e+305) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(Float64(x1 * x2) * 12.0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = t_2 / t_0; t_4 = -1.0 - (x1 * x1); t_5 = t_2 / t_4; tmp = 0.0; if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 + (4.0 * t_5))) + (((x1 * 2.0) * t_3) * (3.0 + t_5))) * t_4) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)))) <= 4e+305) tmp = (x2 * -6.0) - x1; else tmp = (x1 * x2) * 12.0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+305], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{t\_2}{t\_4}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_4 + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right) \leq 4 \cdot 10^{+305}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;\left(x1 \cdot x2\right) \cdot 12\\
\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)))))) < 3.9999999999999998e305Initial program 99.2%
Taylor expanded in x2 around 0
Applied rewrites74.9%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites66.1%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
if 3.9999999999999998e305 < (+.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 34.2%
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 rewrites91.8%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6412.3
Applied rewrites12.3%
Taylor expanded in x2 around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6411.6
Applied rewrites11.6%
Final simplification38.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(fma
x1
(fma
x1
(fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
(* 6.0 (fma x2 2.0 -3.0)))
x1)))
(if (<= x1 -2.3)
t_0
(if (<= x1 740000000.0)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) (* 4.0 (* x2 (* x1 (fma x2 2.0 -3.0))))))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
double tmp;
if (x1 <= -2.3) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (4.0 * (x2 * (x1 * fma(x2, 2.0, -3.0)))))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1) tmp = 0.0 if (x1 <= -2.3) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(4.0 * Float64(x2 * Float64(x1 * fma(x2, 2.0, -3.0)))))))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.3], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * N[(x1 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
\mathbf{if}\;x1 \leq -2.3:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.2999999999999998 or 7.4e8 < x1 Initial program 43.4%
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 rewrites94.6%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites94.6%
if -2.2999999999999998 < x1 < 7.4e8Initial program 99.4%
Taylor expanded in x1 around 0
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-eval96.8
Applied rewrites96.8%
Final simplification95.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(fma
x1
(fma
x1
(fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
(* 6.0 (fma x2 2.0 -3.0)))
x1)))
(if (<= x1 -2.5)
t_0
(if (<= x1 740000000.0)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x2 (* x1 (fma x2 2.0 -3.0)))))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
double tmp;
if (x1 <= -2.5) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x2 * (x1 * fma(x2, 2.0, -3.0))))));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1) tmp = 0.0 if (x1 <= -2.5) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * fma(x2, 2.0, -3.0))))))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
\mathbf{if}\;x1 \leq -2.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.5 or 7.4e8 < x1 Initial program 43.4%
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 rewrites94.6%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites94.6%
if -2.5 < x1 < 7.4e8Initial program 99.4%
Taylor expanded in x1 around 0
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-eval96.8
Applied rewrites96.8%
Final simplification95.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(fma
x1
(fma
x1
(fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
(* 6.0 (fma x2 2.0 -3.0)))
x1)))
(if (<= x1 -2.5)
t_0
(if (<= x1 740000000.0)
(+
x1
(fma
x1
(fma
x1
(fma
x2
-4.0
(fma
2.0
(fma x2 -2.0 3.0)
(fma 3.0 (fma x2 2.0 3.0) (fma x2 14.0 -6.0))))
(fma x2 (fma 4.0 (* 2.0 x2) -12.0) -2.0))
(* x2 -6.0)))
t_0))))
double code(double x1, double x2) {
double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
double tmp;
if (x1 <= -2.5) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + fma(x1, fma(x1, fma(x2, -4.0, fma(2.0, fma(x2, -2.0, 3.0), fma(3.0, fma(x2, 2.0, 3.0), fma(x2, 14.0, -6.0)))), fma(x2, fma(4.0, (2.0 * x2), -12.0), -2.0)), (x2 * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1) tmp = 0.0 if (x1 <= -2.5) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + fma(x1, fma(x1, fma(x2, -4.0, fma(2.0, fma(x2, -2.0, 3.0), fma(3.0, fma(x2, 2.0, 3.0), fma(x2, 14.0, -6.0)))), fma(x2, fma(4.0, Float64(2.0 * x2), -12.0), -2.0)), Float64(x2 * -6.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x1 * N[(x1 * N[(x2 * -4.0 + N[(2.0 * N[(x2 * -2.0 + 3.0), $MachinePrecision] + N[(3.0 * N[(x2 * 2.0 + 3.0), $MachinePrecision] + N[(x2 * 14.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(4.0 * N[(2.0 * x2), $MachinePrecision] + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
\mathbf{if}\;x1 \leq -2.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x2, -4, \mathsf{fma}\left(2, \mathsf{fma}\left(x2, -2, 3\right), \mathsf{fma}\left(3, \mathsf{fma}\left(x2, 2, 3\right), \mathsf{fma}\left(x2, 14, -6\right)\right)\right)\right), \mathsf{fma}\left(x2, \mathsf{fma}\left(4, 2 \cdot x2, -12\right), -2\right)\right), x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.5 or 7.4e8 < x1 Initial program 43.4%
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 rewrites94.6%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites94.6%
if -2.5 < x1 < 7.4e8Initial program 99.4%
Taylor expanded in x1 around 0
Applied rewrites87.4%
Final simplification91.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(fma
x1
(fma
x1
(fma x1 (fma x1 6.0 -3.0) (fma 4.0 (fma x2 2.0 -3.0) 9.0))
(* 6.0 (fma x2 2.0 -3.0)))
x1)))
(if (<= x1 -2.5)
t_0
(if (<= x1 740000000.0)
(+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), (6.0 * fma(x2, 2.0, -3.0))), x1);
double tmp;
if (x1 <= -2.5) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, fma(x1, fma(x1, fma(x1, 6.0, -3.0), fma(4.0, fma(x2, 2.0, -3.0), 9.0)), Float64(6.0 * fma(x2, 2.0, -3.0))), x1) tmp = 0.0 if (x1 <= -2.5) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision] + N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision] + N[(6.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -2.5], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 6, -3\right), \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\right), 6 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right), x1\right)\\
\mathbf{if}\;x1 \leq -2.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.5 or 7.4e8 < x1 Initial program 43.4%
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 rewrites94.6%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites94.6%
if -2.5 < x1 < 7.4e8Initial program 99.4%
Taylor expanded in x1 around 0
Applied rewrites87.4%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6486.9
Applied rewrites86.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* (* x1 (* x1 (* x1 x1))) (+ 6.0 (/ -3.0 x1))))))
(if (<= x1 -1.18e+45)
t_0
(if (<= x1 740000000.0)
(+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + ((x1 * (x1 * (x1 * x1))) * (6.0 + (-3.0 / x1)));
double tmp;
if (x1 <= -1.18e+45) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x1 * Float64(x1 * Float64(x1 * x1))) * Float64(6.0 + Float64(-3.0 / x1)))) tmp = 0.0 if (x1 <= -1.18e+45) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x1 * N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 \cdot \left(x1 \cdot \left(x1 \cdot x1\right)\right)\right) \cdot \left(6 + \frac{-3}{x1}\right)\\
\mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.17999999999999993e45 or 7.4e8 < x1 Initial program 38.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval91.8
Applied rewrites91.8%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6491.8
Applied rewrites91.8%
if -1.17999999999999993e45 < x1 < 7.4e8Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites84.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6483.7
Applied rewrites83.7%
Final simplification87.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* (* x1 (* x1 x1)) (+ 6.0 (/ -3.0 x1))) x1 x1)))
(if (<= x1 -1.18e+45)
t_0
(if (<= x1 740000000.0)
(+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma(((x1 * (x1 * x1)) * (6.0 + (-3.0 / x1))), x1, x1);
double tmp;
if (x1 <= -1.18e+45) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(Float64(x1 * Float64(x1 * x1)) * Float64(6.0 + Float64(-3.0 / x1))), x1, x1) tmp = 0.0 if (x1 <= -1.18e+45) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x1 + x1), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\left(x1 \cdot \left(x1 \cdot x1\right)\right) \cdot \left(6 + \frac{-3}{x1}\right), x1, x1\right)\\
\mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.17999999999999993e45 or 7.4e8 < x1 Initial program 38.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval91.8
Applied rewrites91.8%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6491.8
Applied rewrites91.8%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6491.8
Applied rewrites91.8%
if -1.17999999999999993e45 < x1 < 7.4e8Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites84.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6483.7
Applied rewrites83.7%
Final simplification87.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 x1) (* x1 (fma x1 6.0 -3.0)) x1)))
(if (<= x1 -1.18e+45)
t_0
(if (<= x1 740000000.0)
(+ x1 (fma x2 -6.0 (* x1 (fma x2 (fma x2 8.0 -12.0) -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma((x1 * x1), (x1 * fma(x1, 6.0, -3.0)), x1);
double tmp;
if (x1 <= -1.18e+45) {
tmp = t_0;
} else if (x1 <= 740000000.0) {
tmp = x1 + fma(x2, -6.0, (x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * x1), Float64(x1 * fma(x1, 6.0, -3.0)), x1) tmp = 0.0 if (x1 <= -1.18e+45) tmp = t_0; elseif (x1 <= 740000000.0) tmp = Float64(x1 + fma(x2, -6.0, Float64(x1 * fma(x2, fma(x2, 8.0, -12.0), -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] * N[(x1 * N[(x1 * 6.0 + -3.0), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -1.18e+45], t$95$0, If[LessEqual[x1, 740000000.0], N[(x1 + N[(x2 * -6.0 + N[(x1 * N[(x2 * N[(x2 * 8.0 + -12.0), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot x1, x1 \cdot \mathsf{fma}\left(x1, 6, -3\right), x1\right)\\
\mathbf{if}\;x1 \leq -1.18 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, -6, x1 \cdot \mathsf{fma}\left(x2, \mathsf{fma}\left(x2, 8, -12\right), -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -1.17999999999999993e45 or 7.4e8 < x1 Initial program 38.6%
Taylor expanded in x1 around inf
lower-*.f64N/A
lower-pow.f64N/A
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval91.8
Applied rewrites91.8%
lift-pow.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6491.8
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lift-*.f64N/A
pow2N/A
lower-*.f6491.8
Applied rewrites91.8%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6491.8
Applied rewrites91.8%
if -1.17999999999999993e45 < x1 < 7.4e8Initial program 99.3%
Taylor expanded in x1 around 0
Applied rewrites84.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6483.7
Applied rewrites83.7%
Final simplification87.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.4e+44)
(* x1 (* x1 (* x1 -19.0)))
(if (<= x1 0.19)
(- (* x2 -6.0) x1)
(if (<= x1 1.7e+150) (* x2 (/ x1 x2)) (* x1 (fma x1 9.0 -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.4e+44) {
tmp = x1 * (x1 * (x1 * -19.0));
} else if (x1 <= 0.19) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.7e+150) {
tmp = x2 * (x1 / x2);
} else {
tmp = x1 * fma(x1, 9.0, -1.0);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -2.4e+44) tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0))); elseif (x1 <= 0.19) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.7e+150) tmp = Float64(x2 * Float64(x1 / x2)); else tmp = Float64(x1 * fma(x1, 9.0, -1.0)); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.19], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.7e+150], N[(x2 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 0.19:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.7 \cdot 10^{+150}:\\
\;\;\;\;x2 \cdot \frac{x1}{x2}\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
\end{array}
\end{array}
if x1 < -2.40000000000000013e44Initial program 26.0%
Taylor expanded in x2 around 0
Applied rewrites18.5%
Taylor expanded in x1 around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites80.0%
Taylor expanded in x1 around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.3
Applied rewrites75.3%
if -2.40000000000000013e44 < x1 < 0.19Initial program 99.3%
Taylor expanded in x2 around 0
Applied rewrites72.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites68.7%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6468.3
Applied rewrites68.3%
if 0.19 < x1 < 1.69999999999999991e150Initial program 99.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in x2 around inf
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6419.9
Applied rewrites19.9%
Taylor expanded in x1 around inf
lower-/.f6420.5
Applied rewrites20.5%
if 1.69999999999999991e150 < x1 Initial program 3.1%
Taylor expanded in x2 around 0
Applied rewrites3.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites72.2%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6497.2
Applied rewrites97.2%
Final simplification67.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.4e+44)
(* x1 (* x1 (* x1 -19.0)))
(if (<= x1 740000000.0)
(- (* x2 -6.0) x1)
(if (<= x1 1.4e+153)
(* x1 (* x1 (fma x2 6.0 9.0)))
(* x1 (fma x1 9.0 -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.4e+44) {
tmp = x1 * (x1 * (x1 * -19.0));
} else if (x1 <= 740000000.0) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 1.4e+153) {
tmp = x1 * (x1 * fma(x2, 6.0, 9.0));
} else {
tmp = x1 * fma(x1, 9.0, -1.0);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -2.4e+44) tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0))); elseif (x1 <= 740000000.0) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 1.4e+153) tmp = Float64(x1 * Float64(x1 * fma(x2, 6.0, 9.0))); else tmp = Float64(x1 * fma(x1, 9.0, -1.0)); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 740000000.0], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 1.4e+153], N[(x1 * N[(x1 * N[(x2 * 6.0 + 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 740000000:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 6, 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
\end{array}
\end{array}
if x1 < -2.40000000000000013e44Initial program 26.0%
Taylor expanded in x2 around 0
Applied rewrites18.5%
Taylor expanded in x1 around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites80.0%
Taylor expanded in x1 around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.3
Applied rewrites75.3%
if -2.40000000000000013e44 < x1 < 7.4e8Initial program 99.3%
Taylor expanded in x2 around 0
Applied rewrites71.5%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites67.2%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6466.8
Applied rewrites66.8%
if 7.4e8 < x1 < 1.39999999999999993e153Initial program 99.7%
Taylor expanded in x2 around 0
Applied rewrites80.3%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites20.5%
Taylor expanded in x1 around inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6420.5
Applied rewrites20.5%
if 1.39999999999999993e153 < x1 Initial program 0.0%
Taylor expanded in x2 around 0
Applied rewrites0.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites74.2%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Final simplification66.8%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.4e+44) (* x1 (* x1 (* x1 -19.0))) (if (<= x1 9.5e-11) (- (* x2 -6.0) x1) (* x1 (fma x1 9.0 -1.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.4e+44) {
tmp = x1 * (x1 * (x1 * -19.0));
} else if (x1 <= 9.5e-11) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 * fma(x1, 9.0, -1.0);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -2.4e+44) tmp = Float64(x1 * Float64(x1 * Float64(x1 * -19.0))); elseif (x1 <= 9.5e-11) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 * fma(x1, 9.0, -1.0)); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -2.4e+44], N[(x1 * N[(x1 * N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e-11], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 * N[(x1 * 9.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.4 \cdot 10^{+44}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot \left(x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-11}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \mathsf{fma}\left(x1, 9, -1\right)\\
\end{array}
\end{array}
if x1 < -2.40000000000000013e44Initial program 26.0%
Taylor expanded in x2 around 0
Applied rewrites18.5%
Taylor expanded in x1 around 0
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites80.0%
Taylor expanded in x1 around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.3
Applied rewrites75.3%
if -2.40000000000000013e44 < x1 < 9.49999999999999951e-11Initial program 99.3%
Taylor expanded in x2 around 0
Applied rewrites72.1%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.0%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6468.7
Applied rewrites68.7%
if 9.49999999999999951e-11 < x1 Initial program 54.9%
Taylor expanded in x2 around 0
Applied rewrites42.6%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites44.0%
Taylor expanded in x2 around 0
+-commutativeN/A
*-rgt-identityN/A
distribute-lft-outN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6448.7
Applied rewrites48.7%
Final simplification65.0%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.8e-16) (* x1 -17.0) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.8e-16) {
tmp = x1 * -17.0;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.8d-16)) then
tmp = x1 * (-17.0d0)
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.8e-16) {
tmp = x1 * -17.0;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.8e-16: tmp = x1 * -17.0 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.8e-16) tmp = Float64(x1 * -17.0); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.8e-16) tmp = x1 * -17.0; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.8e-16], N[(x1 * -17.0), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{-16}:\\
\;\;\;\;x1 \cdot -17\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -2.8000000000000001e-16Initial program 38.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 rewrites88.4%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6410.5
Applied rewrites10.5%
Taylor expanded in x2 around 0
distribute-rgt1-inN/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval6.8
Applied rewrites6.8%
if -2.8000000000000001e-16 < x1 Initial program 82.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -2.8e-16) (* x1 -17.0) (fma x2 -6.0 x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.8e-16) {
tmp = x1 * -17.0;
} else {
tmp = fma(x2, -6.0, x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -2.8e-16) tmp = Float64(x1 * -17.0); else tmp = fma(x2, -6.0, x1); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -2.8e-16], N[(x1 * -17.0), $MachinePrecision], N[(x2 * -6.0 + x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.8 \cdot 10^{-16}:\\
\;\;\;\;x1 \cdot -17\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\
\end{array}
\end{array}
if x1 < -2.8000000000000001e-16Initial program 38.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 rewrites88.4%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6410.5
Applied rewrites10.5%
Taylor expanded in x2 around 0
distribute-rgt1-inN/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval6.8
Applied rewrites6.8%
if -2.8000000000000001e-16 < x1 Initial program 82.0%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6434.6
Applied rewrites34.6%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 68.7%
Taylor expanded in x2 around 0
Applied rewrites50.6%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites60.9%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6434.5
Applied rewrites34.5%
Final simplification34.5%
(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.7%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6424.2
Applied rewrites24.2%
Taylor expanded in x1 around 0
*-commutativeN/A
lower-*.f6423.9
Applied rewrites23.9%
(FPCore (x1 x2) :precision binary64 (* x1 -17.0))
double code(double x1, double x2) {
return x1 * -17.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 * (-17.0d0)
end function
public static double code(double x1, double x2) {
return x1 * -17.0;
}
def code(x1, x2): return x1 * -17.0
function code(x1, x2) return Float64(x1 * -17.0) end
function tmp = code(x1, x2) tmp = x1 * -17.0; end
code[x1_, x2_] := N[(x1 * -17.0), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot -17
\end{array}
Initial program 68.7%
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 rewrites54.1%
Taylor expanded in x1 around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f649.2
Applied rewrites9.2%
Taylor expanded in x2 around 0
distribute-rgt1-inN/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval4.6
Applied rewrites4.6%
herbie shell --seed 2024214
(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))))))