Average Error: 12.8 → 0.0
Time: 30.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 r310785 = x;
        double r310786 = y;
        double r310787 = r310785 * r310786;
        double r310788 = r310786 * r310786;
        double r310789 = r310787 - r310788;
        double r310790 = r310789 + r310788;
        double r310791 = z;
        double r310792 = r310786 * r310791;
        double r310793 = r310790 - r310792;
        return r310793;
}

double f(double x, double y, double z) {
        double r310794 = x;
        double r310795 = z;
        double r310796 = r310794 - r310795;
        double r310797 = y;
        double r310798 = r310796 * r310797;
        return r310798;
}

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