Average Error: 0.3 → 0.2
Time: 15.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 r540947 = x;
        double r540948 = y;
        double r540949 = r540948 - r540947;
        double r540950 = 6.0;
        double r540951 = r540949 * r540950;
        double r540952 = z;
        double r540953 = r540951 * r540952;
        double r540954 = r540947 + r540953;
        return r540954;
}

double f(double x, double y, double z) {
        double r540955 = x;
        double r540956 = y;
        double r540957 = r540956 - r540955;
        double r540958 = z;
        double r540959 = 6.0;
        double r540960 = r540958 * r540959;
        double r540961 = r540957 * r540960;
        double r540962 = r540955 + r540961;
        return r540962;
}

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 2019304 
(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)))