Average Error: 17.5 → 0.0
Time: 16.0s
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 r23073462 = x;
        double r23073463 = y;
        double r23073464 = r23073462 * r23073463;
        double r23073465 = z;
        double r23073466 = r23073463 * r23073465;
        double r23073467 = r23073464 - r23073466;
        double r23073468 = r23073463 * r23073463;
        double r23073469 = r23073467 - r23073468;
        double r23073470 = r23073469 + r23073468;
        return r23073470;
}

double f(double x, double y, double z) {
        double r23073471 = x;
        double r23073472 = z;
        double r23073473 = r23073471 - r23073472;
        double r23073474 = y;
        double r23073475 = r23073473 * r23073474;
        return r23073475;
}

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

Derivation

  1. Initial program 17.5

    \[\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 2019168 +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)))