Average Error: 12.9 → 0.0
Time: 5.9s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r345003 = x;
        double r345004 = y;
        double r345005 = r345003 * r345004;
        double r345006 = r345004 * r345004;
        double r345007 = r345005 - r345006;
        double r345008 = r345007 + r345006;
        double r345009 = z;
        double r345010 = r345004 * r345009;
        double r345011 = r345008 - r345010;
        return r345011;
}

double f(double x, double y, double z) {
        double r345012 = y;
        double r345013 = x;
        double r345014 = z;
        double r345015 = r345013 - r345014;
        double r345016 = r345012 * r345015;
        return r345016;
}

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.9
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.9

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

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

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

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

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

Reproduce

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