Average Error: 18.0 → 0.0
Time: 19.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 r569397 = x;
        double r569398 = y;
        double r569399 = r569397 * r569398;
        double r569400 = z;
        double r569401 = r569398 * r569400;
        double r569402 = r569399 - r569401;
        double r569403 = r569398 * r569398;
        double r569404 = r569402 - r569403;
        double r569405 = r569404 + r569403;
        return r569405;
}

double f(double x, double y, double z) {
        double r569406 = x;
        double r569407 = z;
        double r569408 = r569406 - r569407;
        double r569409 = y;
        double r569410 = r569408 * r569409;
        return r569410;
}

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

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

Derivation

  1. Initial program 18.0

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