Average Error: 13.2 → 0.0
Time: 15.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - y \cdot z\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - y \cdot z
double f(double x, double y, double z) {
        double r383740 = x;
        double r383741 = y;
        double r383742 = r383740 * r383741;
        double r383743 = r383741 * r383741;
        double r383744 = r383742 - r383743;
        double r383745 = r383744 + r383743;
        double r383746 = z;
        double r383747 = r383741 * r383746;
        double r383748 = r383745 - r383747;
        return r383748;
}

double f(double x, double y, double z) {
        double r383749 = y;
        double r383750 = x;
        double r383751 = r383749 * r383750;
        double r383752 = z;
        double r383753 = r383749 * r383752;
        double r383754 = r383751 - r383753;
        return r383754;
}

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

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

Derivation

  1. Initial program 13.2

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

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

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

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

    \[\leadsto y \cdot x - y \cdot z\]

Reproduce

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

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

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