Average Error: 17.8 → 0.0
Time: 1.7s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r490441 = x;
        double r490442 = y;
        double r490443 = r490441 * r490442;
        double r490444 = z;
        double r490445 = r490442 * r490444;
        double r490446 = r490443 - r490445;
        double r490447 = r490442 * r490442;
        double r490448 = r490446 - r490447;
        double r490449 = r490448 + r490447;
        return r490449;
}

double f(double x, double y, double z) {
        double r490450 = y;
        double r490451 = x;
        double r490452 = z;
        double r490453 = r490451 - r490452;
        double r490454 = r490450 * r490453;
        return r490454;
}

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 z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2020018 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (* (- x z) y)

  (+ (- (- (* x y) (* y z)) (* y y)) (* y y)))