Average Error: 22.6 → 18.9
Time: 18.0s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z} = -\infty:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z} \le 9.318271836675295 \cdot 10^{+307}:\\ \;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z} = -\infty:\\
\;\;\;\;x\\

\mathbf{elif}\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z} \le 9.318271836675295 \cdot 10^{+307}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + \left(b - y\right) \cdot z}\\

\mathbf{else}:\\
\;\;\;\;x\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r41592653 = x;
        double r41592654 = y;
        double r41592655 = r41592653 * r41592654;
        double r41592656 = z;
        double r41592657 = t;
        double r41592658 = a;
        double r41592659 = r41592657 - r41592658;
        double r41592660 = r41592656 * r41592659;
        double r41592661 = r41592655 + r41592660;
        double r41592662 = b;
        double r41592663 = r41592662 - r41592654;
        double r41592664 = r41592656 * r41592663;
        double r41592665 = r41592654 + r41592664;
        double r41592666 = r41592661 / r41592665;
        return r41592666;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r41592667 = z;
        double r41592668 = t;
        double r41592669 = a;
        double r41592670 = r41592668 - r41592669;
        double r41592671 = r41592667 * r41592670;
        double r41592672 = x;
        double r41592673 = y;
        double r41592674 = r41592672 * r41592673;
        double r41592675 = r41592671 + r41592674;
        double r41592676 = b;
        double r41592677 = r41592676 - r41592673;
        double r41592678 = r41592677 * r41592667;
        double r41592679 = r41592673 + r41592678;
        double r41592680 = r41592675 / r41592679;
        double r41592681 = -inf.0;
        bool r41592682 = r41592680 <= r41592681;
        double r41592683 = 9.318271836675295e+307;
        bool r41592684 = r41592680 <= r41592683;
        double r41592685 = r41592684 ? r41592680 : r41592672;
        double r41592686 = r41592682 ? r41592672 : r41592685;
        return r41592686;
}

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

Original22.6
Target17.4
Herbie18.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. Split input into 2 regimes
  2. if (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < -inf.0 or 9.318271836675295e+307 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))

    1. Initial program 61.3

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

      \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity61.3

      \[\leadsto \frac{1}{\frac{y + z \cdot \left(b - y\right)}{\color{blue}{1 \cdot \left(x \cdot y + z \cdot \left(t - a\right)\right)}}}\]
    6. Applied *-un-lft-identity61.3

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    8. Applied add-cube-cbrt61.3

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

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

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

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

      \[\leadsto 1 \cdot \color{blue}{x}\]

    if -inf.0 < (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))) < 9.318271836675295e+307

    1. Initial program 6.0

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

      \[\leadsto \color{blue}{\frac{1}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity6.2

      \[\leadsto \frac{1}{\frac{y + z \cdot \left(b - y\right)}{\color{blue}{1 \cdot \left(x \cdot y + z \cdot \left(t - a\right)\right)}}}\]
    6. Applied *-un-lft-identity6.2

      \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot \left(y + z \cdot \left(b - y\right)\right)}}{1 \cdot \left(x \cdot y + z \cdot \left(t - a\right)\right)}}\]
    7. Applied times-frac6.2

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}}\]
    8. Applied add-cube-cbrt6.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}\]
    9. Applied times-frac6.2

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

      \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{y + z \cdot \left(b - y\right)}{x \cdot y + z \cdot \left(t - a\right)}}\]
    11. Simplified6.0

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

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

Reproduce

herbie shell --seed 2019168 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"

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

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