Average Error: 17.7 → 0.0
Time: 16.6s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[x \cdot y - y \cdot z\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
x \cdot y - y \cdot z
double f(double x, double y, double z) {
        double r400930 = x;
        double r400931 = y;
        double r400932 = r400930 * r400931;
        double r400933 = z;
        double r400934 = r400931 * r400933;
        double r400935 = r400932 - r400934;
        double r400936 = r400931 * r400931;
        double r400937 = r400935 - r400936;
        double r400938 = r400937 + r400936;
        return r400938;
}

double f(double x, double y, double z) {
        double r400939 = x;
        double r400940 = y;
        double r400941 = r400939 * r400940;
        double r400942 = z;
        double r400943 = r400940 * r400942;
        double r400944 = r400941 - r400943;
        return r400944;
}

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

Derivation

  1. Initial program 17.7

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied sub-neg17.7

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

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

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

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

Reproduce

herbie shell --seed 2019212 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

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

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