Average Error: 12.8 → 0.0
Time: 14.4s
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 r619995 = x;
        double r619996 = y;
        double r619997 = r619995 * r619996;
        double r619998 = r619996 * r619996;
        double r619999 = r619997 - r619998;
        double r620000 = r619999 + r619998;
        double r620001 = z;
        double r620002 = r619996 * r620001;
        double r620003 = r620000 - r620002;
        return r620003;
}

double f(double x, double y, double z) {
        double r620004 = y;
        double r620005 = x;
        double r620006 = r620004 * r620005;
        double r620007 = z;
        double r620008 = r620004 * r620007;
        double r620009 = r620006 - r620008;
        return r620009;
}

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

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

Derivation

  1. Initial program 12.8

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

    \[\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 2020045 
(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)))