Average Error: 17.2 → 0.0
Time: 7.6s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r596678 = x;
        double r596679 = y;
        double r596680 = r596678 * r596679;
        double r596681 = z;
        double r596682 = r596679 * r596681;
        double r596683 = r596680 - r596682;
        double r596684 = r596679 * r596679;
        double r596685 = r596683 - r596684;
        double r596686 = r596685 + r596684;
        return r596686;
}

double f(double x, double y, double z) {
        double r596687 = y;
        double r596688 = x;
        double r596689 = z;
        double r596690 = r596688 - r596689;
        double r596691 = r596687 * r596690;
        return r596691;
}

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

Derivation

  1. Initial program 17.2

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

    \[\leadsto y \cdot \left(x - z\right)\]

Reproduce

herbie shell --seed 2020047 +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)))