Average Error: 17.5 → 0.0
Time: 12.1s
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 r11391211 = x;
        double r11391212 = y;
        double r11391213 = r11391211 * r11391212;
        double r11391214 = r11391212 * r11391212;
        double r11391215 = r11391213 + r11391214;
        double r11391216 = z;
        double r11391217 = r11391212 * r11391216;
        double r11391218 = r11391215 - r11391217;
        double r11391219 = r11391218 - r11391214;
        return r11391219;
}

double f(double x, double y, double z) {
        double r11391220 = x;
        double r11391221 = z;
        double r11391222 = r11391220 - r11391221;
        double r11391223 = y;
        double r11391224 = r11391222 * r11391223;
        return r11391224;
}

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

Derivation

  1. Initial program 17.5

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