Average Error: 12.4 → 0.0
Time: 15.6s
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 r23547689 = x;
        double r23547690 = y;
        double r23547691 = r23547689 * r23547690;
        double r23547692 = r23547690 * r23547690;
        double r23547693 = r23547691 - r23547692;
        double r23547694 = r23547693 + r23547692;
        double r23547695 = z;
        double r23547696 = r23547690 * r23547695;
        double r23547697 = r23547694 - r23547696;
        return r23547697;
}

double f(double x, double y, double z) {
        double r23547698 = x;
        double r23547699 = z;
        double r23547700 = r23547698 - r23547699;
        double r23547701 = y;
        double r23547702 = r23547700 * r23547701;
        return r23547702;
}

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}{\left(x - z\right) \cdot y}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019158 +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)))