Average Error: 24.7 → 8.7
Time: 7.2s
Precision: 64
\[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -13.9326691652547563:\\ \;\;\;\;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{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}{t}\\ \end{array}\]
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\begin{array}{l}
\mathbf{if}\;z \le -13.9326691652547563:\\
\;\;\;\;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{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}{t}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r244956 = x;
        double r244957 = 1.0;
        double r244958 = y;
        double r244959 = r244957 - r244958;
        double r244960 = z;
        double r244961 = exp(r244960);
        double r244962 = r244958 * r244961;
        double r244963 = r244959 + r244962;
        double r244964 = log(r244963);
        double r244965 = t;
        double r244966 = r244964 / r244965;
        double r244967 = r244956 - r244966;
        return r244967;
}

double f(double x, double y, double z, double t) {
        double r244968 = z;
        double r244969 = -13.932669165254756;
        bool r244970 = r244968 <= r244969;
        double r244971 = x;
        double r244972 = 1.0;
        double r244973 = y;
        double r244974 = r244972 - r244973;
        double r244975 = exp(r244968);
        double r244976 = r244973 * r244975;
        double r244977 = cbrt(r244976);
        double r244978 = r244977 * r244977;
        double r244979 = r244978 * r244977;
        double r244980 = r244974 + r244979;
        double r244981 = log(r244980);
        double r244982 = t;
        double r244983 = r244981 / r244982;
        double r244984 = r244971 - r244983;
        double r244985 = log(r244972);
        double r244986 = 0.5;
        double r244987 = 2.0;
        double r244988 = pow(r244968, r244987);
        double r244989 = r244986 * r244988;
        double r244990 = r244972 * r244968;
        double r244991 = r244989 + r244990;
        double r244992 = r244973 * r244991;
        double r244993 = r244985 + r244992;
        double r244994 = r244993 / r244982;
        double r244995 = r244971 - r244994;
        double r244996 = r244970 ? r244984 : r244995;
        return r244996;
}

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

Original24.7
Target16.3
Herbie8.7
\[\begin{array}{l} \mathbf{if}\;z \lt -2.88746230882079466 \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 z < -13.932669165254756

    1. Initial program 11.3

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

      \[\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 -13.932669165254756 < z

    1. Initial program 30.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -13.9326691652547563:\\ \;\;\;\;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{\log 1 + y \cdot \left(0.5 \cdot {z}^{2} + 1 \cdot z\right)}{t}\\ \end{array}\]

Reproduce

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