Average Error: 17.3 → 0.0
Time: 7.6s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r19890631 = x;
        double r19890632 = y;
        double r19890633 = r19890631 * r19890632;
        double r19890634 = r19890632 * r19890632;
        double r19890635 = r19890633 + r19890634;
        double r19890636 = z;
        double r19890637 = r19890632 * r19890636;
        double r19890638 = r19890635 - r19890637;
        double r19890639 = r19890638 - r19890634;
        return r19890639;
}

double f(double x, double y, double z) {
        double r19890640 = x;
        double r19890641 = z;
        double r19890642 = r19890640 - r19890641;
        double r19890643 = y;
        double r19890644 = r19890642 * r19890643;
        return r19890644;
}

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

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

Derivation

  1. Initial program 17.3

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
  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, C"

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

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