Average Error: 12.4 → 0.0
Time: 2.3s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x + y \cdot \left(-z\right)\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r537988 = x;
        double r537989 = y;
        double r537990 = r537988 * r537989;
        double r537991 = r537989 * r537989;
        double r537992 = r537990 - r537991;
        double r537993 = r537992 + r537991;
        double r537994 = z;
        double r537995 = r537989 * r537994;
        double r537996 = r537993 - r537995;
        return r537996;
}

double f(double x, double y, double z) {
        double r537997 = y;
        double r537998 = x;
        double r537999 = r537997 * r537998;
        double r538000 = z;
        double r538001 = -r538000;
        double r538002 = r537997 * r538001;
        double r538003 = r537999 + r538002;
        return r538003;
}

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

Derivation

  1. Initial program 12.4

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

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

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

Reproduce

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