Average Error: 17.8 → 0.0
Time: 6.4s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z \cdot y\right) + y \cdot x\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z \cdot y\right) + y \cdot x
double f(double x, double y, double z) {
        double r338688 = x;
        double r338689 = y;
        double r338690 = r338688 * r338689;
        double r338691 = z;
        double r338692 = r338689 * r338691;
        double r338693 = r338690 - r338692;
        double r338694 = r338689 * r338689;
        double r338695 = r338693 - r338694;
        double r338696 = r338695 + r338694;
        return r338696;
}

double f(double x, double y, double z) {
        double r338697 = z;
        double r338698 = y;
        double r338699 = r338697 * r338698;
        double r338700 = -r338699;
        double r338701 = x;
        double r338702 = r338698 * r338701;
        double r338703 = r338700 + r338702;
        return r338703;
}

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

Derivation

  1. Initial program 17.8

    \[\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-lft-in0.0

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

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

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

Reproduce

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