Average Error: 18.2 → 0.0
Time: 23.6s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[x \cdot y + \left(-y \cdot z\right)\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
x \cdot y + \left(-y \cdot z\right)
double f(double x, double y, double z) {
        double r385888 = x;
        double r385889 = y;
        double r385890 = r385888 * r385889;
        double r385891 = r385889 * r385889;
        double r385892 = r385890 + r385891;
        double r385893 = z;
        double r385894 = r385889 * r385893;
        double r385895 = r385892 - r385894;
        double r385896 = r385895 - r385891;
        return r385896;
}

double f(double x, double y, double z) {
        double r385897 = x;
        double r385898 = y;
        double r385899 = r385897 * r385898;
        double r385900 = z;
        double r385901 = r385898 * r385900;
        double r385902 = -r385901;
        double r385903 = r385899 + r385902;
        return r385903;
}

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

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

Derivation

  1. Initial program 18.2

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
  2. Using strategy rm
  3. Applied associate--l+18.2

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

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

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

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

Reproduce

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