Average Error: 18.1 → 0.0
Time: 1.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot x + y \cdot \left(-z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot x + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r509470 = x;
        double r509471 = y;
        double r509472 = r509470 * r509471;
        double r509473 = z;
        double r509474 = r509471 * r509473;
        double r509475 = r509472 - r509474;
        double r509476 = r509471 * r509471;
        double r509477 = r509475 - r509476;
        double r509478 = r509477 + r509476;
        return r509478;
}

double f(double x, double y, double z) {
        double r509479 = y;
        double r509480 = x;
        double r509481 = r509479 * r509480;
        double r509482 = z;
        double r509483 = -r509482;
        double r509484 = r509479 * r509483;
        double r509485 = r509481 + r509484;
        return r509485;
}

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

Derivation

  1. Initial program 18.1

    \[\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. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-lft-in0.0

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

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

Reproduce

herbie shell --seed 2020049 
(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)))