Average Error: 0.2 → 0.2
Time: 20.6s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(y - x\right) \cdot \left(z \cdot 6\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(y - x\right) \cdot \left(z \cdot 6\right)
double f(double x, double y, double z) {
        double r60585 = x;
        double r60586 = y;
        double r60587 = r60586 - r60585;
        double r60588 = 6.0;
        double r60589 = r60587 * r60588;
        double r60590 = z;
        double r60591 = r60589 * r60590;
        double r60592 = r60585 + r60591;
        return r60592;
}

double f(double x, double y, double z) {
        double r60593 = x;
        double r60594 = y;
        double r60595 = r60594 - r60593;
        double r60596 = z;
        double r60597 = 6.0;
        double r60598 = r60596 * r60597;
        double r60599 = r60595 * r60598;
        double r60600 = r60593 + r60599;
        return r60600;
}

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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019315 
(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)))