Average Error: 0.3 → 0.2
Time: 11.7s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(z \cdot \left(y - x\right)\right) \cdot 6\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(z \cdot \left(y - x\right)\right) \cdot 6
double f(double x, double y, double z) {
        double r594784 = x;
        double r594785 = y;
        double r594786 = r594785 - r594784;
        double r594787 = 6.0;
        double r594788 = r594786 * r594787;
        double r594789 = z;
        double r594790 = r594788 * r594789;
        double r594791 = r594784 + r594790;
        return r594791;
}

double f(double x, double y, double z) {
        double r594792 = x;
        double r594793 = z;
        double r594794 = y;
        double r594795 = r594794 - r594792;
        double r594796 = r594793 * r594795;
        double r594797 = 6.0;
        double r594798 = r594796 * r594797;
        double r594799 = r594792 + r594798;
        return r594799;
}

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. Taylor expanded around inf 0.2

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

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

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

Reproduce

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