Average Error: 17.1 → 0.0
Time: 16.1s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r387360 = x;
        double r387361 = y;
        double r387362 = r387360 * r387361;
        double r387363 = r387361 * r387361;
        double r387364 = r387362 + r387363;
        double r387365 = z;
        double r387366 = r387361 * r387365;
        double r387367 = r387364 - r387366;
        double r387368 = r387367 - r387363;
        return r387368;
}

double f(double x, double y, double z) {
        double r387369 = x;
        double r387370 = z;
        double r387371 = r387369 - r387370;
        double r387372 = y;
        double r387373 = r387371 * r387372;
        return r387373;
}

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

Derivation

  1. Initial program 17.1

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

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

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