\[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
\]
↓
\[\mathsf{fma}\left(z, -0.5 \cdot y, \mathsf{fma}\left(0.125, x, t\right)\right)
\]
(FPCore (x y z t)
:precision binary64
(+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
↓
(FPCore (x y z t) :precision binary64 (fma z (* -0.5 y) (fma 0.125 x t)))
double code(double x, double y, double z, double t) {
return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
↓
double code(double x, double y, double z, double t) {
return fma(z, (-0.5 * y), fma(0.125, x, t));
}
function code(x, y, z, t)
return Float64(Float64(Float64(Float64(1.0 / 8.0) * x) - Float64(Float64(y * z) / 2.0)) + t)
end
↓
function code(x, y, z, t)
return fma(z, Float64(-0.5 * y), fma(0.125, x, t))
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / 8.0), $MachinePrecision] * x), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(z * N[(-0.5 * y), $MachinePrecision] + N[(0.125 * x + t), $MachinePrecision]), $MachinePrecision]
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
↓
\mathsf{fma}\left(z, -0.5 \cdot y, \mathsf{fma}\left(0.125, x, t\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 15.77% |
|---|
| Cost | 1490 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \cdot y \leq -4 \cdot 10^{+99} \lor \neg \left(z \cdot y \leq 10^{-89} \lor \neg \left(z \cdot y \leq 4 \cdot 10^{+36}\right) \land z \cdot y \leq 2 \cdot 10^{+89}\right):\\
\;\;\;\;t + -0.5 \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 45.02% |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(-0.5 \cdot y\right)\\
\mathbf{if}\;t \leq -1.36 \cdot 10^{+48}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-140}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-286}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+106}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 18.7% |
|---|
| Cost | 841 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \cdot y \leq -5 \cdot 10^{+167} \lor \neg \left(z \cdot y \leq 2 \cdot 10^{+89}\right):\\
\;\;\;\;z \cdot \left(-0.5 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.01% |
|---|
| Cost | 704 |
|---|
\[t + \left(0.125 \cdot x - z \cdot \frac{y}{2}\right)
\]
| Alternative 5 |
|---|
| Error | 43.8% |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{+48}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+107}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 62.23% |
|---|
| Cost | 64 |
|---|
\[t
\]