Average Error: 0.2 → 0.2
Time: 2.2s
Precision: 64
\[\left(\left(x - \frac{16}{116}\right) \cdot 3\right) \cdot y\]
\[\mathsf{fma}\left(3, x, -0.413793103448275856\right) \cdot y\]
\left(\left(x - \frac{16}{116}\right) \cdot 3\right) \cdot y
\mathsf{fma}\left(3, x, -0.413793103448275856\right) \cdot y
double f(double x, double y) {
        double r865452 = x;
        double r865453 = 16.0;
        double r865454 = 116.0;
        double r865455 = r865453 / r865454;
        double r865456 = r865452 - r865455;
        double r865457 = 3.0;
        double r865458 = r865456 * r865457;
        double r865459 = y;
        double r865460 = r865458 * r865459;
        return r865460;
}

double f(double x, double y) {
        double r865461 = 3.0;
        double r865462 = x;
        double r865463 = 0.41379310344827586;
        double r865464 = -r865463;
        double r865465 = fma(r865461, r865462, r865464);
        double r865466 = y;
        double r865467 = r865465 * r865466;
        return r865467;
}

Error

Bits error versus x

Bits error versus y

Target

Original0.2
Target0.2
Herbie0.2
\[y \cdot \left(x \cdot 3 - 0.413793103448275856\right)\]

Derivation

  1. Initial program 0.2

    \[\left(\left(x - \frac{16}{116}\right) \cdot 3\right) \cdot y\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{\left(3 \cdot x - 0.413793103448275856\right)} \cdot y\]
  3. Using strategy rm
  4. Applied fma-neg0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(3, x, -0.413793103448275856\right)} \cdot y\]
  5. Final simplification0.2

    \[\leadsto \mathsf{fma}\left(3, x, -0.413793103448275856\right) \cdot y\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.CIE:cieLAB from colour-2.3.3, A"
  :precision binary64

  :herbie-target
  (* y (- (* x 3) 0.41379310344827586))

  (* (* (- x (/ 16 116)) 3) y))