Average Error: 0.2 → 0.2
Time: 13.1s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[\left(6 \cdot z\right) \cdot \left(y - x\right) + x\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\left(6 \cdot z\right) \cdot \left(y - x\right) + x
double f(double x, double y, double z) {
        double r655172 = x;
        double r655173 = y;
        double r655174 = r655173 - r655172;
        double r655175 = 6.0;
        double r655176 = r655174 * r655175;
        double r655177 = z;
        double r655178 = r655176 * r655177;
        double r655179 = r655172 + r655178;
        return r655179;
}

double f(double x, double y, double z) {
        double r655180 = 6.0;
        double r655181 = z;
        double r655182 = r655180 * r655181;
        double r655183 = y;
        double r655184 = x;
        double r655185 = r655183 - r655184;
        double r655186 = r655182 * r655185;
        double r655187 = r655186 + r655184;
        return r655187;
}

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 add-sqr-sqrt0.6

    \[\leadsto x + \left(\left(y - x\right) \cdot \color{blue}{\left(\sqrt{6} \cdot \sqrt{6}\right)}\right) \cdot z\]
  4. Applied associate-*r*0.6

    \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot \sqrt{6}\right) \cdot \sqrt{6}\right)} \cdot z\]
  5. Taylor expanded around 0 0.6

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

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

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

Reproduce

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