Average Error: 17.8 → 0.0
Time: 20.5s
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 r593513 = x;
        double r593514 = y;
        double r593515 = r593513 * r593514;
        double r593516 = z;
        double r593517 = r593514 * r593516;
        double r593518 = r593515 - r593517;
        double r593519 = r593514 * r593514;
        double r593520 = r593518 - r593519;
        double r593521 = r593520 + r593519;
        return r593521;
}

double f(double x, double y, double z) {
        double r593522 = x;
        double r593523 = z;
        double r593524 = r593522 - r593523;
        double r593525 = y;
        double r593526 = r593524 * r593525;
        return r593526;
}

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

Derivation

  1. Initial program 17.8

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