Average Error: 13.0 → 0.0
Time: 20.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r590403 = x;
        double r590404 = y;
        double r590405 = r590403 * r590404;
        double r590406 = r590404 * r590404;
        double r590407 = r590405 - r590406;
        double r590408 = r590407 + r590406;
        double r590409 = z;
        double r590410 = r590404 * r590409;
        double r590411 = r590408 - r590410;
        return r590411;
}

double f(double x, double y, double z) {
        double r590412 = x;
        double r590413 = z;
        double r590414 = r590412 - r590413;
        double r590415 = y;
        double r590416 = r590414 * r590415;
        return r590416;
}

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}{\left(x - z\right) \cdot y}\]
  3. Final simplification0.0

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

Reproduce

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

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

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