Average Error: 17.9 → 0.0
Time: 15.0s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r24092436 = x;
        double r24092437 = y;
        double r24092438 = r24092436 * r24092437;
        double r24092439 = z;
        double r24092440 = r24092437 * r24092439;
        double r24092441 = r24092438 - r24092440;
        double r24092442 = r24092437 * r24092437;
        double r24092443 = r24092441 - r24092442;
        double r24092444 = r24092443 + r24092442;
        return r24092444;
}

double f(double x, double y, double z) {
        double r24092445 = y;
        double r24092446 = z;
        double r24092447 = -r24092446;
        double r24092448 = r24092445 * r24092447;
        double r24092449 = x;
        double r24092450 = r24092449 * r24092445;
        double r24092451 = r24092448 + r24092450;
        return r24092451;
}

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

Derivation

  1. Initial program 17.9

    \[\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 sub-neg0.0

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

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

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

Reproduce

herbie shell --seed 2019170 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"

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

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