Average Error: 13.3 → 0.0
Time: 28.6s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - z \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - z \cdot y
double f(double x, double y, double z) {
        double r17883371 = x;
        double r17883372 = y;
        double r17883373 = r17883371 * r17883372;
        double r17883374 = r17883372 * r17883372;
        double r17883375 = r17883373 - r17883374;
        double r17883376 = r17883375 + r17883374;
        double r17883377 = z;
        double r17883378 = r17883372 * r17883377;
        double r17883379 = r17883376 - r17883378;
        return r17883379;
}

double f(double x, double y, double z) {
        double r17883380 = y;
        double r17883381 = x;
        double r17883382 = r17883380 * r17883381;
        double r17883383 = z;
        double r17883384 = r17883383 * r17883380;
        double r17883385 = r17883382 - r17883384;
        return r17883385;
}

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 distribute-rgt-out--13.3

    \[\leadsto \left(\color{blue}{y \cdot \left(x - y\right)} + y \cdot y\right) - y \cdot z\]
  4. Applied distribute-lft-out9.2

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

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

    \[\leadsto y \cdot x - 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)))