Average Error: 12.6 → 0.0
Time: 15.5s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - y \cdot z\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - y \cdot z
double f(double x, double y, double z) {
        double r458434 = x;
        double r458435 = y;
        double r458436 = r458434 * r458435;
        double r458437 = r458435 * r458435;
        double r458438 = r458436 - r458437;
        double r458439 = r458438 + r458437;
        double r458440 = z;
        double r458441 = r458435 * r458440;
        double r458442 = r458439 - r458441;
        return r458442;
}

double f(double x, double y, double z) {
        double r458443 = y;
        double r458444 = x;
        double r458445 = r458443 * r458444;
        double r458446 = z;
        double r458447 = r458443 * r458446;
        double r458448 = r458445 - r458447;
        return r458448;
}

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

Derivation

  1. Initial program 12.6

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Using strategy rm
  3. Applied sub-neg12.6

    \[\leadsto \left(\color{blue}{\left(x \cdot y + \left(-y \cdot y\right)\right)} + y \cdot y\right) - y \cdot z\]
  4. Applied associate-+l+7.5

    \[\leadsto \color{blue}{\left(x \cdot y + \left(\left(-y \cdot y\right) + y \cdot y\right)\right)} - y \cdot z\]
  5. Simplified0.0

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

    \[\leadsto y \cdot x - y \cdot z\]

Reproduce

herbie shell --seed 2019208 
(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)))