Average Error: 12.8 → 0.0
Time: 11.5s
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 r387476 = x;
        double r387477 = y;
        double r387478 = r387476 * r387477;
        double r387479 = r387477 * r387477;
        double r387480 = r387478 - r387479;
        double r387481 = r387480 + r387479;
        double r387482 = z;
        double r387483 = r387477 * r387482;
        double r387484 = r387481 - r387483;
        return r387484;
}

double f(double x, double y, double z) {
        double r387485 = x;
        double r387486 = z;
        double r387487 = r387485 - r387486;
        double r387488 = y;
        double r387489 = r387487 * r387488;
        return r387489;
}

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 2019347 +o rules:numerics
(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)))