Average Error: 13.3 → 0.0
Time: 20.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r27003861 = x;
        double r27003862 = y;
        double r27003863 = r27003861 * r27003862;
        double r27003864 = r27003862 * r27003862;
        double r27003865 = r27003863 - r27003864;
        double r27003866 = r27003865 + r27003864;
        double r27003867 = z;
        double r27003868 = r27003862 * r27003867;
        double r27003869 = r27003866 - r27003868;
        return r27003869;
}

double f(double x, double y, double z) {
        double r27003870 = x;
        double r27003871 = z;
        double r27003872 = r27003870 - r27003871;
        double r27003873 = y;
        double r27003874 = r27003872 * r27003873;
        return r27003874;
}

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. 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 2019170 +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)))