Average Error: 16.8 → 0.0
Time: 13.0s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z \cdot y\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z \cdot y\right) + x \cdot y
double f(double x, double y, double z) {
        double r24210069 = x;
        double r24210070 = y;
        double r24210071 = r24210069 * r24210070;
        double r24210072 = z;
        double r24210073 = r24210070 * r24210072;
        double r24210074 = r24210071 - r24210073;
        double r24210075 = r24210070 * r24210070;
        double r24210076 = r24210074 - r24210075;
        double r24210077 = r24210076 + r24210075;
        return r24210077;
}

double f(double x, double y, double z) {
        double r24210078 = z;
        double r24210079 = y;
        double r24210080 = r24210078 * r24210079;
        double r24210081 = -r24210080;
        double r24210082 = x;
        double r24210083 = r24210082 * r24210079;
        double r24210084 = r24210081 + r24210083;
        return r24210084;
}

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

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

Derivation

  1. Initial program 16.8

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied sub-neg16.8

    \[\leadsto \left(\color{blue}{\left(x \cdot y + \left(-y \cdot z\right)\right)} - y \cdot y\right) + y \cdot y\]
  4. Applied associate--l+16.8

    \[\leadsto \color{blue}{\left(x \cdot y + \left(\left(-y \cdot z\right) - y \cdot y\right)\right)} + y \cdot y\]
  5. Applied associate-+l+12.3

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

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

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

Reproduce

herbie shell --seed 2019169 +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)))