Average Error: 17.4 → 0.0
Time: 10.2s
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 r306544 = x;
        double r306545 = y;
        double r306546 = r306544 * r306545;
        double r306547 = r306545 * r306545;
        double r306548 = r306546 + r306547;
        double r306549 = z;
        double r306550 = r306545 * r306549;
        double r306551 = r306548 - r306550;
        double r306552 = r306551 - r306547;
        return r306552;
}

double f(double x, double y, double z) {
        double r306553 = x;
        double r306554 = z;
        double r306555 = r306553 - r306554;
        double r306556 = y;
        double r306557 = r306555 * r306556;
        return r306557;
}

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

Derivation

  1. Initial program 17.4

    \[\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 2019174 +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)))