Average Error: 25.1 → 8.7
Time: 8.1s
Precision: 64
\[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;e^{z} \le 0.9999999999964732655399757277336902916431:\\ \;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y \cdot e^{z}} \cdot \sqrt[3]{y \cdot e^{z}}\right) \cdot \sqrt[3]{y \cdot e^{z}}\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{1}{\frac{t}{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}}\\ \end{array}\]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\begin{array}{l}
\mathbf{if}\;e^{z} \le 0.9999999999964732655399757277336902916431:\\
\;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y \cdot e^{z}} \cdot \sqrt[3]{y \cdot e^{z}}\right) \cdot \sqrt[3]{y \cdot e^{z}}\right)}{t}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r300635 = x;
        double r300636 = 1.0;
        double r300637 = y;
        double r300638 = r300636 - r300637;
        double r300639 = z;
        double r300640 = exp(r300639);
        double r300641 = r300637 * r300640;
        double r300642 = r300638 + r300641;
        double r300643 = log(r300642);
        double r300644 = t;
        double r300645 = r300643 / r300644;
        double r300646 = r300635 - r300645;
        return r300646;
}

double f(double x, double y, double z, double t) {
        double r300647 = z;
        double r300648 = exp(r300647);
        double r300649 = 0.9999999999964733;
        bool r300650 = r300648 <= r300649;
        double r300651 = x;
        double r300652 = 1.0;
        double r300653 = y;
        double r300654 = r300652 - r300653;
        double r300655 = r300653 * r300648;
        double r300656 = cbrt(r300655);
        double r300657 = r300656 * r300656;
        double r300658 = r300657 * r300656;
        double r300659 = r300654 + r300658;
        double r300660 = log(r300659);
        double r300661 = t;
        double r300662 = r300660 / r300661;
        double r300663 = r300651 - r300662;
        double r300664 = 1.0;
        double r300665 = log(r300652);
        double r300666 = 0.5;
        double r300667 = 2.0;
        double r300668 = pow(r300647, r300667);
        double r300669 = r300666 * r300668;
        double r300670 = r300652 * r300647;
        double r300671 = r300669 + r300670;
        double r300672 = r300653 * r300671;
        double r300673 = r300665 + r300672;
        double r300674 = r300661 / r300673;
        double r300675 = r300664 / r300674;
        double r300676 = r300651 - r300675;
        double r300677 = r300650 ? r300663 : r300676;
        return r300677;
}

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.1
Target16.4
Herbie8.7
\[\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 2 regimes
  2. if (exp z) < 0.9999999999964733

    1. Initial program 11.9

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

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

    if 0.9999999999964733 < (exp z)

    1. Initial program 31.2

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

      \[\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. Simplified7.3

      \[\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 clear-num7.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \le 0.9999999999964732655399757277336902916431:\\ \;\;\;\;x - \frac{\log \left(\left(1 - y\right) + \left(\sqrt[3]{y \cdot e^{z}} \cdot \sqrt[3]{y \cdot e^{z}}\right) \cdot \sqrt[3]{y \cdot e^{z}}\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{1}{\frac{t}{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}}\\ \end{array}\]

Reproduce

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