| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 6592 |
\[\mathsf{fma}\left(x, 116, -16\right)
\]

(FPCore (x) :precision binary64 (- (* x 116.0) 16.0))
(FPCore (x) :precision binary64 (fma x 116.0 -16.0))
double code(double x) {
return (x * 116.0) - 16.0;
}
double code(double x) {
return fma(x, 116.0, -16.0);
}
function code(x) return Float64(Float64(x * 116.0) - 16.0) end
function code(x) return fma(x, 116.0, -16.0) end
code[x_] := N[(N[(x * 116.0), $MachinePrecision] - 16.0), $MachinePrecision]
code[x_] := N[(x * 116.0 + -16.0), $MachinePrecision]
x \cdot 116 - 16
\mathsf{fma}\left(x, 116, -16\right)
Herbie found 4 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Initial program 100.0%
Simplified100.0%
[Start]100.0% | \[ x \cdot 116 - 16
\] |
|---|---|
fma-neg [=>]100.0% | \[ \color{blue}{\mathsf{fma}\left(x, 116, -16\right)}
\] |
metadata-eval [=>]100.0% | \[ \mathsf{fma}\left(x, 116, \color{blue}{-16}\right)
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 6592 |
| Alternative 2 | |
|---|---|
| Accuracy | 97.9% |
| Cost | 456 |
| Alternative 3 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 320 |
| Alternative 4 | |
|---|---|
| Accuracy | 50.6% |
| Cost | 64 |
herbie shell --seed 2023272
(FPCore (x)
:name "Data.Colour.CIE:lightness from colour-2.3.3"
:precision binary64
(- (* x 116.0) 16.0))