Average Error: 13.0 → 0.0
Time: 29.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r24971755 = x;
        double r24971756 = y;
        double r24971757 = r24971755 * r24971756;
        double r24971758 = r24971756 * r24971756;
        double r24971759 = r24971757 - r24971758;
        double r24971760 = r24971759 + r24971758;
        double r24971761 = z;
        double r24971762 = r24971756 * r24971761;
        double r24971763 = r24971760 - r24971762;
        return r24971763;
}

double f(double x, double y, double z) {
        double r24971764 = y;
        double r24971765 = z;
        double r24971766 = -r24971765;
        double r24971767 = r24971764 * r24971766;
        double r24971768 = x;
        double r24971769 = r24971768 * r24971764;
        double r24971770 = r24971767 + r24971769;
        return r24971770;
}

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}{y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{x \cdot y + \left(-z\right) \cdot y}\]
  6. Final simplification0.0

    \[\leadsto y \cdot \left(-z\right) + x \cdot y\]

Reproduce

herbie shell --seed 2019165 
(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)))