Average Error: 13.3 → 0.0
Time: 13.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r22916564 = x;
        double r22916565 = y;
        double r22916566 = r22916564 * r22916565;
        double r22916567 = r22916565 * r22916565;
        double r22916568 = r22916566 - r22916567;
        double r22916569 = r22916568 + r22916567;
        double r22916570 = z;
        double r22916571 = r22916565 * r22916570;
        double r22916572 = r22916569 - r22916571;
        return r22916572;
}

double f(double x, double y, double z) {
        double r22916573 = y;
        double r22916574 = z;
        double r22916575 = -r22916574;
        double r22916576 = r22916573 * r22916575;
        double r22916577 = x;
        double r22916578 = r22916577 * r22916573;
        double r22916579 = r22916576 + r22916578;
        return r22916579;
}

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

Derivation

  1. Initial program 13.3

    \[\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-rgt-in0.0

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

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

Reproduce

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

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

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