Average Error: 23.5 → 23.8
Time: 21.3s
Precision: 64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.547496213171079846871835585417733344864 \cdot 10^{247}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \left(b - y\right) + y} \cdot \left(y \cdot x + \left(t - a\right) \cdot z\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}\;x \le -4.547496213171079846871835585417733344864 \cdot 10^{247}:\\
\;\;\;\;x\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r34953218 = x;
        double r34953219 = y;
        double r34953220 = r34953218 * r34953219;
        double r34953221 = z;
        double r34953222 = t;
        double r34953223 = a;
        double r34953224 = r34953222 - r34953223;
        double r34953225 = r34953221 * r34953224;
        double r34953226 = r34953220 + r34953225;
        double r34953227 = b;
        double r34953228 = r34953227 - r34953219;
        double r34953229 = r34953221 * r34953228;
        double r34953230 = r34953219 + r34953229;
        double r34953231 = r34953226 / r34953230;
        return r34953231;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r34953232 = x;
        double r34953233 = -4.54749621317108e+247;
        bool r34953234 = r34953232 <= r34953233;
        double r34953235 = 1.0;
        double r34953236 = z;
        double r34953237 = b;
        double r34953238 = y;
        double r34953239 = r34953237 - r34953238;
        double r34953240 = r34953236 * r34953239;
        double r34953241 = r34953240 + r34953238;
        double r34953242 = r34953235 / r34953241;
        double r34953243 = r34953238 * r34953232;
        double r34953244 = t;
        double r34953245 = a;
        double r34953246 = r34953244 - r34953245;
        double r34953247 = r34953246 * r34953236;
        double r34953248 = r34953243 + r34953247;
        double r34953249 = r34953242 * r34953248;
        double r34953250 = r34953234 ? r34953232 : r34953249;
        return r34953250;
}

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.1
Herbie23.8
\[\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 < -4.54749621317108e+247

    1. Initial program 37.3

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

      \[\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. Using strategy rm
    5. Applied associate-*r/37.3

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

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

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

    if -4.54749621317108e+247 < x

    1. Initial program 22.7

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

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

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

Reproduce

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