?

Average Accuracy: 100.0% → 100.0%
Time: 2.1s
Precision: binary64
Cost: 6592

?

\[x \cdot 116 - 16 \]
\[\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)

Error?

Derivation?

  1. Initial program 100.0%

    \[x \cdot 116 - 16 \]
  2. Simplified100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 116, -16\right)} \]
    Proof

    [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) \]
  3. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(x, 116, -16\right) \]

Alternatives

Alternative 1
Accuracy97.9%
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -0.136:\\ \;\;\;\;x \cdot 116\\ \mathbf{elif}\;x \leq 0.14:\\ \;\;\;\;-16\\ \mathbf{else}:\\ \;\;\;\;x \cdot 116\\ \end{array} \]
Alternative 2
Accuracy100.0%
Cost320
\[-16 + x \cdot 116 \]
Alternative 3
Accuracy50.7%
Cost64
\[-16 \]

Error

Reproduce?

herbie shell --seed 2023129 
(FPCore (x)
  :name "Data.Colour.CIE:lightness from colour-2.3.3"
  :precision binary64
  (- (* x 116.0) 16.0))