Average Error: 0.3 → 0.2
Time: 3.1s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[6 \cdot \left(z \cdot y - x \cdot z\right) + x\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
6 \cdot \left(z \cdot y - x \cdot z\right) + x
double f(double x, double y, double z) {
        double r832497 = x;
        double r832498 = y;
        double r832499 = r832498 - r832497;
        double r832500 = 6.0;
        double r832501 = r832499 * r832500;
        double r832502 = z;
        double r832503 = r832501 * r832502;
        double r832504 = r832497 + r832503;
        return r832504;
}

double f(double x, double y, double z) {
        double r832505 = 6.0;
        double r832506 = z;
        double r832507 = y;
        double r832508 = r832506 * r832507;
        double r832509 = x;
        double r832510 = r832509 * r832506;
        double r832511 = r832508 - r832510;
        double r832512 = r832505 * r832511;
        double r832513 = r832512 + r832509;
        return r832513;
}

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 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.7

    \[\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 6 \cdot \left(z \cdot y - x \cdot z\right) + x\]

Reproduce

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