Average Error: 13.3 → 0.0
Time: 15.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[x \cdot y - z \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
x \cdot y - z \cdot y
double f(double x, double y, double z) {
        double r21509351 = x;
        double r21509352 = y;
        double r21509353 = r21509351 * r21509352;
        double r21509354 = r21509352 * r21509352;
        double r21509355 = r21509353 - r21509354;
        double r21509356 = r21509355 + r21509354;
        double r21509357 = z;
        double r21509358 = r21509352 * r21509357;
        double r21509359 = r21509356 - r21509358;
        return r21509359;
}

double f(double x, double y, double z) {
        double r21509360 = x;
        double r21509361 = y;
        double r21509362 = r21509360 * r21509361;
        double r21509363 = z;
        double r21509364 = r21509363 * r21509361;
        double r21509365 = r21509362 - r21509364;
        return r21509365;
}

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

Derivation

  1. Initial program 13.3

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Using strategy rm
  3. Applied associate-+l-8.1

    \[\leadsto \color{blue}{\left(x \cdot y - \left(y \cdot y - y \cdot y\right)\right)} - y \cdot z\]
  4. Applied associate--l-8.1

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

    \[\leadsto x \cdot y - \color{blue}{y \cdot z}\]
  6. Final simplification0.0

    \[\leadsto x \cdot y - z \cdot y\]

Reproduce

herbie shell --seed 2019172 +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)))