Average Error: 17.2 → 0.0
Time: 20.8s
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 r25631314 = x;
        double r25631315 = y;
        double r25631316 = r25631314 * r25631315;
        double r25631317 = r25631315 * r25631315;
        double r25631318 = r25631316 + r25631317;
        double r25631319 = z;
        double r25631320 = r25631315 * r25631319;
        double r25631321 = r25631318 - r25631320;
        double r25631322 = r25631321 - r25631317;
        return r25631322;
}

double f(double x, double y, double z) {
        double r25631323 = x;
        double r25631324 = z;
        double r25631325 = r25631323 - r25631324;
        double r25631326 = y;
        double r25631327 = r25631325 * r25631326;
        return r25631327;
}

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

Derivation

  1. Initial program 17.2

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