
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma a (* b -0.25) (fma 0.0625 (* t z) (fma x y c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(a, (b * -0.25), fma(0.0625, (t * z), fma(x, y, c)));
}
function code(x, y, z, t, a, b, c) return fma(a, Float64(b * -0.25), fma(0.0625, Float64(t * z), fma(x, y, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\right)
\end{array}
Initial program 98.8%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6499.2
Simplified99.2%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (fma x y (* 0.0625 (* t z)))) (t_2 (+ (* x y) (/ (* t z) 16.0)))) (if (<= t_2 -2e+112) t_1 (if (<= t_2 4e+34) (fma (* b -0.25) a c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(x, y, (0.0625 * (t * z)));
double t_2 = (x * y) + ((t * z) / 16.0);
double tmp;
if (t_2 <= -2e+112) {
tmp = t_1;
} else if (t_2 <= 4e+34) {
tmp = fma((b * -0.25), a, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(x, y, Float64(0.0625 * Float64(t * z))) t_2 = Float64(Float64(x * y) + Float64(Float64(t * z) / 16.0)) tmp = 0.0 if (t_2 <= -2e+112) tmp = t_1; elseif (t_2 <= 4e+34) tmp = fma(Float64(b * -0.25), a, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(x * y + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+112], t$95$1, If[LessEqual[t$95$2, 4e+34], N[(N[(b * -0.25), $MachinePrecision] * a + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, y, 0.0625 \cdot \left(t \cdot z\right)\right)\\
t_2 := x \cdot y + \frac{t \cdot z}{16}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -1.9999999999999999e112 or 3.99999999999999978e34 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 98.0%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6498.7
Simplified98.7%
Taylor expanded in c around 0
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.1
Simplified92.1%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.2
Simplified80.2%
if -1.9999999999999999e112 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 3.99999999999999978e34Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6487.0
Simplified87.0%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6487.0
Applied egg-rr87.0%
Final simplification82.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* t z) -2e+129)
(fma (* 0.0625 z) t c)
(if (<= (* t z) 1e-238)
(fma (* b -0.25) a c)
(if (<= (* t z) 5e+109) (fma y x c) (+ c (* 0.0625 (* t z)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t * z) <= -2e+129) {
tmp = fma((0.0625 * z), t, c);
} else if ((t * z) <= 1e-238) {
tmp = fma((b * -0.25), a, c);
} else if ((t * z) <= 5e+109) {
tmp = fma(y, x, c);
} else {
tmp = c + (0.0625 * (t * z));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(t * z) <= -2e+129) tmp = fma(Float64(0.0625 * z), t, c); elseif (Float64(t * z) <= 1e-238) tmp = fma(Float64(b * -0.25), a, c); elseif (Float64(t * z) <= 5e+109) tmp = fma(y, x, c); else tmp = Float64(c + Float64(0.0625 * Float64(t * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(t * z), $MachinePrecision], -2e+129], N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1e-238], N[(N[(b * -0.25), $MachinePrecision] * a + c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 5e+109], N[(y * x + c), $MachinePrecision], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
\mathbf{elif}\;t \cdot z \leq 10^{-238}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, c\right)\\
\mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -2e129Initial program 97.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6479.1
Simplified79.1%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6479.1
Applied egg-rr79.1%
if -2e129 < (*.f64 z t) < 9.9999999999999999e-239Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.6
Simplified66.6%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6466.6
Applied egg-rr66.6%
if 9.9999999999999999e-239 < (*.f64 z t) < 5.0000000000000001e109Initial program 99.9%
Taylor expanded in x around inf
*-lowering-*.f6466.4
Simplified66.4%
*-commutativeN/A
accelerator-lowering-fma.f6466.4
Applied egg-rr66.4%
if 5.0000000000000001e109 < (*.f64 z t) Initial program 96.1%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6476.1
Simplified76.1%
Final simplification70.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma (* 0.0625 z) t c)))
(if (<= (* t z) -2e+129)
t_1
(if (<= (* t z) 1e-238)
(fma (* b -0.25) a c)
(if (<= (* t z) 5e+109) (fma y x c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((0.0625 * z), t, c);
double tmp;
if ((t * z) <= -2e+129) {
tmp = t_1;
} else if ((t * z) <= 1e-238) {
tmp = fma((b * -0.25), a, c);
} else if ((t * z) <= 5e+109) {
tmp = fma(y, x, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(0.0625 * z), t, c) tmp = 0.0 if (Float64(t * z) <= -2e+129) tmp = t_1; elseif (Float64(t * z) <= 1e-238) tmp = fma(Float64(b * -0.25), a, c); elseif (Float64(t * z) <= 5e+109) tmp = fma(y, x, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -2e+129], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 1e-238], N[(N[(b * -0.25), $MachinePrecision] * a + c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 5e+109], N[(y * x + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq 10^{-238}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, c\right)\\
\mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2e129 or 5.0000000000000001e109 < (*.f64 z t) Initial program 96.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6477.3
Simplified77.3%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6477.3
Applied egg-rr77.3%
if -2e129 < (*.f64 z t) < 9.9999999999999999e-239Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.6
Simplified66.6%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6466.6
Applied egg-rr66.6%
if 9.9999999999999999e-239 < (*.f64 z t) < 5.0000000000000001e109Initial program 99.9%
Taylor expanded in x around inf
*-lowering-*.f6466.4
Simplified66.4%
*-commutativeN/A
accelerator-lowering-fma.f6466.4
Applied egg-rr66.4%
Final simplification70.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+117)
(fma a (* b -0.25) (fma 0.0625 (* t z) (* x y)))
(if (<= (* a b) 1000000000.0)
(fma 0.0625 (* t z) (fma x y c))
(fma 0.0625 (* t z) (fma a (* b -0.25) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+117) {
tmp = fma(a, (b * -0.25), fma(0.0625, (t * z), (x * y)));
} else if ((a * b) <= 1000000000.0) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = fma(0.0625, (t * z), fma(a, (b * -0.25), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+117) tmp = fma(a, Float64(b * -0.25), fma(0.0625, Float64(t * z), Float64(x * y))); elseif (Float64(a * b) <= 1000000000.0) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = fma(0.0625, Float64(t * z), fma(a, Float64(b * -0.25), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+117], N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1000000000.0], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, t \cdot z, x \cdot y\right)\right)\\
\mathbf{elif}\;a \cdot b \leq 1000000000:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e117Initial program 95.7%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.8
Simplified97.8%
Taylor expanded in c around 0
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.7
Simplified95.7%
if -2.0000000000000001e117 < (*.f64 a b) < 1e9Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.3
Simplified97.3%
if 1e9 < (*.f64 a b) Initial program 98.4%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6492.6
Simplified92.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+117)
(fma 0.0625 (* t z) (fma a (* b -0.25) (* x y)))
(if (<= (* a b) 1000000000.0)
(fma 0.0625 (* t z) (fma x y c))
(fma 0.0625 (* t z) (fma a (* b -0.25) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+117) {
tmp = fma(0.0625, (t * z), fma(a, (b * -0.25), (x * y)));
} else if ((a * b) <= 1000000000.0) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = fma(0.0625, (t * z), fma(a, (b * -0.25), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+117) tmp = fma(0.0625, Float64(t * z), fma(a, Float64(b * -0.25), Float64(x * y))); elseif (Float64(a * b) <= 1000000000.0) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = fma(0.0625, Float64(t * z), fma(a, Float64(b * -0.25), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+117], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1000000000.0], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\right)\\
\mathbf{elif}\;a \cdot b \leq 1000000000:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e117Initial program 95.7%
Taylor expanded in c around 0
associate--l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6493.5
Simplified93.5%
if -2.0000000000000001e117 < (*.f64 a b) < 1e9Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.3
Simplified97.3%
if 1e9 < (*.f64 a b) Initial program 98.4%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6492.6
Simplified92.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+172)
(fma a (* b -0.25) (* 0.0625 (* t z)))
(if (<= (* a b) 1000000000.0)
(fma 0.0625 (* t z) (fma x y c))
(fma 0.0625 (* t z) (fma a (* b -0.25) c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+172) {
tmp = fma(a, (b * -0.25), (0.0625 * (t * z)));
} else if ((a * b) <= 1000000000.0) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = fma(0.0625, (t * z), fma(a, (b * -0.25), c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+172) tmp = fma(a, Float64(b * -0.25), Float64(0.0625 * Float64(t * z))); elseif (Float64(a * b) <= 1000000000.0) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = fma(0.0625, Float64(t * z), fma(a, Float64(b * -0.25), c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+172], N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1000000000.0], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;a \cdot b \leq 1000000000:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e172Initial program 94.7%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.4
Simplified97.4%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-lowering-*.f6490.9
Simplified90.9%
if -2.0000000000000002e172 < (*.f64 a b) < 1e9Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6496.2
Simplified96.2%
if 1e9 < (*.f64 a b) Initial program 98.4%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
+-commutativeN/A
metadata-evalN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6492.6
Simplified92.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma a (* b -0.25) (* 0.0625 (* t z)))))
(if (<= (* a b) -2e+172)
t_1
(if (<= (* a b) 5e+61) (fma 0.0625 (* t z) (fma x y c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(a, (b * -0.25), (0.0625 * (t * z)));
double tmp;
if ((a * b) <= -2e+172) {
tmp = t_1;
} else if ((a * b) <= 5e+61) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(b * -0.25), Float64(0.0625 * Float64(t * z))) tmp = 0.0 if (Float64(a * b) <= -2e+172) tmp = t_1; elseif (Float64(a * b) <= 5e+61) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+172], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e+61], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b \cdot -0.25, 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e172 or 5.00000000000000018e61 < (*.f64 a b) Initial program 96.9%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.9
Simplified97.9%
Taylor expanded in t around inf
*-lowering-*.f64N/A
*-lowering-*.f6488.4
Simplified88.4%
if -2.0000000000000002e172 < (*.f64 a b) < 5.00000000000000018e61Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6495.5
Simplified95.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma -0.25 (* a b) (* 0.0625 (* t z)))))
(if (<= (* a b) -2e+172)
t_1
(if (<= (* a b) 5e+61) (fma 0.0625 (* t z) (fma x y c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(-0.25, (a * b), (0.0625 * (t * z)));
double tmp;
if ((a * b) <= -2e+172) {
tmp = t_1;
} else if ((a * b) <= 5e+61) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(-0.25, Float64(a * b), Float64(0.0625 * Float64(t * z))) tmp = 0.0 if (Float64(a * b) <= -2e+172) tmp = t_1; elseif (Float64(a * b) <= 5e+61) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-0.25 * N[(a * b), $MachinePrecision] + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+172], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e+61], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.25, a \cdot b, 0.0625 \cdot \left(t \cdot z\right)\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e172 or 5.00000000000000018e61 < (*.f64 a b) Initial program 96.9%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.9
Simplified97.9%
Taylor expanded in c around 0
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.2
Simplified92.2%
Taylor expanded in x around 0
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.3
Simplified86.3%
if -2.0000000000000002e172 < (*.f64 a b) < 5.00000000000000018e61Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6495.5
Simplified95.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+172)
(fma a (* b -0.25) (* x y))
(if (<= (* a b) 5e+164)
(fma 0.0625 (* t z) (fma x y c))
(fma a (* b -0.25) (fma x y c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+172) {
tmp = fma(a, (b * -0.25), (x * y));
} else if ((a * b) <= 5e+164) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = fma(a, (b * -0.25), fma(x, y, c));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+172) tmp = fma(a, Float64(b * -0.25), Float64(x * y)); elseif (Float64(a * b) <= 5e+164) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = fma(a, Float64(b * -0.25), fma(x, y, c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+172], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+164], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e172Initial program 94.7%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.4
Simplified97.4%
Taylor expanded in x around inf
*-lowering-*.f6483.5
Simplified83.5%
if -2.0000000000000002e172 < (*.f64 a b) < 4.9999999999999995e164Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6493.8
Simplified93.8%
if 4.9999999999999995e164 < (*.f64 a b) Initial program 97.6%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6487.9
Simplified87.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+172)
(fma a (* b -0.25) (* x y))
(if (<= (* a b) 5e+164)
(fma 0.0625 (* t z) (fma x y c))
(fma (* b -0.25) a c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+172) {
tmp = fma(a, (b * -0.25), (x * y));
} else if ((a * b) <= 5e+164) {
tmp = fma(0.0625, (t * z), fma(x, y, c));
} else {
tmp = fma((b * -0.25), a, c);
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+172) tmp = fma(a, Float64(b * -0.25), Float64(x * y)); elseif (Float64(a * b) <= 5e+164) tmp = fma(0.0625, Float64(t * z), fma(x, y, c)); else tmp = fma(Float64(b * -0.25), a, c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+172], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+164], N[(0.0625 * N[(t * z), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(N[(b * -0.25), $MachinePrecision] * a + c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, c\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000002e172Initial program 94.7%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6497.4
Simplified97.4%
Taylor expanded in x around inf
*-lowering-*.f6483.5
Simplified83.5%
if -2.0000000000000002e172 < (*.f64 a b) < 4.9999999999999995e164Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6493.8
Simplified93.8%
if 4.9999999999999995e164 < (*.f64 a b) Initial program 97.6%
Taylor expanded in a around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6485.7
Simplified85.7%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6485.7
Applied egg-rr85.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* t z) -2e+217)
(fma (* 0.0625 z) t c)
(if (<= (* t z) 1e+123)
(fma a (* b -0.25) (* x y))
(+ c (* 0.0625 (* t z))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t * z) <= -2e+217) {
tmp = fma((0.0625 * z), t, c);
} else if ((t * z) <= 1e+123) {
tmp = fma(a, (b * -0.25), (x * y));
} else {
tmp = c + (0.0625 * (t * z));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(t * z) <= -2e+217) tmp = fma(Float64(0.0625 * z), t, c); elseif (Float64(t * z) <= 1e+123) tmp = fma(a, Float64(b * -0.25), Float64(x * y)); else tmp = Float64(c + Float64(0.0625 * Float64(t * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(t * z), $MachinePrecision], -2e+217], N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1e+123], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot z \leq -2 \cdot 10^{+217}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
\mathbf{elif}\;t \cdot z \leq 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -1.99999999999999992e217Initial program 96.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6492.9
Simplified92.9%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6492.9
Applied egg-rr92.9%
if -1.99999999999999992e217 < (*.f64 z t) < 9.99999999999999978e122Initial program 100.0%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64100.0
Simplified100.0%
Taylor expanded in x around inf
*-lowering-*.f6465.6
Simplified65.6%
if 9.99999999999999978e122 < (*.f64 z t) Initial program 95.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6479.3
Simplified79.3%
Final simplification70.9%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (fma (* 0.0625 z) t c))) (if (<= (* t z) -5e+113) t_1 (if (<= (* t z) 5e+109) (fma y x c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((0.0625 * z), t, c);
double tmp;
if ((t * z) <= -5e+113) {
tmp = t_1;
} else if ((t * z) <= 5e+109) {
tmp = fma(y, x, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(Float64(0.0625 * z), t, c) tmp = 0.0 if (Float64(t * z) <= -5e+113) tmp = t_1; elseif (Float64(t * z) <= 5e+109) tmp = fma(y, x, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(0.0625 * z), $MachinePrecision] * t + c), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -5e+113], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+109], N[(y * x + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(0.0625 \cdot z, t, c\right)\\
\mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -5e113 or 5.0000000000000001e109 < (*.f64 z t) Initial program 96.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6476.2
Simplified76.2%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6476.2
Applied egg-rr76.2%
if -5e113 < (*.f64 z t) < 5.0000000000000001e109Initial program 100.0%
Taylor expanded in x around inf
*-lowering-*.f6461.7
Simplified61.7%
*-commutativeN/A
accelerator-lowering-fma.f6461.8
Applied egg-rr61.8%
Final simplification67.0%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* 0.0625 (* t z)))) (if (<= (* t z) -5e+221) t_1 (if (<= (* t z) 5e+75) (fma y x c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (t * z);
double tmp;
if ((t * z) <= -5e+221) {
tmp = t_1;
} else if ((t * z) <= 5e+75) {
tmp = fma(y, x, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(t * z)) tmp = 0.0 if (Float64(t * z) <= -5e+221) tmp = t_1; elseif (Float64(t * z) <= 5e+75) tmp = fma(y, x, c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -5e+221], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+75], N[(y * x + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t \cdot z \leq -5 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -5.0000000000000002e221 or 5.0000000000000002e75 < (*.f64 z t) Initial program 96.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f6477.7
Simplified77.7%
if -5.0000000000000002e221 < (*.f64 z t) < 5.0000000000000002e75Initial program 100.0%
Taylor expanded in x around inf
*-lowering-*.f6460.7
Simplified60.7%
*-commutativeN/A
accelerator-lowering-fma.f6460.8
Applied egg-rr60.8%
Final simplification66.1%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -2.6e+91) (* x y) (if (<= (* x y) 100000000.0) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2.6e+91) {
tmp = x * y;
} else if ((x * y) <= 100000000.0) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-2.6d+91)) then
tmp = x * y
else if ((x * y) <= 100000000.0d0) then
tmp = c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2.6e+91) {
tmp = x * y;
} else if ((x * y) <= 100000000.0) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -2.6e+91: tmp = x * y elif (x * y) <= 100000000.0: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2.6e+91) tmp = Float64(x * y); elseif (Float64(x * y) <= 100000000.0) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -2.6e+91) tmp = x * y; elseif ((x * y) <= 100000000.0) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.6e+91], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 100000000.0], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+91}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 100000000:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.6e91 or 1e8 < (*.f64 x y) Initial program 97.9%
Taylor expanded in x around inf
*-lowering-*.f6458.6
Simplified58.6%
if -2.6e91 < (*.f64 x y) < 1e8Initial program 99.4%
Taylor expanded in c around inf
Simplified27.7%
(FPCore (x y z t a b c) :precision binary64 (fma y x c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(y, x, c);
}
function code(x, y, z, t, a, b, c) return fma(y, x, c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x, c\right)
\end{array}
Initial program 98.8%
Taylor expanded in x around inf
*-lowering-*.f6445.0
Simplified45.0%
*-commutativeN/A
accelerator-lowering-fma.f6445.0
Applied egg-rr45.0%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 98.8%
Taylor expanded in c around inf
Simplified20.4%
herbie shell --seed 2024204
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))