Average Error: 13.4 → 0.0
Time: 18.5s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - y \cdot z\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - y \cdot z
double f(double x, double y, double z) {
        double r437702 = x;
        double r437703 = y;
        double r437704 = r437702 * r437703;
        double r437705 = r437703 * r437703;
        double r437706 = r437704 - r437705;
        double r437707 = r437706 + r437705;
        double r437708 = z;
        double r437709 = r437703 * r437708;
        double r437710 = r437707 - r437709;
        return r437710;
}

double f(double x, double y, double z) {
        double r437711 = y;
        double r437712 = x;
        double r437713 = r437711 * r437712;
        double r437714 = z;
        double r437715 = r437711 * r437714;
        double r437716 = r437713 - r437715;
        return r437716;
}

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. Using strategy rm
  3. Applied distribute-rgt-out--13.4

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

    \[\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 - y \cdot z\]

Reproduce

herbie shell --seed 2019325 
(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)))