Average Error: 17.4 → 0.0
Time: 11.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r21661629 = x;
        double r21661630 = y;
        double r21661631 = r21661629 * r21661630;
        double r21661632 = z;
        double r21661633 = r21661630 * r21661632;
        double r21661634 = r21661631 - r21661633;
        double r21661635 = r21661630 * r21661630;
        double r21661636 = r21661634 - r21661635;
        double r21661637 = r21661636 + r21661635;
        return r21661637;
}

double f(double x, double y, double z) {
        double r21661638 = x;
        double r21661639 = z;
        double r21661640 = r21661638 - r21661639;
        double r21661641 = y;
        double r21661642 = r21661640 * r21661641;
        return r21661642;
}

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

Derivation

  1. Initial program 17.4

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"

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

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