Average Error: 13.3 → 0.0
Time: 16.0s
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 r20661383 = x;
        double r20661384 = y;
        double r20661385 = r20661383 * r20661384;
        double r20661386 = r20661384 * r20661384;
        double r20661387 = r20661385 - r20661386;
        double r20661388 = r20661387 + r20661386;
        double r20661389 = z;
        double r20661390 = r20661384 * r20661389;
        double r20661391 = r20661388 - r20661390;
        return r20661391;
}

double f(double x, double y, double z) {
        double r20661392 = x;
        double r20661393 = y;
        double r20661394 = r20661392 * r20661393;
        double r20661395 = z;
        double r20661396 = r20661395 * r20661393;
        double r20661397 = r20661394 - r20661396;
        return r20661397;
}

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