Average Error: 17.7 → 0.0
Time: 19.2s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r317924 = x;
        double r317925 = y;
        double r317926 = r317924 * r317925;
        double r317927 = r317925 * r317925;
        double r317928 = r317926 + r317927;
        double r317929 = z;
        double r317930 = r317925 * r317929;
        double r317931 = r317928 - r317930;
        double r317932 = r317931 - r317927;
        return r317932;
}

double f(double x, double y, double z) {
        double r317933 = x;
        double r317934 = z;
        double r317935 = r317933 - r317934;
        double r317936 = y;
        double r317937 = r317935 * r317936;
        return r317937;
}

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 y\right) - y \cdot z\right) - y \cdot y\]
  2. Simplified0.0

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

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

Reproduce

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

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

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