Average Error: 23.5 → 20.4
Time: 17.6s
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 -9.946154013212846621570882266892232154703 \cdot 10^{242} \lor \neg \left(z \le 3.958492285666259474775847861824375366316 \cdot 10^{48}\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 -9.946154013212846621570882266892232154703 \cdot 10^{242} \lor \neg \left(z \le 3.958492285666259474775847861824375366316 \cdot 10^{48}\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 r630284 = x;
        double r630285 = y;
        double r630286 = r630284 * r630285;
        double r630287 = z;
        double r630288 = t;
        double r630289 = a;
        double r630290 = r630288 - r630289;
        double r630291 = r630287 * r630290;
        double r630292 = r630286 + r630291;
        double r630293 = b;
        double r630294 = r630293 - r630285;
        double r630295 = r630287 * r630294;
        double r630296 = r630285 + r630295;
        double r630297 = r630292 / r630296;
        return r630297;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r630298 = z;
        double r630299 = -9.946154013212847e+242;
        bool r630300 = r630298 <= r630299;
        double r630301 = 3.9584922856662595e+48;
        bool r630302 = r630298 <= r630301;
        double r630303 = !r630302;
        bool r630304 = r630300 || r630303;
        double r630305 = t;
        double r630306 = b;
        double r630307 = r630305 / r630306;
        double r630308 = a;
        double r630309 = r630308 / r630306;
        double r630310 = r630307 - r630309;
        double r630311 = r630305 - r630308;
        double r630312 = r630298 * r630311;
        double r630313 = x;
        double r630314 = y;
        double r630315 = r630313 * r630314;
        double r630316 = r630312 + r630315;
        double r630317 = 1.0;
        double r630318 = r630306 - r630314;
        double r630319 = r630298 * r630318;
        double r630320 = r630319 + r630314;
        double r630321 = r630317 / r630320;
        double r630322 = r630316 * r630321;
        double r630323 = r630304 ? r630310 : r630322;
        return r630323;
}

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.5
Target18.2
Herbie20.4
\[\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 < -9.946154013212847e+242 or 3.9584922856662595e+48 < z

    1. Initial program 46.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-num46.0

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

      \[\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 33.5

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

    if -9.946154013212847e+242 < z < 3.9584922856662595e+48

    1. Initial program 15.9

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

      \[\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. Simplified16.0

      \[\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 simplification20.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -9.946154013212846621570882266892232154703 \cdot 10^{242} \lor \neg \left(z \le 3.958492285666259474775847861824375366316 \cdot 10^{48}\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 2019195 
(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)))))