Average Error: 17.5 → 0.0
Time: 19.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 r21603871 = x;
        double r21603872 = y;
        double r21603873 = r21603871 * r21603872;
        double r21603874 = r21603872 * r21603872;
        double r21603875 = r21603873 + r21603874;
        double r21603876 = z;
        double r21603877 = r21603872 * r21603876;
        double r21603878 = r21603875 - r21603877;
        double r21603879 = r21603878 - r21603874;
        return r21603879;
}

double f(double x, double y, double z) {
        double r21603880 = x;
        double r21603881 = z;
        double r21603882 = r21603880 - r21603881;
        double r21603883 = y;
        double r21603884 = r21603882 * r21603883;
        return r21603884;
}

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

Derivation

  1. Initial program 17.5

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