Average Error: 0.2 → 0.2
Time: 20.0s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(\left(y - x\right) \cdot z\right) \cdot 6\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(\left(y - x\right) \cdot z\right) \cdot 6
double f(double x, double y, double z) {
        double r712411 = x;
        double r712412 = y;
        double r712413 = r712412 - r712411;
        double r712414 = 6.0;
        double r712415 = r712413 * r712414;
        double r712416 = z;
        double r712417 = r712415 * r712416;
        double r712418 = r712411 + r712417;
        return r712418;
}

double f(double x, double y, double z) {
        double r712419 = x;
        double r712420 = y;
        double r712421 = r712420 - r712419;
        double r712422 = z;
        double r712423 = r712421 * r712422;
        double r712424 = 6.0;
        double r712425 = r712423 * r712424;
        double r712426 = r712419 + r712425;
        return r712426;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.2

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)}\]
  4. Simplified0.2

    \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\left(z \cdot 6\right)}\]
  5. Using strategy rm
  6. Applied associate-*r*0.2

    \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot 6}\]
  7. Final simplification0.2

    \[\leadsto x + \left(\left(y - x\right) \cdot z\right) \cdot 6\]

Reproduce

herbie shell --seed 2019303 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

  :herbie-target
  (- x (* (* 6 z) (- x y)))

  (+ x (* (* (- y x) 6) z)))