Average Error: 12.7 → 0.0
Time: 25.5s
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 r31358646 = x;
        double r31358647 = y;
        double r31358648 = r31358646 * r31358647;
        double r31358649 = r31358647 * r31358647;
        double r31358650 = r31358648 - r31358649;
        double r31358651 = r31358650 + r31358649;
        double r31358652 = z;
        double r31358653 = r31358647 * r31358652;
        double r31358654 = r31358651 - r31358653;
        return r31358654;
}

double f(double x, double y, double z) {
        double r31358655 = x;
        double r31358656 = z;
        double r31358657 = r31358655 - r31358656;
        double r31358658 = y;
        double r31358659 = r31358657 * r31358658;
        return r31358659;
}

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)))