Average Error: 17.3 → 0.0
Time: 9.6s
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 r20246558 = x;
        double r20246559 = y;
        double r20246560 = r20246558 * r20246559;
        double r20246561 = r20246559 * r20246559;
        double r20246562 = r20246560 + r20246561;
        double r20246563 = z;
        double r20246564 = r20246559 * r20246563;
        double r20246565 = r20246562 - r20246564;
        double r20246566 = r20246565 - r20246561;
        return r20246566;
}

double f(double x, double y, double z) {
        double r20246567 = x;
        double r20246568 = z;
        double r20246569 = r20246567 - r20246568;
        double r20246570 = y;
        double r20246571 = r20246569 * r20246570;
        return r20246571;
}

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)))