Average Error: 0.2 → 0.2
Time: 9.4s
Precision: 64
\[\left(\left(x - \frac{16}{116}\right) \cdot 3\right) \cdot y\]
\[y \cdot \mathsf{fma}\left(x, 3, -0.4137931034482758563264326312491903081536\right)\]
\left(\left(x - \frac{16}{116}\right) \cdot 3\right) \cdot y
y \cdot \mathsf{fma}\left(x, 3, -0.4137931034482758563264326312491903081536\right)
double f(double x, double y) {
        double r450128 = x;
        double r450129 = 16.0;
        double r450130 = 116.0;
        double r450131 = r450129 / r450130;
        double r450132 = r450128 - r450131;
        double r450133 = 3.0;
        double r450134 = r450132 * r450133;
        double r450135 = y;
        double r450136 = r450134 * r450135;
        return r450136;
}

double f(double x, double y) {
        double r450137 = y;
        double r450138 = x;
        double r450139 = 3.0;
        double r450140 = 0.41379310344827586;
        double r450141 = -r450140;
        double r450142 = fma(r450138, r450139, r450141);
        double r450143 = r450137 * r450142;
        return r450143;
}

Error

Bits error versus x

Bits error versus y

Target

Original0.2
Target0.2
Herbie0.2
\[y \cdot \left(x \cdot 3 - 0.4137931034482758563264326312491903081536\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}{3 \cdot \left(x \cdot y\right) - 0.4137931034482758563264326312491903081536 \cdot y}\]
  3. Simplified0.2

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

    \[\leadsto y \cdot \color{blue}{{\left(3 \cdot x - 0.4137931034482758563264326312491903081536\right)}^{1}}\]
  6. Applied pow10.2

    \[\leadsto \color{blue}{{y}^{1}} \cdot {\left(3 \cdot x - 0.4137931034482758563264326312491903081536\right)}^{1}\]
  7. Applied pow-prod-down0.2

    \[\leadsto \color{blue}{{\left(y \cdot \left(3 \cdot x - 0.4137931034482758563264326312491903081536\right)\right)}^{1}}\]
  8. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019212 +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.413793103448275856))

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