Average Error: 0.1 → 0.1
Time: 9.5s
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 r12891177 = 841.0;
        double r12891178 = 108.0;
        double r12891179 = r12891177 / r12891178;
        double r12891180 = x;
        double r12891181 = r12891179 * r12891180;
        double r12891182 = 4.0;
        double r12891183 = 29.0;
        double r12891184 = r12891182 / r12891183;
        double r12891185 = r12891181 + r12891184;
        return r12891185;
}

double f(double x) {
        double r12891186 = 7.787037037037037;
        double r12891187 = x;
        double r12891188 = 0.13793103448275862;
        double r12891189 = fma(r12891186, r12891187, r12891188);
        return r12891189;
}

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)))