System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2

Percentage Accurate: 61.3% → 98.5%
Time: 14.3s
Alternatives: 8
Speedup: 211.0×

Specification

?
\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 61.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
	return x - (log(((1.0 - y) + (y * exp(z)))) / t);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
	return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t):
	return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t))
end
function tmp = code(x, y, z, t)
	tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t);
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}

Alternative 1: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (- x (/ (log1p (* y (expm1 z))) t)))
double code(double x, double y, double z, double t) {
	return x - (log1p((y * expm1(z))) / t);
}
public static double code(double x, double y, double z, double t) {
	return x - (Math.log1p((y * Math.expm1(z))) / t);
}
def code(x, y, z, t):
	return x - (math.log1p((y * math.expm1(z))) / t)
function code(x, y, z, t)
	return Float64(x - Float64(log1p(Float64(y * expm1(z))) / t))
end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
\end{array}
Derivation
  1. Initial program 61.3%

    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
  2. Step-by-step derivation
    1. associate-+l-78.3%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
    2. sub-neg78.3%

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

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
    4. neg-sub083.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
    5. associate-+l-83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
    6. neg-sub083.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
    7. neg-mul-183.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
    8. *-commutative83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
    9. distribute-rgt-out83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
    10. +-commutative83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
    11. metadata-eval83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
    12. sub-neg83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
    13. expm1-def99.0%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
  4. Final simplification99.0%

    \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t} \]

