Average Error: 18.0 → 0.0
Time: 17.3s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r26981543 = x;
        double r26981544 = y;
        double r26981545 = r26981543 * r26981544;
        double r26981546 = z;
        double r26981547 = r26981544 * r26981546;
        double r26981548 = r26981545 - r26981547;
        double r26981549 = r26981544 * r26981544;
        double r26981550 = r26981548 - r26981549;
        double r26981551 = r26981550 + r26981549;
        return r26981551;
}

double f(double x, double y, double z) {
        double r26981552 = y;
        double r26981553 = z;
        double r26981554 = -r26981553;
        double r26981555 = r26981552 * r26981554;
        double r26981556 = x;
        double r26981557 = r26981556 * r26981552;
        double r26981558 = r26981555 + r26981557;
        return r26981558;
}

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

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

Derivation

  1. Initial program 18.0

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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, B"

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

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