Average Error: 17.9 → 0.0
Time: 20.6s
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 r26626736 = x;
        double r26626737 = y;
        double r26626738 = r26626736 * r26626737;
        double r26626739 = z;
        double r26626740 = r26626737 * r26626739;
        double r26626741 = r26626738 - r26626740;
        double r26626742 = r26626737 * r26626737;
        double r26626743 = r26626741 - r26626742;
        double r26626744 = r26626743 + r26626742;
        return r26626744;
}

double f(double x, double y, double z) {
        double r26626745 = x;
        double r26626746 = z;
        double r26626747 = r26626745 - r26626746;
        double r26626748 = y;
        double r26626749 = r26626747 * r26626748;
        return r26626749;
}

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

Derivation

  1. Initial program 17.9

    \[\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 2019170 +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)))