\[ \begin{array}{c}[d2, d3] = \mathsf{sort}([d2, d3])\\ \end{array} \]
\[\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32
\]
↓
\[\mathsf{fma}\left(d2, d1, d1 \cdot \left(\left(d3 + 5\right) + 32\right)\right)
\]
(FPCore (d1 d2 d3)
:precision binary64
(+ (+ (* d1 d2) (* (+ d3 5.0) d1)) (* d1 32.0)))
↓
(FPCore (d1 d2 d3) :precision binary64 (fma d2 d1 (* d1 (+ (+ d3 5.0) 32.0))))
double code(double d1, double d2, double d3) {
return ((d1 * d2) + ((d3 + 5.0) * d1)) + (d1 * 32.0);
}
↓
double code(double d1, double d2, double d3) {
return fma(d2, d1, (d1 * ((d3 + 5.0) + 32.0)));
}
function code(d1, d2, d3)
return Float64(Float64(Float64(d1 * d2) + Float64(Float64(d3 + 5.0) * d1)) + Float64(d1 * 32.0))
end
↓
function code(d1, d2, d3)
return fma(d2, d1, Float64(d1 * Float64(Float64(d3 + 5.0) + 32.0)))
end
code[d1_, d2_, d3_] := N[(N[(N[(d1 * d2), $MachinePrecision] + N[(N[(d3 + 5.0), $MachinePrecision] * d1), $MachinePrecision]), $MachinePrecision] + N[(d1 * 32.0), $MachinePrecision]), $MachinePrecision]
↓
code[d1_, d2_, d3_] := N[(d2 * d1 + N[(d1 * N[(N[(d3 + 5.0), $MachinePrecision] + 32.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(d1 \cdot d2 + \left(d3 + 5\right) \cdot d1\right) + d1 \cdot 32
↓
\mathsf{fma}\left(d2, d1, d1 \cdot \left(\left(d3 + 5\right) + 32\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.0 |
|---|
| Cost | 6848 |
|---|
\[\mathsf{fma}\left(d2 + 37, d1, d1 \cdot d3\right)
\]
| Alternative 2 |
|---|
| Error | 14.0 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := d1 \cdot \left(d2 + d3\right)\\
\mathbf{if}\;d2 \leq -11762.080096463824:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq -7.503757733163784 \cdot 10^{-89}:\\
\;\;\;\;d1 \cdot 37\\
\mathbf{elif}\;d2 \leq -7.330157222737064 \cdot 10^{-101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d2 \leq 5.0112852610978795 \cdot 10^{-151}:\\
\;\;\;\;d1 \cdot 37\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 17.8 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -78905.74281931641:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{elif}\;d2 \leq -7.503757733163784 \cdot 10^{-89}:\\
\;\;\;\;d1 \cdot 37\\
\mathbf{elif}\;d2 \leq -7.330157222737064 \cdot 10^{-101}:\\
\;\;\;\;d1 \cdot d3\\
\mathbf{elif}\;d2 \leq 5.0112852610978795 \cdot 10^{-151}:\\
\;\;\;\;d1 \cdot 37\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot d3\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.1 |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -78905.74281931641:\\
\;\;\;\;d1 \cdot d3 + d2 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d3 + 37\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.0 |
|---|
| Cost | 576 |
|---|
\[d1 \cdot d3 + d1 \cdot \left(d2 + 37\right)
\]
| Alternative 6 |
|---|
| Error | 1.1 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -78905.74281931641:\\
\;\;\;\;d1 \cdot \left(d2 + d3\right)\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot \left(d3 + 37\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.0 |
|---|
| Cost | 448 |
|---|
\[d1 \cdot \left(d3 + \left(d2 + 37\right)\right)
\]
| Alternative 8 |
|---|
| Error | 22.7 |
|---|
| Cost | 324 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d2 \leq -78905.74281931641:\\
\;\;\;\;d2 \cdot d1\\
\mathbf{else}:\\
\;\;\;\;d1 \cdot 37\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 43.1 |
|---|
| Cost | 192 |
|---|
\[d1 \cdot 37
\]