Average Error: 17.3 → 0.0
Time: 7.4s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r11098690 = x;
        double r11098691 = y;
        double r11098692 = r11098690 * r11098691;
        double r11098693 = z;
        double r11098694 = r11098691 * r11098693;
        double r11098695 = r11098692 - r11098694;
        double r11098696 = r11098691 * r11098691;
        double r11098697 = r11098695 - r11098696;
        double r11098698 = r11098697 + r11098696;
        return r11098698;
}

double f(double x, double y, double z) {
        double r11098699 = x;
        double r11098700 = z;
        double r11098701 = r11098699 - r11098700;
        double r11098702 = y;
        double r11098703 = r11098701 * r11098702;
        return r11098703;
}

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

Original17.3
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 17.3

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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 2019163 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"

  :herbie-target
  (* (- x z) y)

  (+ (- (- (* x y) (* y z)) (* y y)) (* y y)))