Average Error: 12.9 → 0.0
Time: 22.7s
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 r486225 = x;
        double r486226 = y;
        double r486227 = r486225 * r486226;
        double r486228 = r486226 * r486226;
        double r486229 = r486227 - r486228;
        double r486230 = r486229 + r486228;
        double r486231 = z;
        double r486232 = r486226 * r486231;
        double r486233 = r486230 - r486232;
        return r486233;
}

double f(double x, double y, double z) {
        double r486234 = x;
        double r486235 = z;
        double r486236 = r486234 - r486235;
        double r486237 = y;
        double r486238 = r486236 * r486237;
        return r486238;
}

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

Original12.9
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.9

    \[\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 2019322 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"
  :precision binary64

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

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