Average Error: 7.2 → 2.4
Time: 15.6s
Precision: 64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1.0}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} = -\infty:\\ \;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\ \mathbf{elif}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} \le 2.5917678658971614 \cdot 10^{+229}:\\ \;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\ \end{array}\]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1.0}
\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} = -\infty:\\
\;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\

\mathbf{elif}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} \le 2.5917678658971614 \cdot 10^{+229}:\\
\;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r28400372 = x;
        double r28400373 = y;
        double r28400374 = z;
        double r28400375 = r28400373 * r28400374;
        double r28400376 = r28400375 - r28400372;
        double r28400377 = t;
        double r28400378 = r28400377 * r28400374;
        double r28400379 = r28400378 - r28400372;
        double r28400380 = r28400376 / r28400379;
        double r28400381 = r28400372 + r28400380;
        double r28400382 = 1.0;
        double r28400383 = r28400372 + r28400382;
        double r28400384 = r28400381 / r28400383;
        return r28400384;
}

double f(double x, double y, double z, double t) {
        double r28400385 = x;
        double r28400386 = z;
        double r28400387 = y;
        double r28400388 = r28400386 * r28400387;
        double r28400389 = r28400388 - r28400385;
        double r28400390 = t;
        double r28400391 = r28400386 * r28400390;
        double r28400392 = r28400391 - r28400385;
        double r28400393 = r28400389 / r28400392;
        double r28400394 = r28400385 + r28400393;
        double r28400395 = 1.0;
        double r28400396 = r28400385 + r28400395;
        double r28400397 = r28400394 / r28400396;
        double r28400398 = -inf.0;
        bool r28400399 = r28400397 <= r28400398;
        double r28400400 = r28400387 / r28400390;
        double r28400401 = r28400400 + r28400385;
        double r28400402 = r28400401 / r28400396;
        double r28400403 = 2.5917678658971614e+229;
        bool r28400404 = r28400397 <= r28400403;
        double r28400405 = r28400404 ? r28400397 : r28400402;
        double r28400406 = r28400399 ? r28400402 : r28400405;
        return r28400406;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.2
Target0.3
Herbie2.4
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1.0}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) < -inf.0 or 2.5917678658971614e+229 < (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0))

    1. Initial program 55.5

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1.0}\]
    2. Taylor expanded around inf 15.9

      \[\leadsto \frac{x + \color{blue}{\frac{y}{t}}}{x + 1.0}\]

    if -inf.0 < (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) < 2.5917678658971614e+229

    1. Initial program 0.6

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1.0}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} = -\infty:\\ \;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\ \mathbf{elif}\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0} \le 2.5917678658971614 \cdot 10^{+229}:\\ \;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{t} + x}{x + 1.0}\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"

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

  (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))