Average Error: 17.4 → 0.0
Time: 2.5s
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 r541287 = x;
        double r541288 = y;
        double r541289 = r541287 * r541288;
        double r541290 = r541288 * r541288;
        double r541291 = r541289 + r541290;
        double r541292 = z;
        double r541293 = r541288 * r541292;
        double r541294 = r541291 - r541293;
        double r541295 = r541294 - r541290;
        return r541295;
}

double f(double x, double y, double z) {
        double r541296 = x;
        double r541297 = z;
        double r541298 = r541296 - r541297;
        double r541299 = y;
        double r541300 = r541298 * r541299;
        return r541300;
}

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

Derivation

  1. Initial program 17.4

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied *-commutative0.0

    \[\leadsto \color{blue}{\left(x - z\right) \cdot y}\]
  5. Final simplification0.0

    \[\leadsto \left(x - z\right) \cdot y\]

Reproduce

herbie shell --seed 2020034 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"
  :precision binary64

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

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