| Alternative 1 | |
|---|---|
| Error | 1.3 |
| Cost | 456 |
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.135:\\
\;\;\;\;x \cdot 116\\
\mathbf{elif}\;x \leq 0.14:\\
\;\;\;\;-16\\
\mathbf{else}:\\
\;\;\;\;x \cdot 116\\
\end{array}
\]
(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)
Initial program 0.0
Simplified0
Final simplification0
| Alternative 1 | |
|---|---|
| Error | 1.3 |
| Cost | 456 |
| Alternative 2 | |
|---|---|
| Error | 0.0 |
| Cost | 320 |
| Alternative 3 | |
|---|---|
| Error | 31.2 |
| Cost | 64 |
herbie shell --seed 2022325
(FPCore (x)
:name "Data.Colour.CIE:lightness from colour-2.3.3"
:precision binary64
(- (* x 116.0) 16.0))