Average Error: 25.3 → 10.8
Time: 25.2s
Precision: 64
\[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -1.440743594728946531171226609163262891102 \cdot 10^{292}:\\ \;\;\;\;x - \frac{\log \left(y \cdot \left(\frac{1}{2} \cdot {z}^{2} + z\right) + 1\right)}{t}\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -3.611603069415811887919454562832725120938 \cdot 10^{-266}:\\ \;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right)\right)}{t}\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -0.0:\\ \;\;\;\;x - \left(1 \cdot \left(z \cdot \frac{y}{t}\right) + \frac{\log 1}{t}\right)\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le 1.256324954617756675438518762743726617656 \cdot 10^{220}:\\ \;\;\;\;x - \frac{1}{\frac{t}{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \left(\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)\right) \cdot \frac{1}{t}\\ \end{array}\]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\begin{array}{l}
\mathbf{if}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -1.440743594728946531171226609163262891102 \cdot 10^{292}:\\
\;\;\;\;x - \frac{\log \left(y \cdot \left(\frac{1}{2} \cdot {z}^{2} + z\right) + 1\right)}{t}\\

\mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -3.611603069415811887919454562832725120938 \cdot 10^{-266}:\\
\;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right)\right)}{t}\\

\mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -0.0:\\
\;\;\;\;x - \left(1 \cdot \left(z \cdot \frac{y}{t}\right) + \frac{\log 1}{t}\right)\\

\mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le 1.256324954617756675438518762743726617656 \cdot 10^{220}:\\
\;\;\;\;x - \frac{1}{\frac{t}{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}}\\

\mathbf{else}:\\
\;\;\;\;x - \left(\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)\right) \cdot \frac{1}{t}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r214369 = x;
        double r214370 = 1.0;
        double r214371 = y;
        double r214372 = r214370 - r214371;
        double r214373 = z;
        double r214374 = exp(r214373);
        double r214375 = r214371 * r214374;
        double r214376 = r214372 + r214375;
        double r214377 = log(r214376);
        double r214378 = t;
        double r214379 = r214377 / r214378;
        double r214380 = r214369 - r214379;
        return r214380;
}

double f(double x, double y, double z, double t) {
        double r214381 = 1.0;
        double r214382 = y;
        double r214383 = r214381 - r214382;
        double r214384 = z;
        double r214385 = exp(r214384);
        double r214386 = r214382 * r214385;
        double r214387 = r214383 + r214386;
        double r214388 = log(r214387);
        double r214389 = t;
        double r214390 = r214388 / r214389;
        double r214391 = -1.4407435947289465e+292;
        bool r214392 = r214390 <= r214391;
        double r214393 = x;
        double r214394 = 0.5;
        double r214395 = 2.0;
        double r214396 = pow(r214384, r214395);
        double r214397 = r214394 * r214396;
        double r214398 = r214397 + r214384;
        double r214399 = r214382 * r214398;
        double r214400 = r214399 + r214381;
        double r214401 = log(r214400);
        double r214402 = r214401 / r214389;
        double r214403 = r214393 - r214402;
        double r214404 = -3.611603069415812e-266;
        bool r214405 = r214390 <= r214404;
        double r214406 = cbrt(r214382);
        double r214407 = r214406 * r214406;
        double r214408 = r214406 * r214385;
        double r214409 = r214407 * r214408;
        double r214410 = r214383 + r214409;
        double r214411 = log(r214410);
        double r214412 = r214411 / r214389;
        double r214413 = r214393 - r214412;
        double r214414 = -0.0;
        bool r214415 = r214390 <= r214414;
        double r214416 = r214382 / r214389;
        double r214417 = r214384 * r214416;
        double r214418 = r214381 * r214417;
        double r214419 = log(r214381);
        double r214420 = r214419 / r214389;
        double r214421 = r214418 + r214420;
        double r214422 = r214393 - r214421;
        double r214423 = 1.2563249546177567e+220;
        bool r214424 = r214390 <= r214423;
        double r214425 = 1.0;
        double r214426 = r214389 / r214388;
        double r214427 = r214425 / r214426;
        double r214428 = r214393 - r214427;
        double r214429 = 0.5;
        double r214430 = r214429 * r214396;
        double r214431 = r214381 * r214384;
        double r214432 = r214430 + r214431;
        double r214433 = r214382 * r214432;
        double r214434 = r214419 + r214433;
        double r214435 = r214425 / r214389;
        double r214436 = r214434 * r214435;
        double r214437 = r214393 - r214436;
        double r214438 = r214424 ? r214428 : r214437;
        double r214439 = r214415 ? r214422 : r214438;
        double r214440 = r214405 ? r214413 : r214439;
        double r214441 = r214392 ? r214403 : r214440;
        return r214441;
}

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

Original25.3
Target16.5
Herbie10.8
\[\begin{array}{l} \mathbf{if}\;z \lt -2.887462308820794658905265984545350618896 \cdot 10^{119}:\\ \;\;\;\;\left(x - \frac{\frac{-0.5}{y \cdot t}}{z \cdot z}\right) - \frac{-0.5}{y \cdot t} \cdot \frac{\frac{2}{z}}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\ \end{array}\]

