Average Error: 13.3 → 0.0
Time: 27.8s
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 r21674771 = x;
        double r21674772 = y;
        double r21674773 = r21674771 * r21674772;
        double r21674774 = r21674772 * r21674772;
        double r21674775 = r21674773 - r21674774;
        double r21674776 = r21674775 + r21674774;
        double r21674777 = z;
        double r21674778 = r21674772 * r21674777;
        double r21674779 = r21674776 - r21674778;
        return r21674779;
}

double f(double x, double y, double z) {
        double r21674780 = x;
        double r21674781 = z;
        double r21674782 = r21674780 - r21674781;
        double r21674783 = y;
        double r21674784 = r21674782 * r21674783;
        return r21674784;
}

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 2019168 +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)))