Average Error: 13.4 → 0.0
Time: 28.1s
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 r19890448 = x;
        double r19890449 = y;
        double r19890450 = r19890448 * r19890449;
        double r19890451 = r19890449 * r19890449;
        double r19890452 = r19890450 - r19890451;
        double r19890453 = r19890452 + r19890451;
        double r19890454 = z;
        double r19890455 = r19890449 * r19890454;
        double r19890456 = r19890453 - r19890455;
        return r19890456;
}

double f(double x, double y, double z) {
        double r19890457 = x;
        double r19890458 = z;
        double r19890459 = r19890457 - r19890458;
        double r19890460 = y;
        double r19890461 = r19890459 * r19890460;
        return r19890461;
}

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

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

Derivation

  1. Initial program 13.4

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

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

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