Average Error: 23.2 → 19.6
Time: 21.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}\;z \le -2.034080329997317996022135396100574836359 \cdot 10^{49} \lor \neg \left(z \le 3.954445955845695356594268852084466536392 \cdot 10^{76}\right):\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{z \cdot \left(b - y\right) + y}\\ \end{array}\]
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;z \le -2.034080329997317996022135396100574836359 \cdot 10^{49} \lor \neg \left(z \le 3.954445955845695356594268852084466536392 \cdot 10^{76}\right):\\
\;\;\;\;\frac{t}{b} - \frac{a}{b}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r688211 = x;
        double r688212 = y;
        double r688213 = r688211 * r688212;
        double r688214 = z;
        double r688215 = t;
        double r688216 = a;
        double r688217 = r688215 - r688216;
        double r688218 = r688214 * r688217;
        double r688219 = r688213 + r688218;
        double r688220 = b;
        double r688221 = r688220 - r688212;
        double r688222 = r688214 * r688221;
        double r688223 = r688212 + r688222;
        double r688224 = r688219 / r688223;
        return r688224;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r688225 = z;
        double r688226 = -2.034080329997318e+49;
        bool r688227 = r688225 <= r688226;
        double r688228 = 3.9544459558456954e+76;
        bool r688229 = r688225 <= r688228;
        double r688230 = !r688229;
        bool r688231 = r688227 || r688230;
        double r688232 = t;
        double r688233 = b;
        double r688234 = r688232 / r688233;
        double r688235 = a;
        double r688236 = r688235 / r688233;
        double r688237 = r688234 - r688236;
        double r688238 = r688232 - r688235;
        double r688239 = r688225 * r688238;
        double r688240 = x;
        double r688241 = y;
        double r688242 = r688240 * r688241;
        double r688243 = r688239 + r688242;
        double r688244 = 1.0;
        double r688245 = r688233 - r688241;
        double r688246 = r688225 * r688245;
        double r688247 = r688246 + r688241;
        double r688248 = r688244 / r688247;
        double r688249 = r688243 * r688248;
        double r688250 = r688231 ? r688237 : r688249;
        return r688250;
}

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.2
Target17.9
Herbie19.6
\[\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 z < -2.034080329997318e+49 or 3.9544459558456954e+76 < z

    1. Initial program 43.8

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

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

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

      \[\leadsto \color{blue}{\frac{t}{b} - \frac{a}{b}}\]

    if -2.034080329997318e+49 < z < 3.9544459558456954e+76

    1. Initial program 10.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.034080329997317996022135396100574836359 \cdot 10^{49} \lor \neg \left(z \le 3.954445955845695356594268852084466536392 \cdot 10^{76}\right):\\ \;\;\;\;\frac{t}{b} - \frac{a}{b}\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(t - a\right) + x \cdot y\right) \cdot \frac{1}{z \cdot \left(b - y\right) + y}\\ \end{array}\]

Reproduce

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