Average Error: 17.8 → 0.0
Time: 12.3s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r405873 = x;
        double r405874 = y;
        double r405875 = r405873 * r405874;
        double r405876 = r405874 * r405874;
        double r405877 = r405875 + r405876;
        double r405878 = z;
        double r405879 = r405874 * r405878;
        double r405880 = r405877 - r405879;
        double r405881 = r405880 - r405876;
        return r405881;
}

double f(double x, double y, double z) {
        double r405882 = x;
        double r405883 = z;
        double r405884 = r405882 - r405883;
        double r405885 = y;
        double r405886 = r405884 * r405885;
        return r405886;
}

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

Derivation

  1. Initial program 17.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. Final simplification0.0

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

Reproduce

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