Average Error: 0.3 → 0.2
Time: 30.0s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
\[x + \left(\left(x \cdot z\right) \cdot -6.0 + \left(6.0 \cdot z\right) \cdot y\right)\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z
x + \left(\left(x \cdot z\right) \cdot -6.0 + \left(6.0 \cdot z\right) \cdot y\right)
double f(double x, double y, double z) {
        double r35076105 = x;
        double r35076106 = y;
        double r35076107 = r35076106 - r35076105;
        double r35076108 = 6.0;
        double r35076109 = r35076107 * r35076108;
        double r35076110 = z;
        double r35076111 = r35076109 * r35076110;
        double r35076112 = r35076105 + r35076111;
        return r35076112;
}

double f(double x, double y, double z) {
        double r35076113 = x;
        double r35076114 = z;
        double r35076115 = r35076113 * r35076114;
        double r35076116 = -6.0;
        double r35076117 = r35076115 * r35076116;
        double r35076118 = 6.0;
        double r35076119 = r35076118 * r35076114;
        double r35076120 = y;
        double r35076121 = r35076119 * r35076120;
        double r35076122 = r35076117 + r35076121;
        double r35076123 = r35076113 + r35076122;
        return r35076123;
}

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.0 \cdot z\right) \cdot \left(x - y\right)\]

Derivation

  1. Initial program 0.3

    \[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot 6.0, y - x, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.2

    \[\leadsto \color{blue}{\left(z \cdot 6.0\right) \cdot \left(y - x\right) + x}\]
  5. Using strategy rm
  6. Applied sub-neg0.2

    \[\leadsto \left(z \cdot 6.0\right) \cdot \color{blue}{\left(y + \left(-x\right)\right)} + x\]
  7. Applied distribute-rgt-in0.2

    \[\leadsto \color{blue}{\left(y \cdot \left(z \cdot 6.0\right) + \left(-x\right) \cdot \left(z \cdot 6.0\right)\right)} + x\]
  8. Taylor expanded around 0 0.2

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

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(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)))