Average Error: 17.2 → 0.0
Time: 17.8s
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 r19759510 = x;
        double r19759511 = y;
        double r19759512 = r19759510 * r19759511;
        double r19759513 = z;
        double r19759514 = r19759511 * r19759513;
        double r19759515 = r19759512 - r19759514;
        double r19759516 = r19759511 * r19759511;
        double r19759517 = r19759515 - r19759516;
        double r19759518 = r19759517 + r19759516;
        return r19759518;
}

double f(double x, double y, double z) {
        double r19759519 = x;
        double r19759520 = z;
        double r19759521 = r19759519 - r19759520;
        double r19759522 = y;
        double r19759523 = r19759521 * r19759522;
        return r19759523;
}

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