Average Error: 17.0 → 0.0
Time: 12.6s
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 r311447 = x;
        double r311448 = y;
        double r311449 = r311447 * r311448;
        double r311450 = z;
        double r311451 = r311448 * r311450;
        double r311452 = r311449 - r311451;
        double r311453 = r311448 * r311448;
        double r311454 = r311452 - r311453;
        double r311455 = r311454 + r311453;
        return r311455;
}

double f(double x, double y, double z) {
        double r311456 = y;
        double r311457 = x;
        double r311458 = r311456 * r311457;
        double r311459 = z;
        double r311460 = -r311459;
        double r311461 = r311456 * r311460;
        double r311462 = r311458 + r311461;
        return r311462;
}

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

Derivation

  1. Initial program 17.0

    \[\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 2019323 
(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)))