Alternative 2: 86.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{expm1}\left(z\right)\\ \mathbf{if}\;y \leq -2.25 \cdot 10^{+282}:\\ \;\;\;\;\frac{-\mathsf{log1p}\left(t_1\right)}{t}\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+160}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t_1}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (expm1 z))))
   (if (<= y -2.25e+282)
     (/ (- (log1p t_1)) t)
     (if (<= y -1.55e+160) x (- x (/ t_1 t))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * expm1(z);
	double tmp;
	if (y <= -2.25e+282) {
		tmp = -log1p(t_1) / t;
	} else if (y <= -1.55e+160) {
		tmp = x;
	} else {
		tmp = x - (t_1 / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = y * Math.expm1(z);
	double tmp;
	if (y <= -2.25e+282) {
		tmp = -Math.log1p(t_1) / t;
	} else if (y <= -1.55e+160) {
		tmp = x;
	} else {
		tmp = x - (t_1 / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * math.expm1(z)
	tmp = 0
	if y <= -2.25e+282:
		tmp = -math.log1p(t_1) / t
	elif y <= -1.55e+160:
		tmp = x
	else:
		tmp = x - (t_1 / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * expm1(z))
	tmp = 0.0
	if (y <= -2.25e+282)
		tmp = Float64(Float64(-log1p(t_1)) / t);
	elseif (y <= -1.55e+160)
		tmp = x;
	else
		tmp = Float64(x - Float64(t_1 / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.25e+282], N[((-N[Log[1 + t$95$1], $MachinePrecision]) / t), $MachinePrecision], If[LessEqual[y, -1.55e+160], x, N[(x - N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \mathsf{expm1}\left(z\right)\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{+282}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(t_1\right)}{t}\\

\mathbf{elif}\;y \leq -1.55 \cdot 10^{+160}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - \frac{t_1}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.25000000000000011e282

    1. Initial program 40.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-44.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg44.3%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub044.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub044.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-144.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg44.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around 0 41.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(1 + \left(e^{z} - 1\right) \cdot y\right)}{t}} \]
    5. Step-by-step derivation
      1. mul-1-neg41.3%

        \[\leadsto \color{blue}{-\frac{\log \left(1 + \left(e^{z} - 1\right) \cdot y\right)}{t}} \]
      2. log1p-def41.3%

        \[\leadsto -\frac{\color{blue}{\mathsf{log1p}\left(\left(e^{z} - 1\right) \cdot y\right)}}{t} \]
      3. *-commutative41.3%

        \[\leadsto -\frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      4. expm1-def99.4%

        \[\leadsto -\frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
      5. distribute-frac-neg99.4%

        \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
      6. expm1-def41.3%

        \[\leadsto \frac{-\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      7. *-commutative41.3%

        \[\leadsto \frac{-\mathsf{log1p}\left(\color{blue}{\left(e^{z} - 1\right) \cdot y}\right)}{t} \]
      8. expm1-def99.4%

        \[\leadsto \frac{-\mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y\right)}{t} \]
    6. Simplified99.4%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(\mathsf{expm1}\left(z\right) \cdot y\right)}{t}} \]

    if -2.25000000000000011e282 < y < -1.5499999999999999e160

    1. Initial program 47.5%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-79.6%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg79.6%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub079.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub079.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-179.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg79.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around inf 66.9%

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

    if -1.5499999999999999e160 < y

    1. Initial program 63.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-78.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg78.9%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub085.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub085.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-185.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 83.5%

      \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
    5. Step-by-step derivation
      1. expm1-def94.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
    6. Simplified94.0%

      \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+282}:\\ \;\;\;\;\frac{-\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+160}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\ \end{array} \]

Alternative 3: 86.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-132}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1e-132) (- x (/ (expm1 z) (/ t y))) (- x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1e-132) {
		tmp = x - (expm1(z) / (t / y));
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1e-132) {
		tmp = x - (Math.expm1(z) / (t / y));
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1e-132:
		tmp = x - (math.expm1(z) / (t / y))
	else:
		tmp = x - (y / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1e-132)
		tmp = Float64(x - Float64(expm1(z) / Float64(t / y)));
	else
		tmp = Float64(x - Float64(y / Float64(t / z)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e-132], N[(x - N[(N[(Exp[z] - 1), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-132}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.9999999999999999e-133

    1. Initial program 76.4%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-81.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg81.2%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub094.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub094.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-194.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg94.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.8%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 82.3%

      \[\leadsto x - \color{blue}{\frac{\left(e^{z} - 1\right) \cdot y}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*81.3%

        \[\leadsto x - \color{blue}{\frac{e^{z} - 1}{\frac{t}{y}}} \]
      2. expm1-def84.7%

        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)}}{\frac{t}{y}} \]
    6. Simplified84.7%

      \[\leadsto x - \color{blue}{\frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}} \]

    if -9.9999999999999999e-133 < z

    1. Initial program 50.4%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-76.2%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg76.2%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub076.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub076.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-176.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg76.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.1%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.1%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 92.0%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*92.1%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified92.1%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-132}:\\ \;\;\;\;x - \frac{\mathsf{expm1}\left(z\right)}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 4: 86.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+161}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -4.6e+161) x (- x (/ (* y (expm1 z)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4.6e+161) {
		tmp = x;
	} else {
		tmp = x - ((y * expm1(z)) / t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4.6e+161) {
		tmp = x;
	} else {
		tmp = x - ((y * Math.expm1(z)) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -4.6e+161:
		tmp = x
	else:
		tmp = x - ((y * math.expm1(z)) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -4.6e+161)
		tmp = x;
	else
		tmp = Float64(x - Float64(Float64(y * expm1(z)) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.6e+161], x, N[(x - N[(N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+161}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999999e161

    1. Initial program 46.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-73.5%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg73.5%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub073.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub073.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-173.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg73.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around inf 56.2%

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

    if -4.5999999999999999e161 < y

    1. Initial program 63.2%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-78.9%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg78.9%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub085.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub085.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-185.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg85.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in y around 0 83.5%

      \[\leadsto x - \frac{\color{blue}{\left(e^{z} - 1\right) \cdot y}}{t} \]
    5. Step-by-step derivation
      1. expm1-def94.0%

        \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right)} \cdot y}{t} \]
    6. Simplified94.0%

      \[\leadsto x - \frac{\color{blue}{\mathsf{expm1}\left(z\right) \cdot y}}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+161}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\ \end{array} \]

Alternative 5: 76.9% accurate, 19.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-103}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -8.8e+39) x (if (<= x 4.4e-103) (- x (* z (/ y t))) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -8.8e+39) {
		tmp = x;
	} else if (x <= 4.4e-103) {
		tmp = x - (z * (y / t));
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-8.8d+39)) then
        tmp = x
    else if (x <= 4.4d-103) then
        tmp = x - (z * (y / t))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -8.8e+39) {
		tmp = x;
	} else if (x <= 4.4e-103) {
		tmp = x - (z * (y / t));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -8.8e+39:
		tmp = x
	elif x <= 4.4e-103:
		tmp = x - (z * (y / t))
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -8.8e+39)
		tmp = x;
	elseif (x <= 4.4e-103)
		tmp = Float64(x - Float64(z * Float64(y / t)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -8.8e+39)
		tmp = x;
	elseif (x <= 4.4e-103)
		tmp = x - (z * (y / t));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.8e+39], x, If[LessEqual[x, 4.4e-103], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+39}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{-103}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.8000000000000006e39 or 4.3999999999999999e-103 < x

    1. Initial program 69.3%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-92.3%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg92.3%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub093.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub093.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-193.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg93.5%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def99.3%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified99.3%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around inf 91.6%

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

    if -8.8000000000000006e39 < x < 4.3999999999999999e-103

    1. Initial program 48.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-56.8%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg56.8%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub069.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub069.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-169.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg69.2%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 67.1%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*67.6%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      2. associate-/r/63.5%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
    6. Simplified63.5%

      \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-103}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 81.3% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -3.25e-65) x (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.25e-65) {
		tmp = x;
	} else {
		tmp = x - (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-3.25d-65)) then
        tmp = x
    else
        tmp = x - (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.25e-65) {
		tmp = x;
	} else {
		tmp = x - (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -3.25e-65:
		tmp = x
	else:
		tmp = x - (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.25e-65)
		tmp = x;
	else
		tmp = Float64(x - Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -3.25e-65)
		tmp = x;
	else
		tmp = x - (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.25e-65], x, N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.25e-65

    1. Initial program 80.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-82.1%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg82.1%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub098.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub098.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-198.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around inf 71.9%

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

    if -3.25e-65 < z

    1. Initial program 51.3%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-76.4%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg76.4%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub076.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub076.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-176.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 91.6%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*91.9%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
      2. associate-/r/83.8%

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
    6. Simplified83.8%

      \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative83.8%

        \[\leadsto x - \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num83.9%

        \[\leadsto x - z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      3. un-div-inv83.8%

        \[\leadsto x - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Applied egg-rr83.8%

      \[\leadsto x - \color{blue}{\frac{z}{\frac{t}{y}}} \]
    9. Step-by-step derivation
      1. associate-/r/91.9%

        \[\leadsto x - \color{blue}{\frac{z}{t} \cdot y} \]
    10. Simplified91.9%

      \[\leadsto x - \color{blue}{\frac{z}{t} \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 7: 81.2% accurate, 23.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -3.25e-65) x (- x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.25e-65) {
		tmp = x;
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-3.25d-65)) then
        tmp = x
    else
        tmp = x - (y / (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.25e-65) {
		tmp = x;
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -3.25e-65:
		tmp = x
	else:
		tmp = x - (y / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.25e-65)
		tmp = x;
	else
		tmp = Float64(x - Float64(y / Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -3.25e-65)
		tmp = x;
	else
		tmp = x - (y / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.25e-65], x, N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.25e-65

    1. Initial program 80.9%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-82.1%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg82.1%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub098.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub098.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-198.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg98.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def100.0%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in x around inf 71.9%

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

    if -3.25e-65 < z

    1. Initial program 51.3%

      \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
    2. Step-by-step derivation
      1. associate-+l-76.4%

        \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
      2. sub-neg76.4%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
      4. neg-sub076.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
      5. associate-+l-76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
      6. neg-sub076.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
      7. neg-mul-176.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
      8. *-commutative76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
      9. distribute-rgt-out76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
      10. +-commutative76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
      11. metadata-eval76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
      12. sub-neg76.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
      13. expm1-def98.4%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
    4. Taylor expanded in z around 0 91.6%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    5. Step-by-step derivation
      1. associate-/l*91.9%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    6. Simplified91.9%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 8: 71.0% accurate, 211.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 61.3%

    \[x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t} \]
  2. Step-by-step derivation
    1. associate-+l-78.3%

      \[\leadsto x - \frac{\log \color{blue}{\left(1 - \left(y - y \cdot e^{z}\right)\right)}}{t} \]
    2. sub-neg78.3%

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

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(-\left(y - y \cdot e^{z}\right)\right)}}{t} \]
    4. neg-sub083.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{0 - \left(y - y \cdot e^{z}\right)}\right)}{t} \]
    5. associate-+l-83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(0 - y\right) + y \cdot e^{z}}\right)}{t} \]
    6. neg-sub083.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{\left(-y\right)} + y \cdot e^{z}\right)}{t} \]
    7. neg-mul-183.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{-1 \cdot y} + y \cdot e^{z}\right)}{t} \]
    8. *-commutative83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(-1 \cdot y + \color{blue}{e^{z} \cdot y}\right)}{t} \]
    9. distribute-rgt-out83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(-1 + e^{z}\right)}\right)}{t} \]
    10. +-commutative83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} + -1\right)}\right)}{t} \]
    11. metadata-eval83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \left(e^{z} + \color{blue}{\left(-1\right)}\right)\right)}{t} \]
    12. sub-neg83.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\left(e^{z} - 1\right)}\right)}{t} \]
    13. expm1-def99.0%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot \color{blue}{\mathsf{expm1}\left(z\right)}\right)}{t} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}} \]
  4. Taylor expanded in x around inf 75.2%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification75.2%

    \[\leadsto x \]

