Average Error: 12.9 → 0.0
Time: 2.5s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r633493 = x;
        double r633494 = y;
        double r633495 = r633493 * r633494;
        double r633496 = r633494 * r633494;
        double r633497 = r633495 - r633496;
        double r633498 = r633497 + r633496;
        double r633499 = z;
        double r633500 = r633494 * r633499;
        double r633501 = r633498 - r633500;
        return r633501;
}

double f(double x, double y, double z) {
        double r633502 = x;
        double r633503 = z;
        double r633504 = r633502 - r633503;
        double r633505 = y;
        double r633506 = r633504 * r633505;
        return r633506;
}

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 *-commutative0.0

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

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

Reproduce

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