Average Error: 23.8 → 23.9
Time: 6.9s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{\mathsf{fma}\left(x, y, t \cdot z\right) + \left(-a\right) \cdot z}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\frac{\mathsf{fma}\left(x, y, t \cdot z\right) + \left(-a\right) \cdot z}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r864634 = x;
        double r864635 = y;
        double r864636 = r864634 * r864635;
        double r864637 = z;
        double r864638 = t;
        double r864639 = a;
        double r864640 = r864638 - r864639;
        double r864641 = r864637 * r864640;
        double r864642 = r864636 + r864641;
        double r864643 = b;
        double r864644 = r864643 - r864635;
        double r864645 = r864637 * r864644;
        double r864646 = r864635 + r864645;
        double r864647 = r864642 / r864646;
        return r864647;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r864648 = x;
        double r864649 = y;
        double r864650 = t;
        double r864651 = z;
        double r864652 = r864650 * r864651;
        double r864653 = fma(r864648, r864649, r864652);
        double r864654 = a;
        double r864655 = -r864654;
        double r864656 = r864655 * r864651;
        double r864657 = r864653 + r864656;
        double r864658 = b;
        double r864659 = r864651 * r864658;
        double r864660 = -r864649;
        double r864661 = r864651 * r864660;
        double r864662 = r864659 + r864661;
        double r864663 = r864649 + r864662;
        double r864664 = r864657 / r864663;
        return r864664;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original23.8
Target18.5
Herbie23.9
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}\]

Derivation

  1. Initial program 23.8

    \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
  2. Using strategy rm
  3. Applied sub-neg23.8

    \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t + \left(-a\right)\right)}}{y + z \cdot \left(b - y\right)}\]
  4. Applied distribute-rgt-in23.8

    \[\leadsto \frac{x \cdot y + \color{blue}{\left(t \cdot z + \left(-a\right) \cdot z\right)}}{y + z \cdot \left(b - y\right)}\]
  5. Applied associate-+r+23.8

    \[\leadsto \frac{\color{blue}{\left(x \cdot y + t \cdot z\right) + \left(-a\right) \cdot z}}{y + z \cdot \left(b - y\right)}\]
  6. Simplified23.8

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, y, t \cdot z\right)} + \left(-a\right) \cdot z}{y + z \cdot \left(b - y\right)}\]
  7. Using strategy rm
  8. Applied sub-neg23.8

    \[\leadsto \frac{\mathsf{fma}\left(x, y, t \cdot z\right) + \left(-a\right) \cdot z}{y + z \cdot \color{blue}{\left(b + \left(-y\right)\right)}}\]
  9. Applied distribute-lft-in23.9

    \[\leadsto \frac{\mathsf{fma}\left(x, y, t \cdot z\right) + \left(-a\right) \cdot z}{y + \color{blue}{\left(z \cdot b + z \cdot \left(-y\right)\right)}}\]
  10. Final simplification23.9

    \[\leadsto \frac{\mathsf{fma}\left(x, y, t \cdot z\right) + \left(-a\right) \cdot z}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}\]

Reproduce

herbie shell --seed 2020047 +o rules:numerics
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))