Average Error: 23.5 → 17.9
Time: 16.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}\;y \le -2.576408966775929576086951387961284171012 \cdot 10^{205}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot z + x \cdot y}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(\frac{y}{z} + b\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}\;y \le -2.576408966775929576086951387961284171012 \cdot 10^{205}:\\
\;\;\;\;x\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r594253 = x;
        double r594254 = y;
        double r594255 = r594253 * r594254;
        double r594256 = z;
        double r594257 = t;
        double r594258 = a;
        double r594259 = r594257 - r594258;
        double r594260 = r594256 * r594259;
        double r594261 = r594255 + r594260;
        double r594262 = b;
        double r594263 = r594262 - r594254;
        double r594264 = r594256 * r594263;
        double r594265 = r594254 + r594264;
        double r594266 = r594261 / r594265;
        return r594266;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r594267 = y;
        double r594268 = -2.5764089667759296e+205;
        bool r594269 = r594267 <= r594268;
        double r594270 = x;
        double r594271 = t;
        double r594272 = z;
        double r594273 = r594271 * r594272;
        double r594274 = r594270 * r594267;
        double r594275 = r594273 + r594274;
        double r594276 = b;
        double r594277 = r594276 - r594267;
        double r594278 = r594272 * r594277;
        double r594279 = r594267 + r594278;
        double r594280 = r594275 / r594279;
        double r594281 = a;
        double r594282 = r594267 / r594272;
        double r594283 = r594282 + r594276;
        double r594284 = r594283 - r594267;
        double r594285 = r594281 / r594284;
        double r594286 = r594280 - r594285;
        double r594287 = r594269 ? r594270 : r594286;
        return r594287;
}

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.3
Herbie17.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 y < -2.5764089667759296e+205

    1. Initial program 42.2

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

      \[\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-rgt-in42.2

      \[\leadsto \frac{x \cdot y + \color{blue}{\left(t \cdot z + \left(-a\right) \cdot z\right)}}{y + z \cdot \left(b - y\right)}\]
    5. Applied associate-+r+42.2

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

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

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

    if -2.5764089667759296e+205 < y

    1. Initial program 21.8

      \[\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.8

      \[\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-rgt-in21.8

      \[\leadsto \frac{x \cdot y + \color{blue}{\left(t \cdot z + \left(-a\right) \cdot z\right)}}{y + z \cdot \left(b - y\right)}\]
    5. Applied associate-+r+21.8

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

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

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

      \[\leadsto \frac{\color{blue}{\left(t \cdot z + x \cdot y\right) - a \cdot z}}{y + z \cdot \left(b - y\right)}\]
    10. Applied div-sub21.8

      \[\leadsto \color{blue}{\frac{t \cdot z + x \cdot y}{y + z \cdot \left(b - y\right)} - \frac{a \cdot z}{y + z \cdot \left(b - y\right)}}\]
    11. Using strategy rm
    12. Applied associate-/l*20.1

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

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

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

Reproduce

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