Average Error: 0.2 → 0.2
Time: 45.7s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[\left(z \cdot y + z \cdot \left(-x\right)\right) \cdot 6 + x\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\left(z \cdot y + z \cdot \left(-x\right)\right) \cdot 6 + x
double f(double x, double y, double z) {
        double r814150 = x;
        double r814151 = y;
        double r814152 = r814151 - r814150;
        double r814153 = 6.0;
        double r814154 = r814152 * r814153;
        double r814155 = z;
        double r814156 = r814154 * r814155;
        double r814157 = r814150 + r814156;
        return r814157;
}

double f(double x, double y, double z) {
        double r814158 = z;
        double r814159 = y;
        double r814160 = r814158 * r814159;
        double r814161 = x;
        double r814162 = -r814161;
        double r814163 = r814158 * r814162;
        double r814164 = r814160 + r814163;
        double r814165 = 6.0;
        double r814166 = r814164 * r814165;
        double r814167 = r814166 + r814161;
        return r814167;
}

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot z, x\right)}\]
  3. Taylor expanded around 0 0.2

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

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

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

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

    \[\leadsto \left(z \cdot \color{blue}{\left(y + \left(-x\right)\right)}\right) \cdot 6 + x\]
  10. Applied distribute-lft-in0.2

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

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

Reproduce

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