Average Error: 18.2 → 0.0
Time: 24.3s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[x \cdot y + y \cdot \left(-z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
x \cdot y + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r277500 = x;
        double r277501 = y;
        double r277502 = r277500 * r277501;
        double r277503 = z;
        double r277504 = r277501 * r277503;
        double r277505 = r277502 - r277504;
        double r277506 = r277501 * r277501;
        double r277507 = r277505 - r277506;
        double r277508 = r277507 + r277506;
        return r277508;
}

double f(double x, double y, double z) {
        double r277509 = x;
        double r277510 = y;
        double r277511 = r277509 * r277510;
        double r277512 = z;
        double r277513 = -r277512;
        double r277514 = r277510 * r277513;
        double r277515 = r277511 + r277514;
        return r277515;
}

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

Original18.2
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 18.2

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied sub-neg18.2

    \[\leadsto \left(\color{blue}{\left(x \cdot y + \left(-y \cdot z\right)\right)} - y \cdot y\right) + y \cdot y\]
  4. Applied associate--l+18.2

    \[\leadsto \color{blue}{\left(x \cdot y + \left(\left(-y \cdot z\right) - y \cdot y\right)\right)} + y \cdot y\]
  5. Applied associate-+l+13.4

    \[\leadsto \color{blue}{x \cdot y + \left(\left(\left(-y \cdot z\right) - y \cdot y\right) + y \cdot y\right)}\]
  6. Simplified0.0

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

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

Reproduce

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