Average Error: 17.0 → 0.0
Time: 17.3s
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 r289759 = x;
        double r289760 = y;
        double r289761 = r289759 * r289760;
        double r289762 = z;
        double r289763 = r289760 * r289762;
        double r289764 = r289761 - r289763;
        double r289765 = r289760 * r289760;
        double r289766 = r289764 - r289765;
        double r289767 = r289766 + r289765;
        return r289767;
}

double f(double x, double y, double z) {
        double r289768 = x;
        double r289769 = z;
        double r289770 = r289768 - r289769;
        double r289771 = y;
        double r289772 = r289770 * r289771;
        return r289772;
}

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