Average Error: 17.2 → 0.0
Time: 22.7s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r335411 = x;
        double r335412 = y;
        double r335413 = r335411 * r335412;
        double r335414 = z;
        double r335415 = r335412 * r335414;
        double r335416 = r335413 - r335415;
        double r335417 = r335412 * r335412;
        double r335418 = r335416 - r335417;
        double r335419 = r335418 + r335417;
        return r335419;
}

double f(double x, double y, double z) {
        double r335420 = x;
        double r335421 = z;
        double r335422 = r335420 - r335421;
        double r335423 = y;
        double r335424 = r335422 * r335423;
        return r335424;
}

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

Derivation

  1. Initial program 17.2

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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 2019304 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

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

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