Average Error: 0.3 → 0.2
Time: 12.3s
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 r595786 = x;
        double r595787 = y;
        double r595788 = r595787 - r595786;
        double r595789 = 6.0;
        double r595790 = r595788 * r595789;
        double r595791 = z;
        double r595792 = r595790 * r595791;
        double r595793 = r595786 + r595792;
        return r595793;
}

double f(double x, double y, double z) {
        double r595794 = x;
        double r595795 = y;
        double r595796 = r595795 - r595794;
        double r595797 = z;
        double r595798 = 6.0;
        double r595799 = r595797 * r595798;
        double r595800 = r595796 * r595799;
        double r595801 = r595794 + r595800;
        return r595801;
}

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.3
Target0.2
Herbie0.2
\[x - \left(6 \cdot z\right) \cdot \left(x - y\right)\]

Derivation

  1. Initial program 0.3

    \[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 2019198 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"

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

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