Average Error: 16.8 → 0.0
Time: 12.6s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(-z\right) \cdot y + y \cdot x\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(-z\right) \cdot y + y \cdot x
double f(double x, double y, double z) {
        double r19100834 = x;
        double r19100835 = y;
        double r19100836 = r19100834 * r19100835;
        double r19100837 = r19100835 * r19100835;
        double r19100838 = r19100836 + r19100837;
        double r19100839 = z;
        double r19100840 = r19100835 * r19100839;
        double r19100841 = r19100838 - r19100840;
        double r19100842 = r19100841 - r19100837;
        return r19100842;
}

double f(double x, double y, double z) {
        double r19100843 = z;
        double r19100844 = -r19100843;
        double r19100845 = y;
        double r19100846 = r19100844 * r19100845;
        double r19100847 = x;
        double r19100848 = r19100845 * r19100847;
        double r19100849 = r19100846 + r19100848;
        return r19100849;
}

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 y\right) - y \cdot z\right) - y \cdot y\]
  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-lft-in0.0

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

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

Reproduce

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