Average Error: 12.9 → 0.0
Time: 22.7s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r288768 = x;
        double r288769 = y;
        double r288770 = r288768 * r288769;
        double r288771 = r288769 * r288769;
        double r288772 = r288770 - r288771;
        double r288773 = r288772 + r288771;
        double r288774 = z;
        double r288775 = r288769 * r288774;
        double r288776 = r288773 - r288775;
        return r288776;
}

double f(double x, double y, double z) {
        double r288777 = x;
        double r288778 = z;
        double r288779 = r288777 - r288778;
        double r288780 = y;
        double r288781 = r288779 * r288780;
        return r288781;
}

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

Original12.9
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.9

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

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

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