Average Error: 0.2 → 0.2
Time: 10.4s
Precision: 64
\[\left(\left(x - \frac{16.0}{116.0}\right) \cdot 3.0\right) \cdot y\]
\[\left(-0.41379310344827586\right) \cdot y + \left(y \cdot x\right) \cdot 3.0\]
\left(\left(x - \frac{16.0}{116.0}\right) \cdot 3.0\right) \cdot y
\left(-0.41379310344827586\right) \cdot y + \left(y \cdot x\right) \cdot 3.0
double f(double x, double y) {
        double r35004674 = x;
        double r35004675 = 16.0;
        double r35004676 = 116.0;
        double r35004677 = r35004675 / r35004676;
        double r35004678 = r35004674 - r35004677;
        double r35004679 = 3.0;
        double r35004680 = r35004678 * r35004679;
        double r35004681 = y;
        double r35004682 = r35004680 * r35004681;
        return r35004682;
}

double f(double x, double y) {
        double r35004683 = 0.41379310344827586;
        double r35004684 = -r35004683;
        double r35004685 = y;
        double r35004686 = r35004684 * r35004685;
        double r35004687 = x;
        double r35004688 = r35004685 * r35004687;
        double r35004689 = 3.0;
        double r35004690 = r35004688 * r35004689;
        double r35004691 = r35004686 + r35004690;
        return r35004691;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.2

    \[\left(\left(x - \frac{16.0}{116.0}\right) \cdot 3.0\right) \cdot y\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{3.0 \cdot \left(x \cdot y\right) - 0.41379310344827586 \cdot y}\]
  3. Simplified0.2

    \[\leadsto \color{blue}{y \cdot \left(3.0 \cdot x - 0.41379310344827586\right)}\]
  4. Using strategy rm
  5. Applied sub-neg0.2

    \[\leadsto y \cdot \color{blue}{\left(3.0 \cdot x + \left(-0.41379310344827586\right)\right)}\]
  6. Applied distribute-rgt-in0.2

    \[\leadsto \color{blue}{\left(3.0 \cdot x\right) \cdot y + \left(-0.41379310344827586\right) \cdot y}\]
  7. Using strategy rm
  8. Applied associate-*l*0.2

    \[\leadsto \color{blue}{3.0 \cdot \left(x \cdot y\right)} + \left(-0.41379310344827586\right) \cdot y\]
  9. Final simplification0.2

    \[\leadsto \left(-0.41379310344827586\right) \cdot y + \left(y \cdot x\right) \cdot 3.0\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y)
  :name "Data.Colour.CIE:cieLAB from colour-2.3.3, A"

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

  (* (* (- x (/ 16.0 116.0)) 3.0) y))