Average Error: 13.0 → 0.0
Time: 23.0s
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 r21072175 = x;
        double r21072176 = y;
        double r21072177 = r21072175 * r21072176;
        double r21072178 = r21072176 * r21072176;
        double r21072179 = r21072177 - r21072178;
        double r21072180 = r21072179 + r21072178;
        double r21072181 = z;
        double r21072182 = r21072176 * r21072181;
        double r21072183 = r21072180 - r21072182;
        return r21072183;
}

double f(double x, double y, double z) {
        double r21072184 = x;
        double r21072185 = z;
        double r21072186 = r21072184 - r21072185;
        double r21072187 = y;
        double r21072188 = r21072186 * r21072187;
        return r21072188;
}

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

Derivation

  1. Initial program 13.0

    \[\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 2019192 +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)))