
(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 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+ x1 (+ (+ x1 (+ t_0 (+ t_4 (* 3.0 t_1)))) (* 3.0 (- (* x2 -2.0) x1))))
(fma (* x1 x1) (* (* x1 x1) 6.0) x1))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = fma((x1 * x1), ((x1 * x1) * 6.0), x1);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = fma(Float64(x1 * x1), Float64(Float64(x1 * x1) * 6.0), x1); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * x1), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + x1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_4 + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot x1\right) \cdot 6, 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.5%
Taylor expanded in x1 around inf
Simplified98.5%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5
Simplified99.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
*-lowering-*.f64N/A
pow-lowering-pow.f64100.0
Simplified100.0%
+-commutativeN/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64100.0
Applied egg-rr100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x2 (* x2 8.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -4e+255)
t_1
(if (<= t_4 1e+251)
(+ x1 (fma x1 (fma x1 9.0 -2.0) (* x2 -6.0)))
(if (<= t_4 INFINITY) (+ x1 t_1) (+ x1 (* x1 (fma x1 9.0 -2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x2 * (x2 * 8.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -4e+255) {
tmp = t_1;
} else if (t_4 <= 1e+251) {
tmp = x1 + fma(x1, fma(x1, 9.0, -2.0), (x2 * -6.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = x1 + t_1;
} else {
tmp = x1 + (x1 * fma(x1, 9.0, -2.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -4e+255) tmp = t_1; elseif (t_4 <= 1e+251) tmp = Float64(x1 + fma(x1, fma(x1, 9.0, -2.0), Float64(x2 * -6.0))); elseif (t_4 <= Inf) tmp = Float64(x1 + t_1); else tmp = Float64(x1 + Float64(x1 * fma(x1, 9.0, -2.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+255], t$95$1, If[LessEqual[t$95$4, 1e+251], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(x1 + t$95$1), $MachinePrecision], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -4 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{+251}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 9, -2\right), x2 \cdot -6\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;x1 + t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \mathsf{fma}\left(x1, 9, -2\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)))))) < -3.99999999999999995e255Initial program 99.8%
Taylor expanded in x1 around inf
Simplified99.8%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8
Simplified99.8%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6463.0
Simplified63.0%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6463.0
Simplified63.0%
if -3.99999999999999995e255 < (+.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)))))) < 1e251Initial program 99.3%
Taylor expanded in x1 around 0
Simplified75.4%
Taylor expanded in x2 around 0
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6473.7
Simplified73.7%
if 1e251 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.9%
Taylor expanded in x1 around 0
Simplified46.8%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6445.2
Simplified45.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Simplified66.6%
Taylor expanded in x2 around 0
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6491.0
Simplified91.0%
Final simplification72.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x2 (* x2 8.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -4e+255)
t_1
(if (<= t_4 1e+251)
(fma x2 (fma x1 -12.0 -6.0) (- x1))
(if (<= t_4 INFINITY) (+ x1 t_1) (+ x1 (* x1 (fma x1 9.0 -2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x2 * (x2 * 8.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -4e+255) {
tmp = t_1;
} else if (t_4 <= 1e+251) {
tmp = fma(x2, fma(x1, -12.0, -6.0), -x1);
} else if (t_4 <= ((double) INFINITY)) {
tmp = x1 + t_1;
} else {
tmp = x1 + (x1 * fma(x1, 9.0, -2.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -4e+255) tmp = t_1; elseif (t_4 <= 1e+251) tmp = fma(x2, fma(x1, -12.0, -6.0), Float64(-x1)); elseif (t_4 <= Inf) tmp = Float64(x1 + t_1); else tmp = Float64(x1 + Float64(x1 * fma(x1, 9.0, -2.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+255], t$95$1, If[LessEqual[t$95$4, 1e+251], N[(x2 * N[(x1 * -12.0 + -6.0), $MachinePrecision] + (-x1)), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(x1 + t$95$1), $MachinePrecision], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -4 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{+251}:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, -12, -6\right), -x1\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;x1 + t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \mathsf{fma}\left(x1, 9, -2\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)))))) < -3.99999999999999995e255Initial program 99.8%
Taylor expanded in x1 around inf
Simplified99.8%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8
Simplified99.8%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6463.0
Simplified63.0%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6463.0
Simplified63.0%
if -3.99999999999999995e255 < (+.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)))))) < 1e251Initial program 99.3%
Taylor expanded in x1 around inf
Simplified97.9%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3
Simplified99.3%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6473.9
Simplified73.9%
Taylor expanded in x2 around 0
associate-+r+N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f6472.5
Simplified72.5%
if 1e251 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.9%
Taylor expanded in x1 around 0
Simplified46.8%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6445.2
Simplified45.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Simplified66.6%
Taylor expanded in x2 around 0
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6491.0
Simplified91.0%
Final simplification71.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x2 (* x2 8.0))))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))))
(if (<= t_4 -4e+255)
t_1
(if (<= t_4 1e+251)
(fma x2 (fma x1 -12.0 -6.0) (- x1))
(if (<= t_4 INFINITY) t_1 (+ x1 (* x1 (fma x1 9.0 -2.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x2 * (x2 * 8.0));
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)));
double tmp;
if (t_4 <= -4e+255) {
tmp = t_1;
} else if (t_4 <= 1e+251) {
tmp = fma(x2, fma(x1, -12.0, -6.0), -x1);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x1 + (x1 * fma(x1, 9.0, -2.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) tmp = 0.0 if (t_4 <= -4e+255) tmp = t_1; elseif (t_4 <= 1e+251) tmp = fma(x2, fma(x1, -12.0, -6.0), Float64(-x1)); elseif (t_4 <= Inf) tmp = t_1; else tmp = Float64(x1 + Float64(x1 * fma(x1, 9.0, -2.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -4e+255], t$95$1, If[LessEqual[t$95$4, 1e+251], N[(x2 * N[(x1 * -12.0 + -6.0), $MachinePrecision] + (-x1)), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$1, N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right)\\
\mathbf{if}\;t\_4 \leq -4 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{+251}:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, -12, -6\right), -x1\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \mathsf{fma}\left(x1, 9, -2\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)))))) < -3.99999999999999995e255 or 1e251 < (+.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 inf
Simplified99.8%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8
Simplified99.8%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6450.2
Simplified50.2%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6450.1
Simplified50.1%
if -3.99999999999999995e255 < (+.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)))))) < 1e251Initial program 99.3%
Taylor expanded in x1 around inf
Simplified97.9%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3
Simplified99.3%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6473.9
Simplified73.9%
Taylor expanded in x2 around 0
associate-+r+N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f6472.5
Simplified72.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 0
Simplified66.6%
Taylor expanded in x2 around 0
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6491.0
Simplified91.0%
Final simplification71.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(fma x2 (fma x1 -12.0 -6.0) (- x1))
(+ x1 (* x1 (fma x1 9.0 -2.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = fma(x2, fma(x1, -12.0, -6.0), -x1);
} else {
tmp = x1 + (x1 * fma(x1, 9.0, -2.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = fma(x2, fma(x1, -12.0, -6.0), Float64(-x1)); else tmp = Float64(x1 + Float64(x1 * fma(x1, 9.0, -2.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x2 * N[(x1 * -12.0 + -6.0), $MachinePrecision] + (-x1)), $MachinePrecision], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, -12, -6\right), -x1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \mathsf{fma}\left(x1, 9, -2\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.5%
Taylor expanded in x1 around inf
Simplified98.5%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5
Simplified99.5%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6466.3
Simplified66.3%
Taylor expanded in x2 around 0
associate-+r+N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f6452.2
Simplified52.2%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around 0
Simplified66.6%
Taylor expanded in x2 around 0
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6491.0
Simplified91.0%
Final simplification61.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma 4.0 (fma x2 2.0 -3.0) 9.0)))
(if (<= x1 -5800.0)
(+
x1
(*
(pow x1 4.0)
(+
6.0
(/ (- (/ (- t_0 (/ (* (fma x2 2.0 -3.0) -6.0) x1)) x1) 3.0) x1))))
(if (<= x1 2100.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ (- (/ t_0 x1) 3.0) x1))))))))
double code(double x1, double x2) {
double t_0 = fma(4.0, fma(x2, 2.0, -3.0), 9.0);
double tmp;
if (x1 <= -5800.0) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + ((((t_0 - ((fma(x2, 2.0, -3.0) * -6.0) / x1)) / x1) - 3.0) / x1)));
} else if (x1 <= 2100.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (((t_0 / x1) - 3.0) / x1)));
}
return tmp;
}
function code(x1, x2) t_0 = fma(4.0, fma(x2, 2.0, -3.0), 9.0) tmp = 0.0 if (x1 <= -5800.0) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(t_0 - Float64(Float64(fma(x2, 2.0, -3.0) * -6.0) / x1)) / x1) - 3.0) / x1)))); elseif (x1 <= 2100.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(t_0 / x1) - 3.0) / x1)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision]}, If[LessEqual[x1, -5800.0], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(t$95$0 - N[(N[(N[(x2 * 2.0 + -3.0), $MachinePrecision] * -6.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2100.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(t$95$0 / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)\\
\mathbf{if}\;x1 \leq -5800:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{t\_0 - \frac{\mathsf{fma}\left(x2, 2, -3\right) \cdot -6}{x1}}{x1} - 3}{x1}\right)\\
\mathbf{elif}\;x1 \leq 2100:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{t\_0}{x1} - 3}{x1}\right)\\
\end{array}
\end{array}
if x1 < -5800Initial program 36.6%
Taylor expanded in x1 around -inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified99.9%
if -5800 < x1 < 2100Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
if 2100 < x1 Initial program 56.4%
Taylor expanded in x1 around -inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified96.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(*
(pow x1 4.0)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) 9.0) x1) 3.0) x1))))))
(if (<= x1 -8500.0)
t_0
(if (<= x1 2100000.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (pow(x1, 4.0) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)));
double tmp;
if (x1 <= -8500.0) {
tmp = t_0;
} else if (x1 <= 2100000.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), 9.0) / x1) - 3.0) / x1)))) tmp = 0.0 if (x1 <= -8500.0) tmp = t_0; elseif (x1 <= 2100000.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + 9.0), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8500.0], t$95$0, If[LessEqual[x1, 2100000.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + {x1}^{4} \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), 9\right)}{x1} - 3}{x1}\right)\\
\mathbf{if}\;x1 \leq -8500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2100000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -8500 or 2.1e6 < x1 Initial program 46.8%
Taylor expanded in x1 around -inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified97.8%
if -8500 < x1 < 2.1e6Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -5600.0)
(+ x1 (* (pow x1 4.0) (+ 6.0 (/ -3.0 x1))))
(if (<= x1 30000.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 (* x1 (* x1 3.0)))
(*
(+ (* x1 x1) 1.0)
(*
(* x1 x1)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) -6.0) x1) 4.0) x1)))))))
(* 3.0 3.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -5600.0) {
tmp = x1 + (pow(x1, 4.0) * (6.0 + (-3.0 / x1)));
} else if (x1 <= 30000.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) + (((x1 * x1) + 1.0) * ((x1 * x1) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), -6.0) / x1) - 4.0) / x1))))))) + (3.0 * 3.0));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -5600.0) tmp = Float64(x1 + Float64((x1 ^ 4.0) * Float64(6.0 + Float64(-3.0 / x1)))); elseif (x1 <= 30000.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * Float64(x1 * Float64(x1 * 3.0))) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(x1 * x1) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), -6.0) / x1) - 4.0) / x1))))))) + Float64(3.0 * 3.0))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -5600.0], N[(x1 + N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(-3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 30000.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + -6.0), $MachinePrecision] / x1), $MachinePrecision] - 4.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5600:\\
\;\;\;\;x1 + {x1}^{4} \cdot \left(6 + \frac{-3}{x1}\right)\\
\mathbf{elif}\;x1 \leq 30000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), -6\right)}{x1} - 4}{x1}\right)\right)\right)\right)\right) + 3 \cdot 3\right)\\
\end{array}
\end{array}
if x1 < -5600Initial program 36.6%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
metadata-eval93.1
Simplified93.1%
if -5600 < x1 < 3e4Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
if 3e4 < x1 Initial program 56.4%
Taylor expanded in x1 around inf
Simplified56.4%
Taylor expanded in x1 around -inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified52.5%
Taylor expanded in x1 around inf
Simplified95.8%
Final simplification96.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1550.0)
(* 6.0 (pow x1 4.0))
(if (<= x1 2300.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 (* x1 (* x1 3.0)))
(*
(+ (* x1 x1) 1.0)
(*
(* x1 x1)
(+ 6.0 (/ (- (/ (fma 4.0 (fma x2 2.0 -3.0) -6.0) x1) 4.0) x1)))))))
(* 3.0 3.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1550.0) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 2300.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) + (((x1 * x1) + 1.0) * ((x1 * x1) * (6.0 + (((fma(4.0, fma(x2, 2.0, -3.0), -6.0) / x1) - 4.0) / x1))))))) + (3.0 * 3.0));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -1550.0) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 2300.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * Float64(x1 * Float64(x1 * 3.0))) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(x1 * x1) * Float64(6.0 + Float64(Float64(Float64(fma(4.0, fma(x2, 2.0, -3.0), -6.0) / x1) - 4.0) / x1))))))) + Float64(3.0 * 3.0))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -1550.0], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2300.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(4.0 * N[(x2 * 2.0 + -3.0), $MachinePrecision] + -6.0), $MachinePrecision] / x1), $MachinePrecision] - 4.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1550:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 2300:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + \frac{\frac{\mathsf{fma}\left(4, \mathsf{fma}\left(x2, 2, -3\right), -6\right)}{x1} - 4}{x1}\right)\right)\right)\right)\right) + 3 \cdot 3\right)\\
\end{array}
\end{array}
if x1 < -1550Initial program 36.6%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6492.0
Simplified92.0%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6492.0
Simplified92.0%
if -1550 < x1 < 2300Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
if 2300 < x1 Initial program 56.4%
Taylor expanded in x1 around inf
Simplified56.4%
Taylor expanded in x1 around -inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
Simplified52.5%
Taylor expanded in x1 around inf
Simplified95.8%
Final simplification96.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -54000.0)
(* 6.0 (pow x1 4.0))
(if (<= x1 3200.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(-
(* 3.0 (* x1 (* x1 3.0)))
(* (* x1 (* x1 (+ 6.0 (/ -4.0 x1)))) (- -1.0 (* x1 x1)))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -54000.0) {
tmp = 6.0 * pow(x1, 4.0);
} else if (x1 <= 3200.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * (x1 * (x1 * 3.0))) - ((x1 * (x1 * (6.0 + (-4.0 / x1)))) * (-1.0 - (x1 * x1)))))));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (x1 <= -54000.0) tmp = Float64(6.0 * (x1 ^ 4.0)); elseif (x1 <= 3200.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * Float64(x1 * Float64(x1 * 3.0))) - Float64(Float64(x1 * Float64(x1 * Float64(6.0 + Float64(-4.0 / x1)))) * Float64(-1.0 - Float64(x1 * x1)))))))); end return tmp end
code[x1_, x2_] := If[LessEqual[x1, -54000.0], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3200.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * N[(x1 * N[(6.0 + N[(-4.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -54000:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 3200:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) - \left(x1 \cdot \left(x1 \cdot \left(6 + \frac{-4}{x1}\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -54000Initial program 36.6%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6492.0
Simplified92.0%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6492.0
Simplified92.0%
if -54000 < x1 < 3200Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
if 3200 < x1 Initial program 56.4%
Taylor expanded in x1 around inf
Simplified56.4%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6456.4
Simplified56.4%
Taylor expanded in x1 around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6490.1
Simplified90.1%
Final simplification95.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1))))
(if (<= x1 -72000.0)
(fma t_0 (* x1 6.0) x1)
(if (<= x1 25000.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
t_0
(-
(* 3.0 (* x1 (* x1 3.0)))
(* (* x1 (* x1 (+ 6.0 (/ -4.0 x1)))) (- -1.0 (* x1 x1))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double tmp;
if (x1 <= -72000.0) {
tmp = fma(t_0, (x1 * 6.0), x1);
} else if (x1 <= 25000.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_0 + ((3.0 * (x1 * (x1 * 3.0))) - ((x1 * (x1 * (6.0 + (-4.0 / x1)))) * (-1.0 - (x1 * x1)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -72000.0) tmp = fma(t_0, Float64(x1 * 6.0), x1); elseif (x1 <= 25000.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * Float64(x1 * Float64(x1 * 3.0))) - Float64(Float64(x1 * Float64(x1 * Float64(6.0 + Float64(-4.0 / x1)))) * Float64(-1.0 - Float64(x1 * x1)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -72000.0], N[(t$95$0 * N[(x1 * 6.0), $MachinePrecision] + x1), $MachinePrecision], If[LessEqual[x1, 25000.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(3.0 * N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * N[(x1 * N[(6.0 + N[(-4.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -72000:\\
\;\;\;\;\mathsf{fma}\left(t\_0, x1 \cdot 6, x1\right)\\
\mathbf{elif}\;x1 \leq 25000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(t\_0 + \left(3 \cdot \left(x1 \cdot \left(x1 \cdot 3\right)\right) - \left(x1 \cdot \left(x1 \cdot \left(6 + \frac{-4}{x1}\right)\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -72000Initial program 36.6%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6492.0
Simplified92.0%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6491.9
Applied egg-rr91.9%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6491.9
Applied egg-rr91.9%
if -72000 < x1 < 25000Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
if 25000 < x1 Initial program 56.4%
Taylor expanded in x1 around inf
Simplified56.4%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6456.4
Simplified56.4%
Taylor expanded in x1 around inf
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6490.1
Simplified90.1%
Final simplification95.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 (* x1 x1)) (* x1 6.0) x1)))
(if (<= x1 -70000.0)
t_0
(if (<= x1 340000.0)
(+
x1
(fma
x2
(fma x1 (* x2 8.0) (fma x1 (fma x1 12.0 -12.0) -6.0))
(* x1 (fma x1 9.0 -2.0))))
t_0))))
double code(double x1, double x2) {
double t_0 = fma((x1 * (x1 * x1)), (x1 * 6.0), x1);
double tmp;
if (x1 <= -70000.0) {
tmp = t_0;
} else if (x1 <= 340000.0) {
tmp = x1 + fma(x2, fma(x1, (x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), (x1 * fma(x1, 9.0, -2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * Float64(x1 * x1)), Float64(x1 * 6.0), x1) tmp = 0.0 if (x1 <= -70000.0) tmp = t_0; elseif (x1 <= 340000.0) tmp = Float64(x1 + fma(x2, fma(x1, Float64(x2 * 8.0), fma(x1, fma(x1, 12.0, -12.0), -6.0)), Float64(x1 * fma(x1, 9.0, -2.0)))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * 6.0), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -70000.0], t$95$0, If[LessEqual[x1, 340000.0], N[(x1 + N[(x2 * N[(x1 * N[(x2 * 8.0), $MachinePrecision] + N[(x1 * N[(x1 * 12.0 + -12.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot \left(x1 \cdot x1\right), x1 \cdot 6, x1\right)\\
\mathbf{if}\;x1 \leq -70000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 340000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x2, \mathsf{fma}\left(x1, x2 \cdot 8, \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 12, -12\right), -6\right)\right), x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -7e4 or 3.4e5 < x1 Initial program 46.8%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6490.7
Simplified90.7%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.6
Applied egg-rr90.6%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7
Applied egg-rr90.7%
if -7e4 < x1 < 3.4e5Initial program 99.4%
Taylor expanded in x1 around 0
Simplified86.2%
Taylor expanded in x2 around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6498.5
Simplified98.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 (* x1 x1)) (* x1 6.0) x1)))
(if (<= x1 -5.5)
t_0
(if (<= x1 7.5e-77)
(+ x1 (fma x1 (fma x1 9.0 -2.0) (* x2 -6.0)))
(if (<= x1 1750000000.0)
(+ x1 (fma x1 (* x2 (* x2 8.0)) (* x2 -6.0)))
t_0)))))
double code(double x1, double x2) {
double t_0 = fma((x1 * (x1 * x1)), (x1 * 6.0), x1);
double tmp;
if (x1 <= -5.5) {
tmp = t_0;
} else if (x1 <= 7.5e-77) {
tmp = x1 + fma(x1, fma(x1, 9.0, -2.0), (x2 * -6.0));
} else if (x1 <= 1750000000.0) {
tmp = x1 + fma(x1, (x2 * (x2 * 8.0)), (x2 * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * Float64(x1 * x1)), Float64(x1 * 6.0), x1) tmp = 0.0 if (x1 <= -5.5) tmp = t_0; elseif (x1 <= 7.5e-77) tmp = Float64(x1 + fma(x1, fma(x1, 9.0, -2.0), Float64(x2 * -6.0))); elseif (x1 <= 1750000000.0) tmp = Float64(x1 + fma(x1, Float64(x2 * Float64(x2 * 8.0)), Float64(x2 * -6.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * 6.0), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -5.5], t$95$0, If[LessEqual[x1, 7.5e-77], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1750000000.0], N[(x1 + N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot \left(x1 \cdot x1\right), x1 \cdot 6, x1\right)\\
\mathbf{if}\;x1 \leq -5.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{-77}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 9, -2\right), x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 1750000000:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, x2 \cdot \left(x2 \cdot 8\right), x2 \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -5.5 or 1.75e9 < x1 Initial program 47.2%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6490.0
Simplified90.0%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9
Applied egg-rr89.9%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9
Applied egg-rr89.9%
if -5.5 < x1 < 7.5000000000000006e-77Initial program 99.4%
Taylor expanded in x1 around 0
Simplified85.6%
Taylor expanded in x2 around 0
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6477.7
Simplified77.7%
if 7.5000000000000006e-77 < x1 < 1.75e9Initial program 99.6%
Taylor expanded in x1 around 0
Simplified89.6%
Taylor expanded in x2 around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.2
Simplified73.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 (* x1 x1)) (* x1 6.0) x1)))
(if (<= x1 -6.2)
t_0
(if (<= x1 2.42e-76)
(+ x1 (fma x1 (fma x1 9.0 -2.0) (* x2 -6.0)))
(if (<= x1 13500000.0) (* x1 (* x2 (* x2 8.0))) t_0)))))
double code(double x1, double x2) {
double t_0 = fma((x1 * (x1 * x1)), (x1 * 6.0), x1);
double tmp;
if (x1 <= -6.2) {
tmp = t_0;
} else if (x1 <= 2.42e-76) {
tmp = x1 + fma(x1, fma(x1, 9.0, -2.0), (x2 * -6.0));
} else if (x1 <= 13500000.0) {
tmp = x1 * (x2 * (x2 * 8.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * Float64(x1 * x1)), Float64(x1 * 6.0), x1) tmp = 0.0 if (x1 <= -6.2) tmp = t_0; elseif (x1 <= 2.42e-76) tmp = Float64(x1 + fma(x1, fma(x1, 9.0, -2.0), Float64(x2 * -6.0))); elseif (x1 <= 13500000.0) tmp = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * 6.0), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -6.2], t$95$0, If[LessEqual[x1, 2.42e-76], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 13500000.0], N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot \left(x1 \cdot x1\right), x1 \cdot 6, x1\right)\\
\mathbf{if}\;x1 \leq -6.2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.42 \cdot 10^{-76}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 9, -2\right), x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 13500000:\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -6.20000000000000018 or 1.35e7 < x1 Initial program 47.2%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6490.0
Simplified90.0%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9
Applied egg-rr89.9%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9
Applied egg-rr89.9%
if -6.20000000000000018 < x1 < 2.42e-76Initial program 99.4%
Taylor expanded in x1 around 0
Simplified85.6%
Taylor expanded in x2 around 0
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6477.7
Simplified77.7%
if 2.42e-76 < x1 < 1.35e7Initial program 99.6%
Taylor expanded in x1 around inf
Simplified99.6%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6
Simplified99.6%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6489.4
Simplified89.4%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6464.9
Simplified64.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 x1) (* (* x1 x1) 6.0) x1)))
(if (<= x1 -5.5)
t_0
(if (<= x1 2.42e-76)
(+ x1 (fma x1 (fma x1 9.0 -2.0) (* x2 -6.0)))
(if (<= x1 200000.0) (* x1 (* x2 (* x2 8.0))) t_0)))))
double code(double x1, double x2) {
double t_0 = fma((x1 * x1), ((x1 * x1) * 6.0), x1);
double tmp;
if (x1 <= -5.5) {
tmp = t_0;
} else if (x1 <= 2.42e-76) {
tmp = x1 + fma(x1, fma(x1, 9.0, -2.0), (x2 * -6.0));
} else if (x1 <= 200000.0) {
tmp = x1 * (x2 * (x2 * 8.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * x1), Float64(Float64(x1 * x1) * 6.0), x1) tmp = 0.0 if (x1 <= -5.5) tmp = t_0; elseif (x1 <= 2.42e-76) tmp = Float64(x1 + fma(x1, fma(x1, 9.0, -2.0), Float64(x2 * -6.0))); elseif (x1 <= 200000.0) tmp = Float64(x1 * Float64(x2 * Float64(x2 * 8.0))); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -5.5], t$95$0, If[LessEqual[x1, 2.42e-76], N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 200000.0], N[(x1 * N[(x2 * N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot x1, \left(x1 \cdot x1\right) \cdot 6, x1\right)\\
\mathbf{if}\;x1 \leq -5.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.42 \cdot 10^{-76}:\\
\;\;\;\;x1 + \mathsf{fma}\left(x1, \mathsf{fma}\left(x1, 9, -2\right), x2 \cdot -6\right)\\
\mathbf{elif}\;x1 \leq 200000:\\
\;\;\;\;x1 \cdot \left(x2 \cdot \left(x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -5.5 or 2e5 < x1 Initial program 47.2%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6490.0
Simplified90.0%
+-commutativeN/A
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9
Applied egg-rr89.9%
if -5.5 < x1 < 2.42e-76Initial program 99.4%
Taylor expanded in x1 around 0
Simplified85.6%
Taylor expanded in x2 around 0
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6477.7
Simplified77.7%
if 2.42e-76 < x1 < 2e5Initial program 99.6%
Taylor expanded in x1 around inf
Simplified99.6%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6
Simplified99.6%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6489.4
Simplified89.4%
Taylor expanded in x2 around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6464.9
Simplified64.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma (* x1 (* x1 x1)) (* x1 6.0) x1)))
(if (<= x1 -72000.0)
t_0
(if (<= x1 450000.0)
(fma x2 (fma x1 -12.0 (fma x1 (* x2 8.0) -6.0)) (- x1))
t_0))))
double code(double x1, double x2) {
double t_0 = fma((x1 * (x1 * x1)), (x1 * 6.0), x1);
double tmp;
if (x1 <= -72000.0) {
tmp = t_0;
} else if (x1 <= 450000.0) {
tmp = fma(x2, fma(x1, -12.0, fma(x1, (x2 * 8.0), -6.0)), -x1);
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = fma(Float64(x1 * Float64(x1 * x1)), Float64(x1 * 6.0), x1) tmp = 0.0 if (x1 <= -72000.0) tmp = t_0; elseif (x1 <= 450000.0) tmp = fma(x2, fma(x1, -12.0, fma(x1, Float64(x2 * 8.0), -6.0)), Float64(-x1)); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] * N[(x1 * 6.0), $MachinePrecision] + x1), $MachinePrecision]}, If[LessEqual[x1, -72000.0], t$95$0, If[LessEqual[x1, 450000.0], N[(x2 * N[(x1 * -12.0 + N[(x1 * N[(x2 * 8.0), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + (-x1)), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1 \cdot \left(x1 \cdot x1\right), x1 \cdot 6, x1\right)\\
\mathbf{if}\;x1 \leq -72000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 450000:\\
\;\;\;\;\mathsf{fma}\left(x2, \mathsf{fma}\left(x1, -12, \mathsf{fma}\left(x1, x2 \cdot 8, -6\right)\right), -x1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -72000 or 4.5e5 < x1 Initial program 46.8%
Taylor expanded in x1 around inf
*-lowering-*.f64N/A
pow-lowering-pow.f6490.7
Simplified90.7%
metadata-evalN/A
pow-prod-upN/A
pow2N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.6
Applied egg-rr90.6%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.7
Applied egg-rr90.7%
if -72000 < x1 < 4.5e5Initial program 99.4%
Taylor expanded in x1 around inf
Simplified98.2%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4
Simplified99.4%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6485.2
Simplified85.2%
Taylor expanded in x2 around 0
associate-+r+N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6497.9
Simplified97.9%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) -2e-240) (* x2 -6.0) (if (<= (* 2.0 x2) 1e-165) (- x1) (fma x2 -6.0 x1))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -2e-240) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 1e-165) {
tmp = -x1;
} else {
tmp = fma(x2, -6.0, x1);
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= -2e-240) tmp = Float64(x2 * -6.0); elseif (Float64(2.0 * x2) <= 1e-165) tmp = Float64(-x1); else tmp = fma(x2, -6.0, x1); end return tmp end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], -2e-240], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e-165], (-x1), N[(x2 * -6.0 + x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -2 \cdot 10^{-240}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;2 \cdot x2 \leq 10^{-165}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x2, -6, x1\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -1.9999999999999999e-240Initial program 77.4%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6435.1
Simplified35.1%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6435.3
Simplified35.3%
if -1.9999999999999999e-240 < (*.f64 #s(literal 2 binary64) x2) < 1e-165Initial program 82.1%
Taylor expanded in x1 around inf
Simplified79.7%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6482.1
Simplified82.1%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6447.7
Simplified47.7%
Taylor expanded in x2 around 0
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
neg-lowering-neg.f6446.2
Simplified46.2%
if 1e-165 < (*.f64 #s(literal 2 binary64) x2) Initial program 69.7%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6431.8
Simplified31.8%
+-commutativeN/A
accelerator-lowering-fma.f6431.9
Applied egg-rr31.9%
(FPCore (x1 x2) :precision binary64 (if (<= (* 2.0 x2) -2e-240) (* x2 -6.0) (if (<= (* 2.0 x2) 1e-156) (- x1) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -2e-240) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 1e-156) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((2.0d0 * x2) <= (-2d-240)) then
tmp = x2 * (-6.0d0)
else if ((2.0d0 * x2) <= 1d-156) then
tmp = -x1
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((2.0 * x2) <= -2e-240) {
tmp = x2 * -6.0;
} else if ((2.0 * x2) <= 1e-156) {
tmp = -x1;
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (2.0 * x2) <= -2e-240: tmp = x2 * -6.0 elif (2.0 * x2) <= 1e-156: tmp = -x1 else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if (Float64(2.0 * x2) <= -2e-240) tmp = Float64(x2 * -6.0); elseif (Float64(2.0 * x2) <= 1e-156) tmp = Float64(-x1); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((2.0 * x2) <= -2e-240) tmp = x2 * -6.0; elseif ((2.0 * x2) <= 1e-156) tmp = -x1; else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[N[(2.0 * x2), $MachinePrecision], -2e-240], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e-156], (-x1), N[(x2 * -6.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -2 \cdot 10^{-240}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;2 \cdot x2 \leq 10^{-156}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) x2) < -1.9999999999999999e-240 or 1.00000000000000004e-156 < (*.f64 #s(literal 2 binary64) x2) Initial program 74.2%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6433.9
Simplified33.9%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6433.6
Simplified33.6%
if -1.9999999999999999e-240 < (*.f64 #s(literal 2 binary64) x2) < 1.00000000000000004e-156Initial program 79.5%
Taylor expanded in x1 around inf
Simplified77.2%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6479.5
Simplified79.5%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6445.2
Simplified45.2%
Taylor expanded in x2 around 0
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
neg-lowering-neg.f6443.8
Simplified43.8%
(FPCore (x1 x2) :precision binary64 (let* ((t_0 (+ x1 (* x1 (fma x1 9.0 -2.0))))) (if (<= x1 -7.4e-90) t_0 (if (<= x1 3.7e-92) (* x2 -6.0) t_0))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * fma(x1, 9.0, -2.0));
double tmp;
if (x1 <= -7.4e-90) {
tmp = t_0;
} else if (x1 <= 3.7e-92) {
tmp = x2 * -6.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * fma(x1, 9.0, -2.0))) tmp = 0.0 if (x1 <= -7.4e-90) tmp = t_0; elseif (x1 <= 3.7e-92) tmp = Float64(x2 * -6.0); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * 9.0 + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.4e-90], t$95$0, If[LessEqual[x1, 3.7e-92], N[(x2 * -6.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \mathsf{fma}\left(x1, 9, -2\right)\\
\mathbf{if}\;x1 \leq -7.4 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{-92}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -7.40000000000000035e-90 or 3.69999999999999977e-92 < x1 Initial program 60.4%
Taylor expanded in x1 around 0
Simplified57.2%
Taylor expanded in x2 around 0
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6448.1
Simplified48.1%
if -7.40000000000000035e-90 < x1 < 3.69999999999999977e-92Initial program 99.5%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6464.8
Simplified64.8%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6465.2
Simplified65.2%
(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.4%
Taylor expanded in x1 around inf
Simplified74.7%
Taylor expanded in x1 around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
Taylor expanded in x1 around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6455.7
Simplified55.7%
Taylor expanded in x2 around 0
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
mul-1-negN/A
neg-lowering-neg.f6413.9
Simplified13.9%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 75.4%
Taylor expanded in x1 around 0
*-commutativeN/A
*-lowering-*.f6427.1
Simplified27.1%
Taylor expanded in x1 around inf
Simplified3.1%
herbie shell --seed 2024199
(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))))))