Average Error: 12.5 → 0.0
Time: 10.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 r37429569 = x;
        double r37429570 = y;
        double r37429571 = r37429569 * r37429570;
        double r37429572 = r37429570 * r37429570;
        double r37429573 = r37429571 - r37429572;
        double r37429574 = r37429573 + r37429572;
        double r37429575 = z;
        double r37429576 = r37429570 * r37429575;
        double r37429577 = r37429574 - r37429576;
        return r37429577;
}

double f(double x, double y, double z) {
        double r37429578 = y;
        double r37429579 = z;
        double r37429580 = -r37429579;
        double r37429581 = r37429578 * r37429580;
        double r37429582 = x;
        double r37429583 = r37429582 * r37429578;
        double r37429584 = r37429581 + r37429583;
        return r37429584;
}

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

Derivation

  1. Initial program 12.5

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