Average Error: 17.5 → 0.0
Time: 18.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 r204648 = x;
        double r204649 = y;
        double r204650 = r204648 * r204649;
        double r204651 = r204649 * r204649;
        double r204652 = r204650 + r204651;
        double r204653 = z;
        double r204654 = r204649 * r204653;
        double r204655 = r204652 - r204654;
        double r204656 = r204655 - r204651;
        return r204656;
}

double f(double x, double y, double z) {
        double r204657 = x;
        double r204658 = z;
        double r204659 = r204657 - r204658;
        double r204660 = y;
        double r204661 = r204659 * r204660;
        return r204661;
}

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}{\left(x - z\right) \cdot y}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"
  :precision binary64

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

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