Average Error: 0.1 → 0.1
Time: 9.1s
Precision: 64
\[\frac{841.0}{108.0} \cdot x + \frac{4.0}{29.0}\]
\[\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right)\]
\frac{841.0}{108.0} \cdot x + \frac{4.0}{29.0}
\mathsf{fma}\left(7.787037037037037, x, 0.13793103448275862\right)
double f(double x) {
        double r12952443 = 841.0;
        double r12952444 = 108.0;
        double r12952445 = r12952443 / r12952444;
        double r12952446 = x;
        double r12952447 = r12952445 * r12952446;
        double r12952448 = 4.0;
        double r12952449 = 29.0;
        double r12952450 = r12952448 / r12952449;
        double r12952451 = r12952447 + r12952450;
        return r12952451;
}

double f(double x) {
        double r12952452 = 7.787037037037037;
        double r12952453 = x;
        double r12952454 = 0.13793103448275862;
        double r12952455 = fma(r12952452, r12952453, r12952454);
        return r12952455;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[\frac{841.0}{108.0} \cdot x + \frac{4.0}{29.0}\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{7.787037037037037 \cdot x + 0.13793103448275862}\]
  3. Simplified0.1

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

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

Reproduce

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