
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (- (fma (* 3.0 x1) x1 (* 2.0 x2)) x1))
(t_4 (/ t_3 (fma x1 x1 1.0))))
(if (<=
(+
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))))
INFINITY)
(+
x1
(fma
(fma (fma t_4 4.0 -6.0) (* x1 x1) (* (- t_4 3.0) (* (* 2.0 x1) t_4)))
(fma x1 x1 1.0)
(fma
x1
(fma (/ (* x1 t_3) (fma x1 x1 1.0)) 3.0 (* x1 x1))
(fma
(/ 3.0 (fma x1 x1 1.0))
(fma -2.0 x2 (fma (* 3.0 x1) x1 (- x1)))
x1))))
(+
x1
(*
(+ (fma (fma 6.0 x1 -3.0) x1 (* (fma 2.0 x2 -3.0) 4.0)) 9.0)
(* x1 x1))))))
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;
double t_3 = fma((3.0 * x1), x1, (2.0 * x2)) - x1;
double t_4 = t_3 / fma(x1, x1, 1.0);
double tmp;
if ((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) INFINITY)) {
tmp = x1 + fma(fma(fma(t_4, 4.0, -6.0), (x1 * x1), ((t_4 - 3.0) * ((2.0 * x1) * t_4))), fma(x1, x1, 1.0), fma(x1, fma(((x1 * t_3) / fma(x1, x1, 1.0)), 3.0, (x1 * x1)), fma((3.0 / fma(x1, x1, 1.0)), fma(-2.0, x2, fma((3.0 * x1), x1, -x1)), x1)));
} else {
tmp = x1 + ((fma(fma(6.0, x1, -3.0), x1, (fma(2.0, x2, -3.0) * 4.0)) + 9.0) * (x1 * x1));
}
return tmp;
}
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) t_3 = Float64(fma(Float64(3.0 * x1), x1, Float64(2.0 * x2)) - x1) t_4 = Float64(t_3 / fma(x1, x1, 1.0)) tmp = 0.0 if (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)))) <= Inf) tmp = Float64(x1 + fma(fma(fma(t_4, 4.0, -6.0), Float64(x1 * x1), Float64(Float64(t_4 - 3.0) * Float64(Float64(2.0 * x1) * t_4))), fma(x1, x1, 1.0), fma(x1, fma(Float64(Float64(x1 * t_3) / fma(x1, x1, 1.0)), 3.0, Float64(x1 * x1)), fma(Float64(3.0 / fma(x1, x1, 1.0)), fma(-2.0, x2, fma(Float64(3.0 * x1), x1, Float64(-x1))), x1)))); else tmp = Float64(x1 + Float64(Float64(fma(fma(6.0, x1, -3.0), x1, Float64(fma(2.0, x2, -3.0) * 4.0)) + 9.0) * Float64(x1 * x1))); end return tmp 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]}, Block[{t$95$3 = N[(N[(N[(3.0 * x1), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(x1 + N[(N[(N[(t$95$4 * 4.0 + -6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(2.0 * x1), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(x1 * N[(N[(N[(x1 * t$95$3), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * 3.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-2.0 * x2 + N[(N[(3.0 * x1), $MachinePrecision] * x1 + (-x1)), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[(6.0 * x1 + -3.0), $MachinePrecision] * x1 + N[(N[(2.0 * x2 + -3.0), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision] * N[(x1 * x1), $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}\\
t_3 := \mathsf{fma}\left(3 \cdot x1, x1, 2 \cdot x2\right) - x1\\
t_4 := \frac{t\_3}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_4, 4, -6\right), x1 \cdot x1, \left(t\_4 - 3\right) \cdot \left(\left(2 \cdot x1\right) \cdot t\_4\right)\right), \mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, \mathsf{fma}\left(\frac{x1 \cdot t\_3}{\mathsf{fma}\left(x1, x1, 1\right)}, 3, x1 \cdot x1\right), \mathsf{fma}\left(\frac{3}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(-2, x2, \mathsf{fma}\left(3 \cdot x1, x1, -x1\right)\right), x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\mathsf{fma}\left(\mathsf{fma}\left(6, x1, -3\right), x1, \mathsf{fma}\left(2, x2, -3\right) \cdot 4\right) + 9\right) \cdot \left(x1 \cdot 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%
Applied rewrites99.7%
Applied rewrites99.7%
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
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x1 around 0
Applied rewrites100.0%
(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))
(t_3
(+
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)))))
(t_4 (fma (* (fma 8.0 x2 -12.0) x1) x2 (- x1))))
(if (<= t_3 -4e+192)
t_4
(if (<= t_3 1e+171)
(fma (fma -12.0 x1 -6.0) x2 (- x1))
(if (<= t_3 INFINITY) t_4 (+ x1 (* (* (* x1 x1) x2) 8.0)))))))
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;
double t_3 = 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 t_4 = fma((fma(8.0, x2, -12.0) * x1), x2, -x1);
double tmp;
if (t_3 <= -4e+192) {
tmp = t_4;
} else if (t_3 <= 1e+171) {
tmp = fma(fma(-12.0, x1, -6.0), x2, -x1);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = x1 + (((x1 * x1) * x2) * 8.0);
}
return tmp;
}
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) t_3 = 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)))) t_4 = fma(Float64(fma(8.0, x2, -12.0) * x1), x2, Float64(-x1)) tmp = 0.0 if (t_3 <= -4e+192) tmp = t_4; elseif (t_3 <= 1e+171) tmp = fma(fma(-12.0, x1, -6.0), x2, Float64(-x1)); elseif (t_3 <= Inf) tmp = t_4; else tmp = Float64(x1 + Float64(Float64(Float64(x1 * x1) * x2) * 8.0)); end return tmp 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]}, Block[{t$95$3 = 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]}, Block[{t$95$4 = N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+192], t$95$4, If[LessEqual[t$95$3, 1e+171], N[(N[(-12.0 * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[(x1 + N[(N[(N[(x1 * x1), $MachinePrecision] * x2), $MachinePrecision] * 8.0), $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}\\
t_3 := 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)\\
t_4 := \mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right) \cdot x1, x2, -x1\right)\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+192}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{+171}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-12, x1, -6\right), x2, -x1\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 \cdot x1\right) \cdot x2\right) \cdot 8\\
\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)))))) < -4.00000000000000016e192 or 9.99999999999999954e170 < (+.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
lower-*.f645.4
Applied rewrites5.4%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6441.1
Applied rewrites41.1%
Taylor expanded in x1 around inf
Applied rewrites41.1%
Taylor expanded in x2 around 0
Applied rewrites46.6%
if -4.00000000000000016e192 < (+.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)))))) < 9.99999999999999954e170Initial program 99.1%
Taylor expanded in x1 around 0
lower-*.f6457.1
Applied rewrites57.1%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6487.2
Applied rewrites87.2%
Taylor expanded in x2 around 0
Applied rewrites86.3%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x2 around inf
Applied rewrites45.2%
(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))
(t_3
(+
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))))))
(if (<= t_3 -2e+199)
(* (* (* x2 x2) x1) 8.0)
(if (<= t_3 1e+171)
(fma (fma -12.0 x1 -6.0) x2 (- x1))
(if (<= t_3 INFINITY)
(* (fma (fma 8.0 x2 -12.0) x2 -1.0) x1)
(+ x1 (* (* (* x1 x1) x2) 8.0)))))))
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;
double t_3 = 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 tmp;
if (t_3 <= -2e+199) {
tmp = ((x2 * x2) * x1) * 8.0;
} else if (t_3 <= 1e+171) {
tmp = fma(fma(-12.0, x1, -6.0), x2, -x1);
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(fma(8.0, x2, -12.0), x2, -1.0) * x1;
} else {
tmp = x1 + (((x1 * x1) * x2) * 8.0);
}
return tmp;
}
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) t_3 = 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)))) tmp = 0.0 if (t_3 <= -2e+199) tmp = Float64(Float64(Float64(x2 * x2) * x1) * 8.0); elseif (t_3 <= 1e+171) tmp = fma(fma(-12.0, x1, -6.0), x2, Float64(-x1)); elseif (t_3 <= Inf) tmp = Float64(fma(fma(8.0, x2, -12.0), x2, -1.0) * x1); else tmp = Float64(x1 + Float64(Float64(Float64(x1 * x1) * x2) * 8.0)); end return tmp 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]}, Block[{t$95$3 = 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]}, If[LessEqual[t$95$3, -2e+199], N[(N[(N[(x2 * x2), $MachinePrecision] * x1), $MachinePrecision] * 8.0), $MachinePrecision], If[LessEqual[t$95$3, 1e+171], N[(N[(-12.0 * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x2 + -1.0), $MachinePrecision] * x1), $MachinePrecision], N[(x1 + N[(N[(N[(x1 * x1), $MachinePrecision] * x2), $MachinePrecision] * 8.0), $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}\\
t_3 := 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)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+199}:\\
\;\;\;\;\left(\left(x2 \cdot x2\right) \cdot x1\right) \cdot 8\\
\mathbf{elif}\;t\_3 \leq 10^{+171}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-12, x1, -6\right), x2, -x1\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x2, -1\right) \cdot x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 \cdot x1\right) \cdot x2\right) \cdot 8\\
\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)))))) < -2.00000000000000019e199Initial program 99.9%
Taylor expanded in x1 around 0
lower-*.f641.8
Applied rewrites1.8%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6480.7
Applied rewrites80.7%
Taylor expanded in x2 around inf
Applied rewrites80.7%
if -2.00000000000000019e199 < (+.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)))))) < 9.99999999999999954e170Initial program 99.1%
Taylor expanded in x1 around 0
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
Taylor expanded in x2 around 0
Applied rewrites85.7%
if 9.99999999999999954e170 < (+.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.7%
Taylor expanded in x1 around 0
lower-*.f646.4
Applied rewrites6.4%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
Taylor expanded in x1 around inf
Applied rewrites30.5%
Taylor expanded in x2 around 0
Applied rewrites30.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x2 around inf
Applied rewrites45.2%
(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))
(t_3
(+
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))))))
(if (<= t_3 -2e+199)
(* (* (* x2 x2) x1) 8.0)
(if (<= t_3 1e+171)
(fma (fma -12.0 x1 -6.0) x2 (- x1))
(* (fma (fma 8.0 x2 -12.0) x2 -1.0) x1)))))
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;
double t_3 = 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 tmp;
if (t_3 <= -2e+199) {
tmp = ((x2 * x2) * x1) * 8.0;
} else if (t_3 <= 1e+171) {
tmp = fma(fma(-12.0, x1, -6.0), x2, -x1);
} else {
tmp = fma(fma(8.0, x2, -12.0), x2, -1.0) * x1;
}
return tmp;
}
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) t_3 = 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)))) tmp = 0.0 if (t_3 <= -2e+199) tmp = Float64(Float64(Float64(x2 * x2) * x1) * 8.0); elseif (t_3 <= 1e+171) tmp = fma(fma(-12.0, x1, -6.0), x2, Float64(-x1)); else tmp = Float64(fma(fma(8.0, x2, -12.0), x2, -1.0) * x1); end return tmp 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]}, Block[{t$95$3 = 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]}, If[LessEqual[t$95$3, -2e+199], N[(N[(N[(x2 * x2), $MachinePrecision] * x1), $MachinePrecision] * 8.0), $MachinePrecision], If[LessEqual[t$95$3, 1e+171], N[(N[(-12.0 * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x2 + -1.0), $MachinePrecision] * x1), $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}\\
t_3 := 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)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+199}:\\
\;\;\;\;\left(\left(x2 \cdot x2\right) \cdot x1\right) \cdot 8\\
\mathbf{elif}\;t\_3 \leq 10^{+171}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-12, x1, -6\right), x2, -x1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x2, -1\right) \cdot x1\\
\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)))))) < -2.00000000000000019e199Initial program 99.9%
Taylor expanded in x1 around 0
lower-*.f641.8
Applied rewrites1.8%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6480.7
Applied rewrites80.7%
Taylor expanded in x2 around inf
Applied rewrites80.7%
if -2.00000000000000019e199 < (+.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)))))) < 9.99999999999999954e170Initial program 99.1%
Taylor expanded in x1 around 0
lower-*.f6456.7
Applied rewrites56.7%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
Taylor expanded in x2 around 0
Applied rewrites85.7%
if 9.99999999999999954e170 < (+.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 44.0%
Taylor expanded in x1 around 0
lower-*.f644.2
Applied rewrites4.2%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6419.2
Applied rewrites19.2%
Taylor expanded in x1 around inf
Applied rewrites20.1%
Taylor expanded in x2 around 0
Applied rewrites20.1%
(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))
(t_3
(+
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))))))
(if (or (<= t_3 -2e+199) (not (<= t_3 2e+175)))
(* (* (* x2 x2) x1) 8.0)
(fma (fma -12.0 x1 -6.0) x2 (- x1)))))
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;
double t_3 = 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 tmp;
if ((t_3 <= -2e+199) || !(t_3 <= 2e+175)) {
tmp = ((x2 * x2) * x1) * 8.0;
} else {
tmp = fma(fma(-12.0, x1, -6.0), x2, -x1);
}
return tmp;
}
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) t_3 = 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)))) tmp = 0.0 if ((t_3 <= -2e+199) || !(t_3 <= 2e+175)) tmp = Float64(Float64(Float64(x2 * x2) * x1) * 8.0); else tmp = fma(fma(-12.0, x1, -6.0), x2, Float64(-x1)); end return tmp 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]}, Block[{t$95$3 = 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]}, If[Or[LessEqual[t$95$3, -2e+199], N[Not[LessEqual[t$95$3, 2e+175]], $MachinePrecision]], N[(N[(N[(x2 * x2), $MachinePrecision] * x1), $MachinePrecision] * 8.0), $MachinePrecision], N[(N[(-12.0 * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $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}\\
t_3 := 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)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+199} \lor \neg \left(t\_3 \leq 2 \cdot 10^{+175}\right):\\
\;\;\;\;\left(\left(x2 \cdot x2\right) \cdot x1\right) \cdot 8\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-12, x1, -6\right), x2, -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)))))) < -2.00000000000000019e199 or 1.9999999999999999e175 < (+.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 49.9%
Taylor expanded in x1 around 0
lower-*.f644.0
Applied rewrites4.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6426.3
Applied rewrites26.3%
Taylor expanded in x2 around inf
Applied rewrites26.6%
if -2.00000000000000019e199 < (+.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.9999999999999999e175Initial program 99.2%
Taylor expanded in x1 around 0
lower-*.f6456.3
Applied rewrites56.3%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6486.0
Applied rewrites86.0%
Taylor expanded in x2 around 0
Applied rewrites85.1%
Final simplification56.7%
(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))
(t_3 (/ (- (fma (* 3.0 x1) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0))))
(if (<=
(+
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))))
INFINITY)
(+
x1
(fma
(fma (fma t_3 4.0 -6.0) (* x1 x1) (* (- t_3 3.0) (* (* 2.0 x1) t_3)))
(fma x1 x1 1.0)
(fma
x1
(* x1 x1)
(fma
(/ 3.0 (fma x1 x1 1.0))
(fma -2.0 x2 (fma (* 3.0 x1) x1 (- x1)))
x1))))
(+
x1
(*
(+ (fma (fma 6.0 x1 -3.0) x1 (* (fma 2.0 x2 -3.0) 4.0)) 9.0)
(* x1 x1))))))
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;
double t_3 = (fma((3.0 * x1), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double tmp;
if ((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) INFINITY)) {
tmp = x1 + fma(fma(fma(t_3, 4.0, -6.0), (x1 * x1), ((t_3 - 3.0) * ((2.0 * x1) * t_3))), fma(x1, x1, 1.0), fma(x1, (x1 * x1), fma((3.0 / fma(x1, x1, 1.0)), fma(-2.0, x2, fma((3.0 * x1), x1, -x1)), x1)));
} else {
tmp = x1 + ((fma(fma(6.0, x1, -3.0), x1, (fma(2.0, x2, -3.0) * 4.0)) + 9.0) * (x1 * x1));
}
return tmp;
}
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) t_3 = Float64(Float64(fma(Float64(3.0 * x1), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (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)))) <= Inf) tmp = Float64(x1 + fma(fma(fma(t_3, 4.0, -6.0), Float64(x1 * x1), Float64(Float64(t_3 - 3.0) * Float64(Float64(2.0 * x1) * t_3))), fma(x1, x1, 1.0), fma(x1, Float64(x1 * x1), fma(Float64(3.0 / fma(x1, x1, 1.0)), fma(-2.0, x2, fma(Float64(3.0 * x1), x1, Float64(-x1))), x1)))); else tmp = Float64(x1 + Float64(Float64(fma(fma(6.0, x1, -3.0), x1, Float64(fma(2.0, x2, -3.0) * 4.0)) + 9.0) * Float64(x1 * x1))); end return tmp 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]}, Block[{t$95$3 = N[(N[(N[(N[(3.0 * x1), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(x1 + N[(N[(N[(t$95$3 * 4.0 + -6.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(2.0 * x1), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision] + N[(N[(3.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-2.0 * x2 + N[(N[(3.0 * x1), $MachinePrecision] * x1 + (-x1)), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(N[(N[(6.0 * x1 + -3.0), $MachinePrecision] * x1 + N[(N[(2.0 * x2 + -3.0), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision] * N[(x1 * x1), $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}\\
t_3 := \frac{\mathsf{fma}\left(3 \cdot x1, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_3, 4, -6\right), x1 \cdot x1, \left(t\_3 - 3\right) \cdot \left(\left(2 \cdot x1\right) \cdot t\_3\right)\right), \mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot x1, \mathsf{fma}\left(\frac{3}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(-2, x2, \mathsf{fma}\left(3 \cdot x1, x1, -x1\right)\right), x1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\mathsf{fma}\left(\mathsf{fma}\left(6, x1, -3\right), x1, \mathsf{fma}\left(2, x2, -3\right) \cdot 4\right) + 9\right) \cdot \left(x1 \cdot 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%
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in x1 around inf
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x1 around 0
Applied rewrites100.0%
(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)))
(if (<=
(+
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))))
INFINITY)
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))
(+ x1 (* (* (* x1 x1) x2) 8.0)))))
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;
double tmp;
if ((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) INFINITY)) {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
} else {
tmp = x1 + (((x1 * x1) * x2) * 8.0);
}
return tmp;
}
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) tmp = 0.0 if (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)))) <= Inf) tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); else tmp = Float64(x1 + Float64(Float64(Float64(x1 * x1) * x2) * 8.0)); end return tmp 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]}, If[LessEqual[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], Infinity], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], N[(x1 + N[(N[(N[(x1 * x1), $MachinePrecision] * x2), $MachinePrecision] * 8.0), $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}\\
\mathbf{if}\;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) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 \cdot x1\right) \cdot x2\right) \cdot 8\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Taylor expanded in x1 around 0
lower-*.f6440.0
Applied rewrites40.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6472.0
Applied rewrites72.0%
Taylor expanded in x2 around 0
Applied rewrites20.1%
Taylor expanded in x2 around 0
Applied rewrites77.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in x2 around inf
Applied rewrites45.2%
(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)))
(if (<=
(+
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))))
1e+237)
(fma -1.0 x1 (* -6.0 x2))
(* (fma -12.0 x2 -1.0) x1))))
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;
double tmp;
if ((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)))) <= 1e+237) {
tmp = fma(-1.0, x1, (-6.0 * x2));
} else {
tmp = fma(-12.0, x2, -1.0) * x1;
}
return tmp;
}
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) tmp = 0.0 if (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)))) <= 1e+237) tmp = fma(-1.0, x1, Float64(-6.0 * x2)); else tmp = Float64(fma(-12.0, x2, -1.0) * x1); end return tmp 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]}, If[LessEqual[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], 1e+237], N[(-1.0 * x1 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision], N[(N[(-12.0 * x2 + -1.0), $MachinePrecision] * x1), $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}\\
\mathbf{if}\;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) \leq 10^{+237}:\\
\;\;\;\;\mathsf{fma}\left(-1, x1, -6 \cdot x2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-12, x2, -1\right) \cdot x1\\
\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)))))) < 9.9999999999999994e236Initial program 99.3%
Taylor expanded in x1 around 0
lower-*.f6449.3
Applied rewrites49.3%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6482.1
Applied rewrites82.1%
Taylor expanded in x2 around 0
Applied rewrites73.4%
if 9.9999999999999994e236 < (+.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.9%
Taylor expanded in x1 around 0
lower-*.f642.4
Applied rewrites2.4%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6418.1
Applied rewrites18.1%
Taylor expanded in x1 around inf
Applied rewrites19.1%
Taylor expanded in x2 around 0
Applied rewrites11.4%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -28.5) (not (<= x1 1.4)))
(+
x1
(*
(- 6.0 (/ (- 3.0 (/ (fma (fma 2.0 x2 -3.0) 4.0 9.0) x1)) x1))
(pow x1 4.0)))
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -28.5) || !(x1 <= 1.4)) {
tmp = x1 + ((6.0 - ((3.0 - (fma(fma(2.0, x2, -3.0), 4.0, 9.0) / x1)) / x1)) * pow(x1, 4.0));
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -28.5) || !(x1 <= 1.4)) tmp = Float64(x1 + Float64(Float64(6.0 - Float64(Float64(3.0 - Float64(fma(fma(2.0, x2, -3.0), 4.0, 9.0) / x1)) / x1)) * (x1 ^ 4.0))); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -28.5], N[Not[LessEqual[x1, 1.4]], $MachinePrecision]], N[(x1 + N[(N[(6.0 - N[(N[(3.0 - N[(N[(N[(2.0 * x2 + -3.0), $MachinePrecision] * 4.0 + 9.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -28.5 \lor \neg \left(x1 \leq 1.4\right):\\
\;\;\;\;x1 + \left(6 - \frac{3 - \frac{\mathsf{fma}\left(\mathsf{fma}\left(2, x2, -3\right), 4, 9\right)}{x1}}{x1}\right) \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -28.5 or 1.3999999999999999 < x1 Initial program 43.4%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.0%
if -28.5 < x1 < 1.3999999999999999Initial program 99.3%
Taylor expanded in x1 around 0
lower-*.f6452.3
Applied rewrites52.3%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.6
Applied rewrites90.6%
Taylor expanded in x2 around 0
Applied rewrites26.0%
Taylor expanded in x2 around 0
Applied rewrites97.9%
Final simplification97.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (fma 2.0 x2 -3.0) 4.0 9.0)))
(if (<= x1 -28.5)
(+ x1 (* (+ (/ t_0 (* x1 x1)) (- 6.0 (/ 3.0 x1))) (pow x1 4.0)))
(if (<= x1 1.4)
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))
(+ x1 (* (- 6.0 (/ (- 3.0 (/ t_0 x1)) x1)) (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = fma(fma(2.0, x2, -3.0), 4.0, 9.0);
double tmp;
if (x1 <= -28.5) {
tmp = x1 + (((t_0 / (x1 * x1)) + (6.0 - (3.0 / x1))) * pow(x1, 4.0));
} else if (x1 <= 1.4) {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
} else {
tmp = x1 + ((6.0 - ((3.0 - (t_0 / x1)) / x1)) * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = fma(fma(2.0, x2, -3.0), 4.0, 9.0) tmp = 0.0 if (x1 <= -28.5) tmp = Float64(x1 + Float64(Float64(Float64(t_0 / Float64(x1 * x1)) + Float64(6.0 - Float64(3.0 / x1))) * (x1 ^ 4.0))); elseif (x1 <= 1.4) tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); else tmp = Float64(x1 + Float64(Float64(6.0 - Float64(Float64(3.0 - Float64(t_0 / x1)) / x1)) * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2 + -3.0), $MachinePrecision] * 4.0 + 9.0), $MachinePrecision]}, If[LessEqual[x1, -28.5], N[(x1 + N[(N[(N[(t$95$0 / N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.4], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], N[(x1 + N[(N[(6.0 - N[(N[(3.0 - N[(t$95$0 / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(2, x2, -3\right), 4, 9\right)\\
\mathbf{if}\;x1 \leq -28.5:\\
\;\;\;\;x1 + \left(\frac{t\_0}{x1 \cdot x1} + \left(6 - \frac{3}{x1}\right)\right) \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(6 - \frac{3 - \frac{t\_0}{x1}}{x1}\right) \cdot {x1}^{4}\\
\end{array}
\end{array}
if x1 < -28.5Initial program 33.7%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.5%
if -28.5 < x1 < 1.3999999999999999Initial program 99.3%
Taylor expanded in x1 around 0
lower-*.f6452.3
Applied rewrites52.3%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.6
Applied rewrites90.6%
Taylor expanded in x2 around 0
Applied rewrites26.0%
Taylor expanded in x2 around 0
Applied rewrites97.9%
if 1.3999999999999999 < x1 Initial program 53.5%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.6%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -28.5) (not (<= x1 1.4)))
(+
x1
(* (+ (fma (fma 6.0 x1 -3.0) x1 (* (fma 2.0 x2 -3.0) 4.0)) 9.0) (* x1 x1)))
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -28.5) || !(x1 <= 1.4)) {
tmp = x1 + ((fma(fma(6.0, x1, -3.0), x1, (fma(2.0, x2, -3.0) * 4.0)) + 9.0) * (x1 * x1));
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -28.5) || !(x1 <= 1.4)) tmp = Float64(x1 + Float64(Float64(fma(fma(6.0, x1, -3.0), x1, Float64(fma(2.0, x2, -3.0) * 4.0)) + 9.0) * Float64(x1 * x1))); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -28.5], N[Not[LessEqual[x1, 1.4]], $MachinePrecision]], N[(x1 + N[(N[(N[(N[(6.0 * x1 + -3.0), $MachinePrecision] * x1 + N[(N[(2.0 * x2 + -3.0), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -28.5 \lor \neg \left(x1 \leq 1.4\right):\\
\;\;\;\;x1 + \left(\mathsf{fma}\left(\mathsf{fma}\left(6, x1, -3\right), x1, \mathsf{fma}\left(2, x2, -3\right) \cdot 4\right) + 9\right) \cdot \left(x1 \cdot x1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -28.5 or 1.3999999999999999 < x1 Initial program 43.4%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.0%
Taylor expanded in x1 around 0
Applied rewrites98.0%
if -28.5 < x1 < 1.3999999999999999Initial program 99.3%
Taylor expanded in x1 around 0
lower-*.f6452.3
Applied rewrites52.3%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.6
Applied rewrites90.6%
Taylor expanded in x2 around 0
Applied rewrites26.0%
Taylor expanded in x2 around 0
Applied rewrites97.9%
Final simplification97.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -72.0) (not (<= x1 10000000000.0))) (+ x1 (* (* (- 6.0 (/ 3.0 x1)) (* x1 x1)) (* x1 x1))) (fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -72.0) || !(x1 <= 10000000000.0)) {
tmp = x1 + (((6.0 - (3.0 / x1)) * (x1 * x1)) * (x1 * x1));
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -72.0) || !(x1 <= 10000000000.0)) tmp = Float64(x1 + Float64(Float64(Float64(6.0 - Float64(3.0 / x1)) * Float64(x1 * x1)) * Float64(x1 * x1))); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -72.0], N[Not[LessEqual[x1, 10000000000.0]], $MachinePrecision]], N[(x1 + N[(N[(N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -72 \lor \neg \left(x1 \leq 10000000000\right):\\
\;\;\;\;x1 + \left(\left(6 - \frac{3}{x1}\right) \cdot \left(x1 \cdot x1\right)\right) \cdot \left(x1 \cdot x1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -72 or 1e10 < x1 Initial program 43.8%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f6493.0
Applied rewrites93.0%
Applied rewrites93.0%
if -72 < x1 < 1e10Initial program 98.6%
Taylor expanded in x1 around 0
lower-*.f6452.0
Applied rewrites52.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in x2 around 0
Applied rewrites25.8%
Taylor expanded in x2 around 0
Applied rewrites97.9%
Final simplification95.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -72.0)
(+ x1 (* (* (fma 6.0 x1 -3.0) x1) (* x1 x1)))
(if (<= x1 10000000000.0)
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))
(+ x1 (* (* (* (* (- 6.0 (/ 3.0 x1)) x1) x1) x1) x1)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -72.0) {
tmp = x1 + ((fma(6.0, x1, -3.0) * x1) * (x1 * x1));
} else if (x1 <= 10000000000.0) {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
} else {
tmp = x1 + (((((6.0 - (3.0 / x1)) * x1) * x1) * x1) * x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -72.0) tmp = Float64(x1 + Float64(Float64(fma(6.0, x1, -3.0) * x1) * Float64(x1 * x1))); elseif (x1 <= 10000000000.0) tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); else tmp = Float64(x1 + Float64(Float64(Float64(Float64(Float64(6.0 - Float64(3.0 / x1)) * x1) * x1) * x1) * x1)); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -72.0], N[(x1 + N[(N[(N[(6.0 * x1 + -3.0), $MachinePrecision] * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 10000000000.0], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision], N[(x1 + N[(N[(N[(N[(N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision] * x1), $MachinePrecision] * x1), $MachinePrecision] * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -72:\\
\;\;\;\;x1 + \left(\mathsf{fma}\left(6, x1, -3\right) \cdot x1\right) \cdot \left(x1 \cdot x1\right)\\
\mathbf{elif}\;x1 \leq 10000000000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(\left(\left(6 - \frac{3}{x1}\right) \cdot x1\right) \cdot x1\right) \cdot x1\right) \cdot x1\\
\end{array}
\end{array}
if x1 < -72Initial program 33.7%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f6494.4
Applied rewrites94.4%
Applied rewrites94.4%
Taylor expanded in x1 around 0
Applied rewrites94.4%
if -72 < x1 < 1e10Initial program 98.6%
Taylor expanded in x1 around 0
lower-*.f6452.0
Applied rewrites52.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in x2 around 0
Applied rewrites25.8%
Taylor expanded in x2 around 0
Applied rewrites97.9%
if 1e10 < x1 Initial program 54.5%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f6491.6
Applied rewrites91.6%
Applied rewrites91.5%
Applied rewrites91.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.6e+150)
(/ (* (- x1) x1) x1)
(if (or (<= x1 -2.2e+52) (not (<= x1 9800000000.0)))
(+ x1 (* (* (* x1 x1) x2) 8.0))
(fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.6e+150) {
tmp = (-x1 * x1) / x1;
} else if ((x1 <= -2.2e+52) || !(x1 <= 9800000000.0)) {
tmp = x1 + (((x1 * x1) * x2) * 8.0);
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -1.6e+150) tmp = Float64(Float64(Float64(-x1) * x1) / x1); elseif ((x1 <= -2.2e+52) || !(x1 <= 9800000000.0)) tmp = Float64(x1 + Float64(Float64(Float64(x1 * x1) * x2) * 8.0)); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -1.6e+150], N[(N[((-x1) * x1), $MachinePrecision] / x1), $MachinePrecision], If[Or[LessEqual[x1, -2.2e+52], N[Not[LessEqual[x1, 9800000000.0]], $MachinePrecision]], N[(x1 + N[(N[(N[(x1 * x1), $MachinePrecision] * x2), $MachinePrecision] * 8.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+150}:\\
\;\;\;\;\frac{\left(-x1\right) \cdot x1}{x1}\\
\mathbf{elif}\;x1 \leq -2.2 \cdot 10^{+52} \lor \neg \left(x1 \leq 9800000000\right):\\
\;\;\;\;x1 + \left(\left(x1 \cdot x1\right) \cdot x2\right) \cdot 8\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000008e150Initial program 0.0%
Taylor expanded in x1 around 0
lower-*.f640.5
Applied rewrites0.5%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f644.0
Applied rewrites4.0%
Taylor expanded in x2 around 0
Applied rewrites7.0%
Applied rewrites96.5%
if -1.60000000000000008e150 < x1 < -2.2e52 or 9.8e9 < x1 Initial program 53.7%
Taylor expanded in x1 around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.7%
Taylor expanded in x2 around inf
Applied rewrites29.3%
if -2.2e52 < x1 < 9.8e9Initial program 99.3%
Taylor expanded in x1 around 0
lower-*.f6450.0
Applied rewrites50.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in x2 around 0
Applied rewrites25.1%
Taylor expanded in x2 around 0
Applied rewrites94.4%
Final simplification75.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -72.0) (not (<= x1 10000000000.0))) (+ x1 (* (* (fma 6.0 x1 -3.0) x1) (* x1 x1))) (fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -72.0) || !(x1 <= 10000000000.0)) {
tmp = x1 + ((fma(6.0, x1, -3.0) * x1) * (x1 * x1));
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -72.0) || !(x1 <= 10000000000.0)) tmp = Float64(x1 + Float64(Float64(fma(6.0, x1, -3.0) * x1) * Float64(x1 * x1))); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -72.0], N[Not[LessEqual[x1, 10000000000.0]], $MachinePrecision]], N[(x1 + N[(N[(N[(6.0 * x1 + -3.0), $MachinePrecision] * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -72 \lor \neg \left(x1 \leq 10000000000\right):\\
\;\;\;\;x1 + \left(\mathsf{fma}\left(6, x1, -3\right) \cdot x1\right) \cdot \left(x1 \cdot x1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -72 or 1e10 < x1 Initial program 43.8%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f6493.0
Applied rewrites93.0%
Applied rewrites93.0%
Taylor expanded in x1 around 0
Applied rewrites93.0%
if -72 < x1 < 1e10Initial program 98.6%
Taylor expanded in x1 around 0
lower-*.f6452.0
Applied rewrites52.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in x2 around 0
Applied rewrites25.8%
Taylor expanded in x2 around 0
Applied rewrites97.9%
Final simplification95.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -80.0) (not (<= x1 13000000000.0))) (+ x1 (* (* (* 6.0 x1) x1) (* x1 x1))) (fma (fma (fma 8.0 x2 -12.0) x1 -6.0) x2 (- x1))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -80.0) || !(x1 <= 13000000000.0)) {
tmp = x1 + (((6.0 * x1) * x1) * (x1 * x1));
} else {
tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, -x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -80.0) || !(x1 <= 13000000000.0)) tmp = Float64(x1 + Float64(Float64(Float64(6.0 * x1) * x1) * Float64(x1 * x1))); else tmp = fma(fma(fma(8.0, x2, -12.0), x1, -6.0), x2, Float64(-x1)); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -80.0], N[Not[LessEqual[x1, 13000000000.0]], $MachinePrecision]], N[(x1 + N[(N[(N[(6.0 * x1), $MachinePrecision] * x1), $MachinePrecision] * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(8.0 * x2 + -12.0), $MachinePrecision] * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -80 \lor \neg \left(x1 \leq 13000000000\right):\\
\;\;\;\;x1 + \left(\left(6 \cdot x1\right) \cdot x1\right) \cdot \left(x1 \cdot x1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(8, x2, -12\right), x1, -6\right), x2, -x1\right)\\
\end{array}
\end{array}
if x1 < -80 or 1.3e10 < x1 Initial program 43.8%
Taylor expanded in x1 around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f6493.0
Applied rewrites93.0%
Applied rewrites93.0%
Taylor expanded in x1 around inf
Applied rewrites92.3%
if -80 < x1 < 1.3e10Initial program 98.6%
Taylor expanded in x1 around 0
lower-*.f6452.0
Applied rewrites52.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6490.0
Applied rewrites90.0%
Taylor expanded in x2 around 0
Applied rewrites25.8%
Taylor expanded in x2 around 0
Applied rewrites97.9%
Final simplification95.5%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) -5e-166) (* -6.0 x2) (if (<= (* 2.0 x2) 1e-112) (- x1) (+ x1 (* -6.0 x2)))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -5e-166) {
tmp = -6.0 * x2;
} else if ((2.0 * x2) <= 1e-112) {
tmp = -x1;
} else {
tmp = x1 + (-6.0 * x2);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((2.0d0 * x2) <= (-5d-166)) then
tmp = (-6.0d0) * x2
else if ((2.0d0 * x2) <= 1d-112) then
tmp = -x1
else
tmp = x1 + ((-6.0d0) * x2)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -5e-166) {
tmp = -6.0 * x2;
} else if ((2.0 * x2) <= 1e-112) {
tmp = -x1;
} else {
tmp = x1 + (-6.0 * x2);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (2.0 * x2) <= -5e-166: tmp = -6.0 * x2 elif (2.0 * x2) <= 1e-112: tmp = -x1 else: tmp = x1 + (-6.0 * x2) return tmp
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= -5e-166) tmp = Float64(-6.0 * x2); elseif (Float64(2.0 * x2) <= 1e-112) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(-6.0 * x2)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((2.0 * x2) <= -5e-166) tmp = -6.0 * x2; elseif ((2.0 * x2) <= 1e-112) tmp = -x1; else tmp = x1 + (-6.0 * x2); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], -5e-166], N[(-6.0 * x2), $MachinePrecision], If[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e-112], (-x1), N[(x1 + N[(-6.0 * x2), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;-6 \cdot x2\\
\mathbf{elif}\;2 \cdot x2 \leq 10^{-112}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + -6 \cdot x2\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -5e-166Initial program 76.0%
Applied rewrites82.2%
Applied rewrites82.2%
Taylor expanded in x1 around 0
lower-*.f6440.1
Applied rewrites40.1%
if -5e-166 < (*.f64 #s(literal 2 binary64) x2) < 9.9999999999999995e-113Initial program 74.5%
Taylor expanded in x1 around 0
lower-*.f6414.4
Applied rewrites14.4%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6455.2
Applied rewrites55.2%
Taylor expanded in x2 around 0
Applied rewrites42.9%
if 9.9999999999999995e-113 < (*.f64 #s(literal 2 binary64) x2) Initial program 75.2%
Taylor expanded in x1 around 0
lower-*.f6435.0
Applied rewrites35.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= (* 2.0 x2) -5e-166) (not (<= (* 2.0 x2) 1e-112))) (* -6.0 x2) (- x1)))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e-166) || !((2.0 * x2) <= 1e-112)) {
tmp = -6.0 * x2;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (((2.0d0 * x2) <= (-5d-166)) .or. (.not. ((2.0d0 * x2) <= 1d-112))) then
tmp = (-6.0d0) * x2
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e-166) || !((2.0 * x2) <= 1e-112)) {
tmp = -6.0 * x2;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -5e-166) or not ((2.0 * x2) <= 1e-112): tmp = -6.0 * x2 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -5e-166) || !(Float64(2.0 * x2) <= 1e-112)) tmp = Float64(-6.0 * x2); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -5e-166) || ~(((2.0 * x2) <= 1e-112))) tmp = -6.0 * x2; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -5e-166], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e-112]], $MachinePrecision]], N[(-6.0 * x2), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -5 \cdot 10^{-166} \lor \neg \left(2 \cdot x2 \leq 10^{-112}\right):\\
\;\;\;\;-6 \cdot x2\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -5e-166 or 9.9999999999999995e-113 < (*.f64 #s(literal 2 binary64) x2) Initial program 75.6%
Applied rewrites81.1%
Applied rewrites81.2%
Taylor expanded in x1 around 0
lower-*.f6437.6
Applied rewrites37.6%
if -5e-166 < (*.f64 #s(literal 2 binary64) x2) < 9.9999999999999995e-113Initial program 74.5%
Taylor expanded in x1 around 0
lower-*.f6414.4
Applied rewrites14.4%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6455.2
Applied rewrites55.2%
Taylor expanded in x2 around 0
Applied rewrites42.9%
Final simplification39.1%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.12e-142) (not (<= x1 7e-75))) (* (fma -12.0 x2 -1.0) x1) (* -6.0 x2)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.12e-142) || !(x1 <= 7e-75)) {
tmp = fma(-12.0, x2, -1.0) * x1;
} else {
tmp = -6.0 * x2;
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.12e-142) || !(x1 <= 7e-75)) tmp = Float64(fma(-12.0, x2, -1.0) * x1); else tmp = Float64(-6.0 * x2); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.12e-142], N[Not[LessEqual[x1, 7e-75]], $MachinePrecision]], N[(N[(-12.0 * x2 + -1.0), $MachinePrecision] * x1), $MachinePrecision], N[(-6.0 * x2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.12 \cdot 10^{-142} \lor \neg \left(x1 \leq 7 \cdot 10^{-75}\right):\\
\;\;\;\;\mathsf{fma}\left(-12, x2, -1\right) \cdot x1\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot x2\\
\end{array}
\end{array}
if x1 < -1.1199999999999999e-142 or 6.9999999999999997e-75 < x1 Initial program 60.5%
Taylor expanded in x1 around 0
lower-*.f646.8
Applied rewrites6.8%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6437.1
Applied rewrites37.1%
Taylor expanded in x1 around inf
Applied rewrites31.1%
Taylor expanded in x2 around 0
Applied rewrites21.2%
if -1.1199999999999999e-142 < x1 < 6.9999999999999997e-75Initial program 99.5%
Applied rewrites99.8%
Applied rewrites99.8%
Taylor expanded in x1 around 0
lower-*.f6471.1
Applied rewrites71.1%
Final simplification40.1%
(FPCore (x1 x2) :precision binary64 (fma (fma -12.0 x1 -6.0) x2 (- x1)))
double code(double x1, double x2) {
return fma(fma(-12.0, x1, -6.0), x2, -x1);
}
function code(x1, x2) return fma(fma(-12.0, x1, -6.0), x2, Float64(-x1)) end
code[x1_, x2_] := N[(N[(-12.0 * x1 + -6.0), $MachinePrecision] * x2 + (-x1)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(-12, x1, -6\right), x2, -x1\right)
\end{array}
Initial program 75.3%
Taylor expanded in x1 around 0
lower-*.f6431.0
Applied rewrites31.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6457.1
Applied rewrites57.1%
Taylor expanded in x2 around 0
Applied rewrites49.4%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 75.3%
Taylor expanded in x1 around 0
lower-*.f6431.0
Applied rewrites31.0%
Taylor expanded in x1 around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f6457.1
Applied rewrites57.1%
Taylor expanded in x2 around 0
Applied rewrites16.2%
herbie shell --seed 2024305
(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))))))