Average Error: 12.5 → 0.0
Time: 17.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 r512324 = x;
        double r512325 = y;
        double r512326 = r512324 * r512325;
        double r512327 = r512325 * r512325;
        double r512328 = r512326 - r512327;
        double r512329 = r512328 + r512327;
        double r512330 = z;
        double r512331 = r512325 * r512330;
        double r512332 = r512329 - r512331;
        return r512332;
}

double f(double x, double y, double z) {
        double r512333 = x;
        double r512334 = z;
        double r512335 = r512333 - r512334;
        double r512336 = y;
        double r512337 = r512335 * r512336;
        return r512337;
}

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)))