Average Error: 23.8 → 23.0
Time: 5.5s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;y \le 1.0603207769061204 \cdot 10^{169}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot z + x\right) - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;y \le 1.0603207769061204 \cdot 10^{169}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot z + x\right) - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r775679 = x;
        double r775680 = y;
        double r775681 = r775679 * r775680;
        double r775682 = z;
        double r775683 = t;
        double r775684 = a;
        double r775685 = r775683 - r775684;
        double r775686 = r775682 * r775685;
        double r775687 = r775681 + r775686;
        double r775688 = b;
        double r775689 = r775688 - r775680;
        double r775690 = r775682 * r775689;
        double r775691 = r775680 + r775690;
        double r775692 = r775687 / r775691;
        return r775692;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r775693 = y;
        double r775694 = 1.0603207769061204e+169;
        bool r775695 = r775693 <= r775694;
        double r775696 = x;
        double r775697 = r775696 * r775693;
        double r775698 = z;
        double r775699 = t;
        double r775700 = a;
        double r775701 = r775699 - r775700;
        double r775702 = r775698 * r775701;
        double r775703 = r775697 + r775702;
        double r775704 = b;
        double r775705 = r775698 * r775704;
        double r775706 = -r775693;
        double r775707 = r775698 * r775706;
        double r775708 = r775705 + r775707;
        double r775709 = r775693 + r775708;
        double r775710 = r775703 / r775709;
        double r775711 = r775696 * r775698;
        double r775712 = r775711 + r775696;
        double r775713 = r775698 * r775700;
        double r775714 = r775704 - r775693;
        double r775715 = r775698 * r775714;
        double r775716 = r775693 + r775715;
        double r775717 = r775713 / r775716;
        double r775718 = r775712 - r775717;
        double r775719 = r775695 ? r775710 : r775718;
        return r775719;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original23.8
Target18.5
Herbie23.0
\[\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. Split input into 2 regimes
  2. if y < 1.0603207769061204e+169

    1. Initial program 21.6

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

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

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

    if 1.0603207769061204e+169 < y

    1. Initial program 40.3

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

      \[\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-lft-in40.3

      \[\leadsto \frac{x \cdot y + \color{blue}{\left(z \cdot t + z \cdot \left(-a\right)\right)}}{y + z \cdot \left(b - y\right)}\]
    5. Using strategy rm
    6. Applied distribute-rgt-neg-out40.3

      \[\leadsto \frac{x \cdot y + \left(z \cdot t + \color{blue}{\left(-z \cdot a\right)}\right)}{y + z \cdot \left(b - y\right)}\]
    7. Applied unsub-neg40.3

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

      \[\leadsto \frac{\color{blue}{\left(x \cdot y + z \cdot t\right) - z \cdot a}}{y + z \cdot \left(b - y\right)}\]
    9. Applied div-sub40.3

      \[\leadsto \color{blue}{\frac{x \cdot y + z \cdot t}{y + z \cdot \left(b - y\right)} - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}}\]
    10. Simplified40.3

      \[\leadsto \color{blue}{\frac{t \cdot z + x \cdot y}{y + z \cdot \left(b - y\right)}} - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}\]
    11. Taylor expanded around 0 33.3

      \[\leadsto \color{blue}{\left(x \cdot z + x\right)} - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 1.0603207769061204 \cdot 10^{169}:\\ \;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + \left(z \cdot b + z \cdot \left(-y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot z + x\right) - \frac{z \cdot a}{y + z \cdot \left(b - y\right)}\\ \end{array}\]

Reproduce

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