Average Error: 17.4 → 0.0
Time: 2.4s
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 r512425 = x;
        double r512426 = y;
        double r512427 = r512425 * r512426;
        double r512428 = z;
        double r512429 = r512426 * r512428;
        double r512430 = r512427 - r512429;
        double r512431 = r512426 * r512426;
        double r512432 = r512430 - r512431;
        double r512433 = r512432 + r512431;
        return r512433;
}

double f(double x, double y, double z) {
        double r512434 = x;
        double r512435 = z;
        double r512436 = r512434 - r512435;
        double r512437 = y;
        double r512438 = r512436 * r512437;
        return r512438;
}

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

Derivation

  1. Initial program 17.4

    \[\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. Using strategy rm
  4. Applied *-commutative0.0

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

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

Reproduce

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