Average Error: 18.2 → 0.0
Time: 10.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z\right) \cdot y + y \cdot x\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z\right) \cdot y + y \cdot x
double f(double x, double y, double z) {
        double r391770 = x;
        double r391771 = y;
        double r391772 = r391770 * r391771;
        double r391773 = z;
        double r391774 = r391771 * r391773;
        double r391775 = r391772 - r391774;
        double r391776 = r391771 * r391771;
        double r391777 = r391775 - r391776;
        double r391778 = r391777 + r391776;
        return r391778;
}

double f(double x, double y, double z) {
        double r391779 = z;
        double r391780 = -r391779;
        double r391781 = y;
        double r391782 = r391780 * r391781;
        double r391783 = x;
        double r391784 = r391781 * r391783;
        double r391785 = r391782 + r391784;
        return r391785;
}

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

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

Derivation

  1. Initial program 18.2

    \[\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\right) \cdot z}\]
  7. Final simplification0.0

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

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(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)))