Average Error: 0.1 → 0.1
Time: 1.5s
Precision: binary64
\[\frac{841}{108} \cdot x + \frac{4}{29} \]
\[\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right) \]
(FPCore (x) :precision binary64 (+ (* (/ 841.0 108.0) x) (/ 4.0 29.0)))
(FPCore (x) :precision binary64 (fma 7.787037037037037 x 0.13793103448275862))
double code(double x) {
	return ((841.0 / 108.0) * x) + (4.0 / 29.0);
}
double code(double x) {
	return fma(7.787037037037037, x, 0.13793103448275862);
}
function code(x)
	return Float64(Float64(Float64(841.0 / 108.0) * x) + Float64(4.0 / 29.0))
end
function code(x)
	return fma(7.787037037037037, x, 0.13793103448275862)
end
code[x_] := N[(N[(N[(841.0 / 108.0), $MachinePrecision] * x), $MachinePrecision] + N[(4.0 / 29.0), $MachinePrecision]), $MachinePrecision]
code[x_] := N[(7.787037037037037 * x + 0.13793103448275862), $MachinePrecision]
\frac{841}{108} \cdot x + \frac{4}{29}
\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right)

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[\frac{841}{108} \cdot x + \frac{4}{29} \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right)} \]
  3. Applied egg-rr0.9

    \[\leadsto \color{blue}{\left(1 + \mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right)\right) - 1} \]
  4. Applied egg-rr0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right) + 0} \]
  5. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right) \]

Reproduce

herbie shell --seed 2022150 
(FPCore (x)
  :name "Data.Colour.CIE:cieLABView from colour-2.3.3, A"
  :precision binary64
  (+ (* (/ 841.0 108.0) x) (/ 4.0 29.0)))