Average Error: 18.0 → 0.0
Time: 16.9s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r19027692 = x;
        double r19027693 = y;
        double r19027694 = r19027692 * r19027693;
        double r19027695 = r19027693 * r19027693;
        double r19027696 = r19027694 + r19027695;
        double r19027697 = z;
        double r19027698 = r19027693 * r19027697;
        double r19027699 = r19027696 - r19027698;
        double r19027700 = r19027699 - r19027695;
        return r19027700;
}

double f(double x, double y, double z) {
        double r19027701 = y;
        double r19027702 = z;
        double r19027703 = -r19027702;
        double r19027704 = r19027701 * r19027703;
        double r19027705 = x;
        double r19027706 = r19027705 * r19027701;
        double r19027707 = r19027704 + r19027706;
        return r19027707;
}

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 y\right) - y \cdot z\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 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"

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

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