Developer target: 74.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-0.5}{y \cdot t}\\ \mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\ \;\;\;\;\left(x - \frac{t_1}{z \cdot z}\right) - t_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (- 0.5) (* y t))))
   (if (< z -2.8874623088207947e+119)
     (- (- x (/ t_1 (* z z))) (* t_1 (/ (/ 2.0 z) (* z z))))
     (- x (/ (log (+ 1.0 (* z y))) t)))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.5 / (y * t);
	double tmp;
	if (z < -2.8874623088207947e+119) {
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	} else {
		tmp = x - (log((1.0 + (z * y))) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -0.5d0 / (y * t)
    if (z < (-2.8874623088207947d+119)) then
        tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0d0 / z) / (z * z)))
    else
        tmp = x - (log((1.0d0 + (z * y))) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -0.5 / (y * t);
	double tmp;
	if (z < -2.8874623088207947e+119) {
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	} else {
		tmp = x - (Math.log((1.0 + (z * y))) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.5 / (y * t)
	tmp = 0
	if z < -2.8874623088207947e+119:
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)))
	else:
		tmp = x - (math.log((1.0 + (z * y))) / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(-0.5) / Float64(y * t))
	tmp = 0.0
	if (z < -2.8874623088207947e+119)
		tmp = Float64(Float64(x - Float64(t_1 / Float64(z * z))) - Float64(t_1 * Float64(Float64(2.0 / z) / Float64(z * z))));
	else
		tmp = Float64(x - Float64(log(Float64(1.0 + Float64(z * y))) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.5 / (y * t);
	tmp = 0.0;
	if (z < -2.8874623088207947e+119)
		tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
	else
		tmp = x - (log((1.0 + (z * y))) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-0.5) / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.8874623088207947e+119], N[(N[(x - N[(t$95$1 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(2.0 / z), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(1.0 + N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-0.5}{y \cdot t}\\
\mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\
\;\;\;\;\left(x - \frac{t_1}{z \cdot z}\right) - t_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023224 
(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.0 z) (* z z)))) (- x (/ (log (+ 1.0 (* z y))) t)))

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