Average Error: 12.6 → 0.0
Time: 22.4s
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 r388240 = x;
        double r388241 = y;
        double r388242 = r388240 * r388241;
        double r388243 = r388241 * r388241;
        double r388244 = r388242 - r388243;
        double r388245 = r388244 + r388243;
        double r388246 = z;
        double r388247 = r388241 * r388246;
        double r388248 = r388245 - r388247;
        return r388248;
}

double f(double x, double y, double z) {
        double r388249 = x;
        double r388250 = z;
        double r388251 = r388249 - r388250;
        double r388252 = y;
        double r388253 = r388251 * r388252;
        return r388253;
}

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

Derivation

  1. Initial program 12.6

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