Average Error: 17.7 → 0.0
Time: 17.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[x \cdot y + \left(-z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
x \cdot y + \left(-z\right) \cdot y
double f(double x, double y, double z) {
        double r388880 = x;
        double r388881 = y;
        double r388882 = r388880 * r388881;
        double r388883 = z;
        double r388884 = r388881 * r388883;
        double r388885 = r388882 - r388884;
        double r388886 = r388881 * r388881;
        double r388887 = r388885 - r388886;
        double r388888 = r388887 + r388886;
        return r388888;
}

double f(double x, double y, double z) {
        double r388889 = x;
        double r388890 = y;
        double r388891 = r388889 * r388890;
        double r388892 = z;
        double r388893 = -r388892;
        double r388894 = r388893 * r388890;
        double r388895 = r388891 + r388894;
        return r388895;
}

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

Original17.7
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 17.7

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied sub-neg17.7

    \[\leadsto \left(\color{blue}{\left(x \cdot y + \left(-y \cdot z\right)\right)} - y \cdot y\right) + y \cdot y\]
  4. Applied associate--l+17.7

    \[\leadsto \color{blue}{\left(x \cdot y + \left(\left(-y \cdot z\right) - y \cdot y\right)\right)} + y \cdot y\]
  5. Applied associate-+l+12.9

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

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

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

Reproduce

herbie shell --seed 2019208 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (* (- x z) y)

  (+ (- (- (* x y) (* y z)) (* y y)) (* y y)))