Average Error: 17.0 → 0.0
Time: 17.9s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r297871 = x;
        double r297872 = y;
        double r297873 = r297871 * r297872;
        double r297874 = z;
        double r297875 = r297872 * r297874;
        double r297876 = r297873 - r297875;
        double r297877 = r297872 * r297872;
        double r297878 = r297876 - r297877;
        double r297879 = r297878 + r297877;
        return r297879;
}

double f(double x, double y, double z) {
        double r297880 = x;
        double r297881 = z;
        double r297882 = r297880 - r297881;
        double r297883 = y;
        double r297884 = r297882 * r297883;
        return r297884;
}

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

Derivation

  1. Initial program 17.0

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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 2019323 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

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

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