
(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 16 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 (if (<= (- (+ (/ (* z t) 16.0) (* x y)) (/ (* b a) 4.0)) INFINITY) (fma (* z t) 0.0625 (fma x y (fma (* b a) -0.25 c))) (fma (* a -0.25) b (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((((z * t) / 16.0) + (x * y)) - ((b * a) / 4.0)) <= ((double) INFINITY)) {
tmp = fma((z * t), 0.0625, fma(x, y, fma((b * a), -0.25, c)));
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0)) <= Inf) tmp = fma(Float64(z * t), 0.0625, fma(x, y, fma(Float64(b * a), -0.25, c))); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t), $MachinePrecision] * 0.0625 + N[(x * y + N[(N[(b * a), $MachinePrecision] * -0.25 + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{b \cdot a}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z \cdot t, 0.0625, \mathsf{fma}\left(x, y, \mathsf{fma}\left(b \cdot a, -0.25, c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64100.0
Applied rewrites100.0%
lift--.f64N/A
lift--.f64N/A
associate--r-N/A
+-commutativeN/A
lift-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-fma.f64100.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64100.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6471.4
Applied rewrites71.4%
Taylor expanded in c around 0
Applied rewrites85.7%
Final simplification99.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma y x (* (* z t) 0.0625))) (t_2 (+ (/ (* z t) 16.0) (* x y))))
(if (<= t_2 -6e+243)
t_1
(if (<= t_2 -5e+44)
(fma (* z 0.0625) t c)
(if (<= t_2 5e+70) (fma -0.25 (* b a) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(y, x, ((z * t) * 0.0625));
double t_2 = ((z * t) / 16.0) + (x * y);
double tmp;
if (t_2 <= -6e+243) {
tmp = t_1;
} else if (t_2 <= -5e+44) {
tmp = fma((z * 0.0625), t, c);
} else if (t_2 <= 5e+70) {
tmp = fma(-0.25, (b * a), c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = fma(y, x, Float64(Float64(z * t) * 0.0625)) t_2 = Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) tmp = 0.0 if (t_2 <= -6e+243) tmp = t_1; elseif (t_2 <= -5e+44) tmp = fma(Float64(z * 0.0625), t, c); elseif (t_2 <= 5e+70) tmp = fma(-0.25, Float64(b * a), c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * x + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -6e+243], t$95$1, If[LessEqual[t$95$2, -5e+44], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[t$95$2, 5e+70], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \left(z \cdot t\right) \cdot 0.0625\right)\\
t_2 := \frac{z \cdot t}{16} + x \cdot y\\
\mathbf{if}\;t\_2 \leq -6 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{+44}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -5.99999999999999969e243 or 5.0000000000000002e70 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 93.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
Taylor expanded in c around 0
Applied rewrites79.3%
Applied rewrites80.3%
if -5.99999999999999969e243 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -4.9999999999999996e44Initial program 99.9%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6477.0
Applied rewrites77.0%
Taylor expanded in x around 0
Applied rewrites69.4%
Applied rewrites69.4%
if -4.9999999999999996e44 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 5.0000000000000002e70Initial program 100.0%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.6
Applied rewrites92.6%
Taylor expanded in x around 0
Applied rewrites83.2%
Final simplification79.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (fma -0.25 (* b a) c)))
(if (<= (* b a) -5e+155)
t_1
(if (<= (* b a) 2000.0)
(fma (* z 0.0625) t c)
(if (<= (* b a) 2e+134) (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, (b * a), c);
double tmp;
if ((b * a) <= -5e+155) {
tmp = t_1;
} else if ((b * a) <= 2000.0) {
tmp = fma((z * 0.0625), t, c);
} else if ((b * a) <= 2e+134) {
tmp = 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(b * a), c) tmp = 0.0 if (Float64(b * a) <= -5e+155) tmp = t_1; elseif (Float64(b * a) <= 2000.0) tmp = fma(Float64(z * 0.0625), t, c); elseif (Float64(b * a) <= 2e+134) tmp = 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[(b * a), $MachinePrecision] + c), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -5e+155], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2000.0], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2e+134], N[(x * y + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot a \leq 2000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e155 or 1.99999999999999984e134 < (*.f64 a b) Initial program 96.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6491.8
Applied rewrites91.8%
Taylor expanded in x around 0
Applied rewrites85.2%
if -4.9999999999999999e155 < (*.f64 a b) < 2e3Initial program 97.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
Taylor expanded in x around 0
Applied rewrites68.9%
Applied rewrites68.9%
if 2e3 < (*.f64 a b) < 1.99999999999999984e134Initial program 100.0%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6486.1
Applied rewrites86.1%
Taylor expanded in x around 0
Applied rewrites36.7%
Taylor expanded in z around 0
Applied rewrites71.7%
Final simplification74.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -1e+25)
(fma (* 0.0625 t) z (fma -0.25 (* b a) c))
(if (<= (* b a) 4e+161)
(fma y x (fma (* z 0.0625) t c))
(fma (* a -0.25) b (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -1e+25) {
tmp = fma((0.0625 * t), z, fma(-0.25, (b * a), c));
} else if ((b * a) <= 4e+161) {
tmp = fma(y, x, fma((z * 0.0625), t, c));
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -1e+25) tmp = fma(Float64(0.0625 * t), z, fma(-0.25, Float64(b * a), c)); elseif (Float64(b * a) <= 4e+161) tmp = fma(y, x, fma(Float64(z * 0.0625), t, c)); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -1e+25], N[(N[(0.0625 * t), $MachinePrecision] * z + N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+161], N[(y * x + N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision]), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(0.0625 \cdot t, z, \mathsf{fma}\left(-0.25, b \cdot a, c\right)\right)\\
\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z \cdot 0.0625, t, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000009e25Initial program 92.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6498.5
Applied rewrites98.5%
Taylor expanded in x around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6491.2
Applied rewrites91.2%
if -1.00000000000000009e25 < (*.f64 a b) < 4.0000000000000002e161Initial program 99.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6495.0
Applied rewrites95.0%
Applied rewrites95.0%
if 4.0000000000000002e161 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.5
Applied rewrites89.5%
Taylor expanded in c around 0
Applied rewrites89.7%
Final simplification93.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -5e+155)
(fma -0.25 (* b a) (fma y x c))
(if (<= (* b a) 4e+161)
(fma y x (fma (* z 0.0625) t c))
(fma (* a -0.25) b (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -5e+155) {
tmp = fma(-0.25, (b * a), fma(y, x, c));
} else if ((b * a) <= 4e+161) {
tmp = fma(y, x, fma((z * 0.0625), t, c));
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -5e+155) tmp = fma(-0.25, Float64(b * a), fma(y, x, c)); elseif (Float64(b * a) <= 4e+161) tmp = fma(y, x, fma(Float64(z * 0.0625), t, c)); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -5e+155], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+161], N[(y * x + N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision]), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\
\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z \cdot 0.0625, t, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e155Initial program 95.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
if -4.9999999999999999e155 < (*.f64 a b) < 4.0000000000000002e161Initial program 97.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
Applied rewrites92.9%
if 4.0000000000000002e161 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.5
Applied rewrites89.5%
Taylor expanded in c around 0
Applied rewrites89.7%
Final simplification93.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -5e+155)
(fma -0.25 (* b a) (fma y x c))
(if (<= (* b a) 4e+161)
(fma y x (fma (* z t) 0.0625 c))
(fma (* a -0.25) b (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -5e+155) {
tmp = fma(-0.25, (b * a), fma(y, x, c));
} else if ((b * a) <= 4e+161) {
tmp = fma(y, x, fma((z * t), 0.0625, c));
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -5e+155) tmp = fma(-0.25, Float64(b * a), fma(y, x, c)); elseif (Float64(b * a) <= 4e+161) tmp = fma(y, x, fma(Float64(z * t), 0.0625, c)); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -5e+155], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+161], N[(y * x + N[(N[(z * t), $MachinePrecision] * 0.0625 + c), $MachinePrecision]), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\
\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(z \cdot t, 0.0625, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e155Initial program 95.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
if -4.9999999999999999e155 < (*.f64 a b) < 4.0000000000000002e161Initial program 97.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.9
Applied rewrites92.9%
if 4.0000000000000002e161 < (*.f64 a b) Initial program 97.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.5
Applied rewrites89.5%
Taylor expanded in c around 0
Applied rewrites89.7%
Final simplification93.2%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* z t) -2e+175)
(fma (* z 0.0625) t c)
(if (<= (* z t) 2e+84)
(fma -0.25 (* b a) (fma y x c))
(fma y x (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z * t) <= -2e+175) {
tmp = fma((z * 0.0625), t, c);
} else if ((z * t) <= 2e+84) {
tmp = fma(-0.25, (b * a), fma(y, x, c));
} else {
tmp = fma(y, x, ((z * t) * 0.0625));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(z * t) <= -2e+175) tmp = fma(Float64(z * 0.0625), t, c); elseif (Float64(z * t) <= 2e+84) tmp = fma(-0.25, Float64(b * a), fma(y, x, c)); else tmp = fma(y, x, Float64(Float64(z * t) * 0.0625)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(z * t), $MachinePrecision], -2e+175], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+84], N[(-0.25 * N[(b * a), $MachinePrecision] + N[(y * x + c), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+175}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, \mathsf{fma}\left(y, x, c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(z \cdot t\right) \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -1.9999999999999999e175Initial program 87.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6479.6
Applied rewrites79.6%
Taylor expanded in x around 0
Applied rewrites74.9%
Applied rewrites75.0%
if -1.9999999999999999e175 < (*.f64 z t) < 2.00000000000000012e84Initial program 99.4%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.1
Applied rewrites90.1%
if 2.00000000000000012e84 < (*.f64 z t) Initial program 97.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6487.9
Applied rewrites87.9%
Taylor expanded in c around 0
Applied rewrites79.0%
Applied rewrites81.6%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -5e+155)
(fma -0.25 (* b a) c)
(if (<= (* b a) 2000.0)
(fma (* z 0.0625) t c)
(fma (* a -0.25) b (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -5e+155) {
tmp = fma(-0.25, (b * a), c);
} else if ((b * a) <= 2000.0) {
tmp = fma((z * 0.0625), t, c);
} else {
tmp = fma((a * -0.25), b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -5e+155) tmp = fma(-0.25, Float64(b * a), c); elseif (Float64(b * a) <= 2000.0) tmp = fma(Float64(z * 0.0625), t, c); else tmp = fma(Float64(a * -0.25), b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -5e+155], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2000.0], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], N[(N[(a * -0.25), $MachinePrecision] * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{elif}\;b \cdot a \leq 2000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e155Initial program 95.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
Taylor expanded in x around 0
Applied rewrites95.4%
if -4.9999999999999999e155 < (*.f64 a b) < 2e3Initial program 97.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
Taylor expanded in x around 0
Applied rewrites68.9%
Applied rewrites68.9%
if 2e3 < (*.f64 a b) Initial program 98.4%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.6
Applied rewrites84.6%
Taylor expanded in c around 0
Applied rewrites75.5%
Final simplification75.0%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* b a) -5e+155)
(fma -0.25 (* b a) c)
(if (<= (* b a) 2000.0)
(fma (* z 0.0625) t c)
(fma y x (* (* a -0.25) b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((b * a) <= -5e+155) {
tmp = fma(-0.25, (b * a), c);
} else if ((b * a) <= 2000.0) {
tmp = fma((z * 0.0625), t, c);
} else {
tmp = fma(y, x, ((a * -0.25) * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(b * a) <= -5e+155) tmp = fma(-0.25, Float64(b * a), c); elseif (Float64(b * a) <= 2000.0) tmp = fma(Float64(z * 0.0625), t, c); else tmp = fma(y, x, Float64(Float64(a * -0.25) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(b * a), $MachinePrecision], -5e+155], N[(-0.25 * N[(b * a), $MachinePrecision] + c), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 2000.0], N[(N[(z * 0.0625), $MachinePrecision] * t + c), $MachinePrecision], N[(y * x + N[(N[(a * -0.25), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{elif}\;b \cdot a \leq 2000:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot -0.25\right) \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e155Initial program 95.3%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.7
Applied rewrites97.7%
Taylor expanded in x around 0
Applied rewrites95.4%
if -4.9999999999999999e155 < (*.f64 a b) < 2e3Initial program 97.3%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
Taylor expanded in x around 0
Applied rewrites68.9%
Applied rewrites68.9%
if 2e3 < (*.f64 a b) Initial program 98.4%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.6
Applied rewrites84.6%
Taylor expanded in c around 0
Applied rewrites75.5%
Applied rewrites74.0%
Final simplification74.6%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (fma -0.25 (* b a) c))) (if (<= (* b a) -4e+155) t_1 (if (<= (* b a) 2e+134) (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, (b * a), c);
double tmp;
if ((b * a) <= -4e+155) {
tmp = t_1;
} else if ((b * a) <= 2e+134) {
tmp = 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(b * a), c) tmp = 0.0 if (Float64(b * a) <= -4e+155) tmp = t_1; elseif (Float64(b * a) <= 2e+134) tmp = 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[(b * a), $MachinePrecision] + c), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -4e+155], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 2e+134], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.25, b \cdot a, c\right)\\
\mathbf{if}\;b \cdot a \leq -4 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.00000000000000003e155 or 1.99999999999999984e134 < (*.f64 a b) Initial program 96.4%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.8
Applied rewrites90.8%
Taylor expanded in x around 0
Applied rewrites84.2%
if -4.00000000000000003e155 < (*.f64 a b) < 1.99999999999999984e134Initial program 97.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites60.2%
Final simplification68.1%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* (* b a) -0.25))) (if (<= (* b a) -4e+155) t_1 (if (<= (* b a) 1e+154) (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 = (b * a) * -0.25;
double tmp;
if ((b * a) <= -4e+155) {
tmp = t_1;
} else if ((b * a) <= 1e+154) {
tmp = fma(x, y, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * a) * -0.25) tmp = 0.0 if (Float64(b * a) <= -4e+155) tmp = t_1; elseif (Float64(b * a) <= 1e+154) tmp = 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[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -4e+155], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 1e+154], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot -0.25\\
\mathbf{if}\;b \cdot a \leq -4 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot a \leq 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.00000000000000003e155 or 1.00000000000000004e154 < (*.f64 a b) Initial program 96.3%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.6
Applied rewrites82.6%
if -4.00000000000000003e155 < (*.f64 a b) < 1.00000000000000004e154Initial program 97.7%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.8
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites64.6%
Taylor expanded in z around 0
Applied rewrites60.1%
Final simplification67.3%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (* (* z t) 0.0625))) (if (<= (* z t) -2.55e+175) t_1 (if (<= (* z t) 8.8e+88) (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 = (z * t) * 0.0625;
double tmp;
if ((z * t) <= -2.55e+175) {
tmp = t_1;
} else if ((z * t) <= 8.8e+88) {
tmp = fma(x, y, c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) tmp = 0.0 if (Float64(z * t) <= -2.55e+175) tmp = t_1; elseif (Float64(z * t) <= 8.8e+88) tmp = 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[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2.55e+175], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 8.8e+88], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;z \cdot t \leq -2.55 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 8.8 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2.55000000000000003e175 or 8.80000000000000035e88 < (*.f64 z t) Initial program 92.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6498.8
Applied rewrites98.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.8
Applied rewrites66.8%
if -2.55000000000000003e175 < (*.f64 z t) < 8.80000000000000035e88Initial program 99.4%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6465.9
Applied rewrites65.9%
Taylor expanded in x around 0
Applied rewrites37.0%
Taylor expanded in z around 0
Applied rewrites56.9%
(FPCore (x y z t a b c) :precision binary64 (fma (* 0.0625 t) z (fma y x (+ (* (* b a) -0.25) c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma((0.0625 * t), z, fma(y, x, (((b * a) * -0.25) + c)));
}
function code(x, y, z, t, a, b, c) return fma(Float64(0.0625 * t), z, fma(y, x, Float64(Float64(Float64(b * a) * -0.25) + c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(0.0625 * t), $MachinePrecision] * z + N[(y * x + N[(N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.0625 \cdot t, z, \mathsf{fma}\left(y, x, \left(b \cdot a\right) \cdot -0.25 + c\right)\right)
\end{array}
Initial program 97.2%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift--.f64N/A
associate--r-N/A
+-commutativeN/A
lift-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f6499.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.2
Applied rewrites99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (fma (* 0.0625 t) z (fma y x (* (* b a) -0.25))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma((0.0625 * t), z, fma(y, x, ((b * a) * -0.25))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(Float64(0.0625 * t), z, fma(y, x, Float64(Float64(b * a) * -0.25))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(0.0625 * t), $MachinePrecision] * z + N[(y * x + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.0625 \cdot t, z, \mathsf{fma}\left(y, x, \left(b \cdot a\right) \cdot -0.25\right)\right) + c
\end{array}
Initial program 97.2%
lift--.f64N/A
sub-negN/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
div-invN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
Applied rewrites99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (fma x y c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, c);
}
function code(x, y, z, t, a, b, c) return fma(x, y, c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, c\right)
\end{array}
Initial program 97.2%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6471.5
Applied rewrites71.5%
Taylor expanded in x around 0
Applied rewrites48.9%
Taylor expanded in z around 0
Applied rewrites45.9%
(FPCore (x y z t a b c) :precision binary64 (* x y))
double code(double x, double y, double z, double t, double a, double b, double c) {
return x * y;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return x * y;
}
def code(x, y, z, t, a, b, c): return x * y
function code(x, y, z, t, a, b, c) return Float64(x * y) end
function tmp = code(x, y, z, t, a, b, c) tmp = x * y; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y
\end{array}
Initial program 97.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6425.7
Applied rewrites25.7%
Final simplification25.7%
herbie shell --seed 2024332
(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))