Average Error: 17.3 → 0.0
Time: 10.1s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r22011492 = x;
        double r22011493 = y;
        double r22011494 = r22011492 * r22011493;
        double r22011495 = r22011493 * r22011493;
        double r22011496 = r22011494 + r22011495;
        double r22011497 = z;
        double r22011498 = r22011493 * r22011497;
        double r22011499 = r22011496 - r22011498;
        double r22011500 = r22011499 - r22011495;
        return r22011500;
}

double f(double x, double y, double z) {
        double r22011501 = x;
        double r22011502 = z;
        double r22011503 = r22011501 - r22011502;
        double r22011504 = y;
        double r22011505 = r22011503 * r22011504;
        return r22011505;
}

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

Original17.3
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 17.3

    \[\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. 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, C"

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

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