Average Error: 17.9 → 0.0
Time: 1.4s
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 r504609 = x;
        double r504610 = y;
        double r504611 = r504609 * r504610;
        double r504612 = z;
        double r504613 = r504610 * r504612;
        double r504614 = r504611 - r504613;
        double r504615 = r504610 * r504610;
        double r504616 = r504614 - r504615;
        double r504617 = r504616 + r504615;
        return r504617;
}

double f(double x, double y, double z) {
        double r504618 = y;
        double r504619 = x;
        double r504620 = r504618 * r504619;
        double r504621 = z;
        double r504622 = -r504621;
        double r504623 = r504618 * r504622;
        double r504624 = r504620 + r504623;
        return r504624;
}

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

Derivation

  1. Initial program 17.9

    \[\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 2019354 +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)))