Math FPCore C Julia Wolfram TeX \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\]
↓
\[\mathsf{fma}\left(x, y, \mathsf{fma}\left(t, \frac{z}{16}, c - a \cdot \frac{b}{4}\right)\right)
\]
(FPCore (x y z t a b c)
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c)) ↓
(FPCore (x y z t a b c)
:precision binary64
(fma x y (fma t (/ z 16.0) (- c (* a (/ b 4.0)))))) 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;
}
↓
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(t, (z / 16.0), (c - (a * (b / 4.0)))));
}
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 code(x, y, z, t, a, b, c)
return fma(x, y, fma(t, Float64(z / 16.0), Float64(c - Float64(a * Float64(b / 4.0)))))
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]
↓
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(t * N[(z / 16.0), $MachinePrecision] + N[(c - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
↓
\mathsf{fma}\left(x, y, \mathsf{fma}\left(t, \frac{z}{16}, c - a \cdot \frac{b}{4}\right)\right)
Alternatives Alternative 1 Error 23.8 Cost 1881
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1.85 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -5.8 \cdot 10^{-226}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;a \cdot b \leq 3.1 \cdot 10^{+59} \lor \neg \left(a \cdot b \leq 5.3 \cdot 10^{+109}\right) \land a \cdot b \leq 1.9 \cdot 10^{+142}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 2 Error 23.5 Cost 1881
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -1.35 \cdot 10^{+127}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -3.1 \cdot 10^{-167}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-315}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;a \cdot b \leq 3.1 \cdot 10^{+59} \lor \neg \left(a \cdot b \leq 3.2 \cdot 10^{+110}\right) \land a \cdot b \leq 2.65 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 3 Error 38.0 Cost 1880
\[\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -3.6 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1.85 \cdot 10^{-198}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-315}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;a \cdot b \leq 1.4 \cdot 10^{-299}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 8.2 \cdot 10^{-196}:\\
\;\;\;\;c\\
\mathbf{elif}\;a \cdot b \leq 1.95 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 19.7 Cost 1488
\[\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-315}:\\
\;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
Alternative 5 Error 8.0 Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+62} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+58}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\]
Alternative 6 Error 7.4 Cost 1225
\[\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{-150} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{-25}\right):\\
\;\;\;\;\left(c + x \cdot y\right) + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\]
Alternative 7 Error 0.1 Cost 1088
\[c + \left(\left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right)
\]
Alternative 8 Error 35.6 Cost 456
\[\begin{array}{l}
\mathbf{if}\;c \leq -2.45 \cdot 10^{+30}:\\
\;\;\;\;c\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+63}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\]
Alternative 9 Error 43.2 Cost 64
\[c
\]