Average Error: 12.8 → 0.0
Time: 5.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r26021628 = x;
        double r26021629 = y;
        double r26021630 = r26021628 * r26021629;
        double r26021631 = r26021629 * r26021629;
        double r26021632 = r26021630 - r26021631;
        double r26021633 = r26021632 + r26021631;
        double r26021634 = z;
        double r26021635 = r26021629 * r26021634;
        double r26021636 = r26021633 - r26021635;
        return r26021636;
}

double f(double x, double y, double z) {
        double r26021637 = x;
        double r26021638 = z;
        double r26021639 = r26021637 - r26021638;
        double r26021640 = y;
        double r26021641 = r26021639 * r26021640;
        return r26021641;
}

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

Derivation

  1. Initial program 12.8

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(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)))