Derivation

  1. Split input into 5 regimes
  2. if (/ (log (+ (- 1.0 y) (* y (exp z)))) t) < -1.4407435947289465e+292

    1. Initial program 63.5

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt48.9

      \[\leadsto x - \frac{\log \left(\left(1 - y\right) + \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot e^{z}\right)}{t}\]
    4. Applied associate-*l*48.9

      \[\leadsto x - \frac{\log \left(\left(1 - y\right) + \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right)}\right)}{t}\]
    5. Taylor expanded around 0 15.0

      \[\leadsto x - \frac{\log \color{blue}{\left(\frac{1}{2} \cdot \left({z}^{2} \cdot y\right) + \left(z \cdot y + 1\right)\right)}}{t}\]
    6. Simplified15.0

      \[\leadsto x - \frac{\log \color{blue}{\left(y \cdot \left(\frac{1}{2} \cdot {z}^{2} + z\right) + 1\right)}}{t}\]

    if -1.4407435947289465e+292 < (/ (log (+ (- 1.0 y) (* y (exp z)))) t) < -3.611603069415812e-266

    1. Initial program 2.4

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt2.7

      \[\leadsto x - \frac{\log \left(\left(1 - y\right) + \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot e^{z}\right)}{t}\]
    4. Applied associate-*l*2.7

      \[\leadsto x - \frac{\log \left(\left(1 - y\right) + \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right)}\right)}{t}\]

    if -3.611603069415812e-266 < (/ (log (+ (- 1.0 y) (* y (exp z)))) t) < -0.0

    1. Initial program 12.1

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
    2. Taylor expanded around 0 16.4

      \[\leadsto x - \frac{\color{blue}{0.5 \cdot \left({z}^{2} \cdot y\right) + \left(1 \cdot \left(z \cdot y\right) + \log 1\right)}}{t}\]
    3. Simplified16.4

      \[\leadsto x - \frac{\color{blue}{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}}{t}\]
    4. Taylor expanded around 0 11.2

      \[\leadsto \color{blue}{x - \left(1 \cdot \frac{z \cdot y}{t} + \frac{\log 1}{t}\right)}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity11.2

      \[\leadsto x - \left(1 \cdot \frac{z \cdot y}{\color{blue}{1 \cdot t}} + \frac{\log 1}{t}\right)\]
    7. Applied times-frac9.5

      \[\leadsto x - \left(1 \cdot \color{blue}{\left(\frac{z}{1} \cdot \frac{y}{t}\right)} + \frac{\log 1}{t}\right)\]
    8. Simplified9.5

      \[\leadsto x - \left(1 \cdot \left(\color{blue}{z} \cdot \frac{y}{t}\right) + \frac{\log 1}{t}\right)\]

    if -0.0 < (/ (log (+ (- 1.0 y) (* y (exp z)))) t) < 1.2563249546177567e+220

    1. Initial program 2.7

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
    2. Using strategy rm
    3. Applied clear-num2.7

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}}}\]

    if 1.2563249546177567e+220 < (/ (log (+ (- 1.0 y) (* y (exp z)))) t)

    1. Initial program 60.5

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
    2. Taylor expanded around 0 18.0

      \[\leadsto x - \frac{\color{blue}{0.5 \cdot \left({z}^{2} \cdot y\right) + \left(1 \cdot \left(z \cdot y\right) + \log 1\right)}}{t}\]
    3. Simplified18.0

      \[\leadsto x - \frac{\color{blue}{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}}{t}\]
    4. Using strategy rm
    5. Applied div-inv18.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -1.440743594728946531171226609163262891102 \cdot 10^{292}:\\ \;\;\;\;x - \frac{\log \left(y \cdot \left(\frac{1}{2} \cdot {z}^{2} + z\right) + 1\right)}{t}\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -3.611603069415811887919454562832725120938 \cdot 10^{-266}:\\ \;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot e^{z}\right)\right)}{t}\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le -0.0:\\ \;\;\;\;x - \left(1 \cdot \left(z \cdot \frac{y}{t}\right) + \frac{\log 1}{t}\right)\\ \mathbf{elif}\;\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \le 1.256324954617756675438518762743726617656 \cdot 10^{220}:\\ \;\;\;\;x - \frac{1}{\frac{t}{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}}\\ \mathbf{else}:\\ \;\;\;\;x - \left(\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)\right) \cdot \frac{1}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2019326 
(FPCore (x y z t)
  :name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
  :precision binary64

  :herbie-target
  (if (< z -2.8874623088207947e+119) (- (- x (/ (/ (- 0.5) (* y t)) (* z z))) (* (/ (- 0.5) (* y t)) (/ (/ 2 z) (* z z)))) (- x (/ (log (+ 1 (* z y))) t)))

  (- x (/ (log (+ (- 1 y) (* y (exp z)))) t)))