Average Error: 12.7 → 0.0
Time: 24.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r21848457 = x;
        double r21848458 = y;
        double r21848459 = r21848457 * r21848458;
        double r21848460 = r21848458 * r21848458;
        double r21848461 = r21848459 - r21848460;
        double r21848462 = r21848461 + r21848460;
        double r21848463 = z;
        double r21848464 = r21848458 * r21848463;
        double r21848465 = r21848462 - r21848464;
        return r21848465;
}

double f(double x, double y, double z) {
        double r21848466 = x;
        double r21848467 = z;
        double r21848468 = r21848466 - r21848467;
        double r21848469 = y;
        double r21848470 = r21848468 * r21848469;
        return r21848470;
}

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

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

Derivation

  1. Initial program 12.7

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  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 2019174 +o rules:numerics
(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)))