Average Error: 12.5 → 0.0
Time: 18.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r348280 = x;
        double r348281 = y;
        double r348282 = r348280 * r348281;
        double r348283 = r348281 * r348281;
        double r348284 = r348282 - r348283;
        double r348285 = r348284 + r348283;
        double r348286 = z;
        double r348287 = r348281 * r348286;
        double r348288 = r348285 - r348287;
        return r348288;
}

double f(double x, double y, double z) {
        double r348289 = x;
        double r348290 = z;
        double r348291 = r348289 - r348290;
        double r348292 = y;
        double r348293 = r348291 * r348292;
        return r348293;
}

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

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

Derivation

  1. Initial program 12.5

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

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

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