Average Error: 17.2 → 0.0
Time: 22.5s
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 r63503144 = x;
        double r63503145 = y;
        double r63503146 = r63503144 * r63503145;
        double r63503147 = z;
        double r63503148 = r63503145 * r63503147;
        double r63503149 = r63503146 - r63503148;
        double r63503150 = r63503145 * r63503145;
        double r63503151 = r63503149 - r63503150;
        double r63503152 = r63503151 + r63503150;
        return r63503152;
}

double f(double x, double y, double z) {
        double r63503153 = x;
        double r63503154 = z;
        double r63503155 = r63503153 - r63503154;
        double r63503156 = y;
        double r63503157 = r63503155 * r63503156;
        return r63503157;
}

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

Derivation

  1. Initial program 17.2

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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 2019173 +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)))