Average Error: 23.8 → 23.0
Time: 10.8s
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 r828510 = x;
        double r828511 = y;
        double r828512 = r828510 * r828511;
        double r828513 = z;
        double r828514 = t;
        double r828515 = a;
        double r828516 = r828514 - r828515;
        double r828517 = r828513 * r828516;
        double r828518 = r828512 + r828517;
        double r828519 = b;
        double r828520 = r828519 - r828511;
        double r828521 = r828513 * r828520;
        double r828522 = r828511 + r828521;
        double r828523 = r828518 / r828522;
        return r828523;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r828524 = y;
        double r828525 = 1.0603207769061204e+169;
        bool r828526 = r828524 <= r828525;
        double r828527 = x;
        double r828528 = r828527 * r828524;
        double r828529 = z;
        double r828530 = t;
        double r828531 = a;
        double r828532 = r828530 - r828531;
        double r828533 = r828529 * r828532;
        double r828534 = r828528 + r828533;
        double r828535 = b;
        double r828536 = r828529 * r828535;
        double r828537 = -r828524;
        double r828538 = r828529 * r828537;
        double r828539 = r828536 + r828538;
        double r828540 = r828524 + r828539;
        double r828541 = r828534 / r828540;
        double r828542 = r828527 * r828529;
        double r828543 = r828542 + r828527;
        double r828544 = r828529 * r828531;
        double r828545 = r828535 - r828524;
        double r828546 = r828529 * r828545;
        double r828547 = r828524 + r828546;
        double r828548 = r828544 / r828547;
        double r828549 = r828543 - r828548;
        double r828550 = r828526 ? r828541 : r828549;
        return r828550;
}

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. Applied associate-+r+40.3

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

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

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

      \[\leadsto \frac{\color{blue}{\left(t \cdot z + x \cdot y\right) - z \cdot a}}{y + z \cdot \left(b - y\right)}\]
    10. Applied div-sub40.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)))))