Average Error: 12.8 → 0.0
Time: 6.6s
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 r22309114 = x;
        double r22309115 = y;
        double r22309116 = r22309114 * r22309115;
        double r22309117 = r22309115 * r22309115;
        double r22309118 = r22309116 - r22309117;
        double r22309119 = r22309118 + r22309117;
        double r22309120 = z;
        double r22309121 = r22309115 * r22309120;
        double r22309122 = r22309119 - r22309121;
        return r22309122;
}

double f(double x, double y, double z) {
        double r22309123 = x;
        double r22309124 = z;
        double r22309125 = r22309123 - r22309124;
        double r22309126 = y;
        double r22309127 = r22309125 * r22309126;
        return r22309127;
}

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

Derivation

  1. Initial program 12.8

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