Average Error: 17.8 → 0.0
Time: 1.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r584923 = x;
        double r584924 = y;
        double r584925 = r584923 * r584924;
        double r584926 = z;
        double r584927 = r584924 * r584926;
        double r584928 = r584925 - r584927;
        double r584929 = r584924 * r584924;
        double r584930 = r584928 - r584929;
        double r584931 = r584930 + r584929;
        return r584931;
}

double f(double x, double y, double z) {
        double r584932 = y;
        double r584933 = x;
        double r584934 = z;
        double r584935 = r584933 - r584934;
        double r584936 = r584932 * r584935;
        return r584936;
}

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

Derivation

  1. Initial program 17.8

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

    \[\leadsto y \cdot \left(x - z\right)\]

Reproduce

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