Average Error: 13.0 → 0.0
Time: 39.5s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[x \cdot y + y \cdot \left(-z\right)\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
x \cdot y + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r369389 = x;
        double r369390 = y;
        double r369391 = r369389 * r369390;
        double r369392 = r369390 * r369390;
        double r369393 = r369391 - r369392;
        double r369394 = r369393 + r369392;
        double r369395 = z;
        double r369396 = r369390 * r369395;
        double r369397 = r369394 - r369396;
        return r369397;
}

double f(double x, double y, double z) {
        double r369398 = x;
        double r369399 = y;
        double r369400 = r369398 * r369399;
        double r369401 = z;
        double r369402 = -r369401;
        double r369403 = r369399 * r369402;
        double r369404 = r369400 + r369403;
        return r369404;
}

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

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

Derivation

  1. Initial program 13.0

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

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

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

Reproduce

herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"

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

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