Average Error: 18.2 → 0.0
Time: 12.2s
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 r19827517 = x;
        double r19827518 = y;
        double r19827519 = r19827517 * r19827518;
        double r19827520 = z;
        double r19827521 = r19827518 * r19827520;
        double r19827522 = r19827519 - r19827521;
        double r19827523 = r19827518 * r19827518;
        double r19827524 = r19827522 - r19827523;
        double r19827525 = r19827524 + r19827523;
        return r19827525;
}

double f(double x, double y, double z) {
        double r19827526 = z;
        double r19827527 = -r19827526;
        double r19827528 = y;
        double r19827529 = r19827527 * r19827528;
        double r19827530 = x;
        double r19827531 = r19827528 * r19827530;
        double r19827532 = r19827529 + r19827531;
        return r19827532;
}

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. 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)))