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

Percentage Accurate: 61.2% → 98.4%
Time: 19.7s
Alternatives: 9
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 9 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.2% 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.4% 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 68.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
    11. cancel-sign-sub85.9%

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
    14. *-rgt-identity85.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    15. distribute-lft-out--85.9%

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

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

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

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

Alternative 2: 84.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+156}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\

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


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

    1. Initial program 61.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg61.8%

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub74.7%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub74.7%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity74.7%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--74.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(1 + y \cdot \left(e^{z} - 1\right)\right)}{t}} \]
    6. Step-by-step derivation
      1. associate-*r/33.9%

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

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

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

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

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

    if -1.50000000000000005e157 < y < 4.8000000000000002e156

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub87.6%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity87.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--87.6%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num92.2%

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

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr92.2%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-192.2%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*92.8%

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    11. Simplified92.8%

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

    if 4.8000000000000002e156 < y

    1. Initial program 9.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub85.9%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      16. 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. Add Preprocessing
    5. Taylor expanded in x around inf 83.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+157}:\\ \;\;\;\;\frac{-\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+156}:\\ \;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.1% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+38}:\\ \;\;\;\;x + \frac{-1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}\\ \mathbf{elif}\;y \leq 10^{+158}:\\ \;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -5.5e+38)
   (+
    x
    (/
     -1.0
     (-
      (fma -0.5 (/ t y) (/ t (* y z)))
      (* z (* (/ t y) -0.08333333333333333)))))
   (if (<= y 1e+158) (+ x (/ -1.0 (/ (/ t y) (expm1 z)))) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -5.5e+38) {
		tmp = x + (-1.0 / (fma(-0.5, (t / y), (t / (y * z))) - (z * ((t / y) * -0.08333333333333333))));
	} else if (y <= 1e+158) {
		tmp = x + (-1.0 / ((t / y) / expm1(z)));
	} else {
		tmp = x;
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -5.5e+38)
		tmp = Float64(x + Float64(-1.0 / Float64(fma(-0.5, Float64(t / y), Float64(t / Float64(y * z))) - Float64(z * Float64(Float64(t / y) * -0.08333333333333333)))));
	elseif (y <= 1e+158)
		tmp = Float64(x + Float64(-1.0 / Float64(Float64(t / y) / expm1(z))));
	else
		tmp = x;
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+38], N[(x + N[(-1.0 / N[(N[(-0.5 * N[(t / y), $MachinePrecision] + N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[(t / y), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+158], N[(x + N[(-1.0 / N[(N[(t / y), $MachinePrecision] / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{-1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}\\

\mathbf{elif}\;y \leq 10^{+158}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\

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


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

    1. Initial program 53.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg53.4%

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub78.6%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub78.6%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity78.6%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--78.6%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num51.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. inv-pow51.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr51.9%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-151.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*47.6%

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

      \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    12. Taylor expanded in z around 0 56.7%

      \[\leadsto x - \frac{1}{\color{blue}{-1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right) + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}} \]
    13. Step-by-step derivation
      1. +-commutative56.7%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + -1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      2. mul-1-neg56.7%

        \[\leadsto x - \frac{1}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + \color{blue}{\left(-z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      3. unsub-neg56.7%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)}} \]
      4. fma-def56.7%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right)} - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)} \]
      5. distribute-rgt-out59.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \color{blue}{\left(\frac{t}{y} \cdot \left(-0.25 + 0.16666666666666666\right)\right)}} \]
      6. metadata-eval59.3%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot \color{blue}{-0.08333333333333333}\right)} \]
    14. Simplified59.3%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}} \]

    if -5.5000000000000003e38 < y < 9.99999999999999953e157

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub88.1%

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--88.1%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num94.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. inv-pow94.9%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr94.9%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-194.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*95.5%

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    11. Simplified95.5%

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

    if 9.99999999999999953e157 < y

    1. Initial program 9.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub85.9%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      16. 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. Add Preprocessing
    5. Taylor expanded in x around inf 83.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+38}:\\ \;\;\;\;x + \frac{-1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}\\ \mathbf{elif}\;y \leq 10^{+158}:\\ \;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{-1}{t \cdot \left(\frac{1}{y \cdot z} + \left(0.5 \cdot \frac{-1}{y} - -0.08333333333333333 \cdot \frac{z}{y}\right)\right)}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+157}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub80.4%

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--80.4%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num50.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. inv-pow50.7%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr50.7%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-150.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*46.0%

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    11. Simplified46.0%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    12. Taylor expanded in z around 0 56.2%

      \[\leadsto x - \frac{1}{\color{blue}{-1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right) + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}} \]
    13. Step-by-step derivation
      1. +-commutative56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + -1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      2. mul-1-neg56.2%

        \[\leadsto x - \frac{1}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + \color{blue}{\left(-z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      3. unsub-neg56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)}} \]
      4. fma-def56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right)} - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)} \]
      5. distribute-rgt-out58.8%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \color{blue}{\left(\frac{t}{y} \cdot \left(-0.25 + 0.16666666666666666\right)\right)}} \]
      6. metadata-eval58.8%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot \color{blue}{-0.08333333333333333}\right)} \]
    14. Simplified58.8%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}} \]
    15. Taylor expanded in t around 0 58.8%

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

    if -1.4499999999999999e55 < y < 3.50000000000000002e157

    1. Initial program 75.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg75.7%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--87.4%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num94.1%

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

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr94.1%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-194.1%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*94.7%

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

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

    if 3.50000000000000002e157 < y

    1. Initial program 9.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub85.9%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--85.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot \left(e^{z} - 1\right)}\right)}{t} \]
      16. 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. Add Preprocessing
    5. Taylor expanded in x around inf 83.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+55}:\\ \;\;\;\;x + \frac{-1}{t \cdot \left(\frac{1}{y \cdot z} + \left(0.5 \cdot \frac{-1}{y} - -0.08333333333333333 \cdot \frac{z}{y}\right)\right)}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+157}:\\ \;\;\;\;x + \frac{-1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+55}:\\ \;\;\;\;x + \frac{-1}{t \cdot \left(\frac{1}{y \cdot z} + \left(0.5 \cdot \frac{-1}{y} - -0.08333333333333333 \cdot \frac{z}{y}\right)\right)}\\ \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 -2.8e+55)
   (+
    x
    (/
     -1.0
     (*
      t
      (+
       (/ 1.0 (* y z))
       (- (* 0.5 (/ -1.0 y)) (* -0.08333333333333333 (/ z y)))))))
   (- x (/ (* y (expm1 z)) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.8e+55) {
		tmp = x + (-1.0 / (t * ((1.0 / (y * z)) + ((0.5 * (-1.0 / y)) - (-0.08333333333333333 * (z / y))))));
	} 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 <= -2.8e+55) {
		tmp = x + (-1.0 / (t * ((1.0 / (y * z)) + ((0.5 * (-1.0 / y)) - (-0.08333333333333333 * (z / y))))));
	} else {
		tmp = x - ((y * Math.expm1(z)) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2.8e+55:
		tmp = x + (-1.0 / (t * ((1.0 / (y * z)) + ((0.5 * (-1.0 / y)) - (-0.08333333333333333 * (z / y))))))
	else:
		tmp = x - ((y * math.expm1(z)) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.8e+55)
		tmp = Float64(x + Float64(-1.0 / Float64(t * Float64(Float64(1.0 / Float64(y * z)) + Float64(Float64(0.5 * Float64(-1.0 / y)) - Float64(-0.08333333333333333 * Float64(z / y)))))));
	else
		tmp = Float64(x - Float64(Float64(y * expm1(z)) / t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e+55], N[(x + N[(-1.0 / N[(t * N[(N[(1.0 / N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] - N[(-0.08333333333333333 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+55}:\\
\;\;\;\;x + \frac{-1}{t \cdot \left(\frac{1}{y \cdot z} + \left(0.5 \cdot \frac{-1}{y} - -0.08333333333333333 \cdot \frac{z}{y}\right)\right)}\\

\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 < -2.8000000000000001e55

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub80.4%

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--80.4%

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
    8. Step-by-step derivation
      1. clear-num50.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. inv-pow50.7%

        \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    9. Applied egg-rr50.7%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-150.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
      2. associate-/r*46.0%

        \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    11. Simplified46.0%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
    12. Taylor expanded in z around 0 56.2%

      \[\leadsto x - \frac{1}{\color{blue}{-1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right) + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}} \]
    13. Step-by-step derivation
      1. +-commutative56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + -1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      2. mul-1-neg56.2%

        \[\leadsto x - \frac{1}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + \color{blue}{\left(-z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
      3. unsub-neg56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)}} \]
      4. fma-def56.2%

        \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right)} - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)} \]
      5. distribute-rgt-out58.8%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \color{blue}{\left(\frac{t}{y} \cdot \left(-0.25 + 0.16666666666666666\right)\right)}} \]
      6. metadata-eval58.8%

        \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot \color{blue}{-0.08333333333333333}\right)} \]
    14. Simplified58.8%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}} \]
    15. Taylor expanded in t around 0 58.8%

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

    if -2.8000000000000001e55 < y

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub83.5%

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub87.3%

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--87.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+55}:\\ \;\;\;\;x + \frac{-1}{t \cdot \left(\frac{1}{y \cdot z} + \left(0.5 \cdot \frac{-1}{y} - -0.08333333333333333 \cdot \frac{z}{y}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 81.5% accurate, 12.4× speedup?

\[\begin{array}{l} \\ x + \frac{-1}{\frac{\frac{t}{z}}{y} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (/ -1.0 (- (/ (/ t z) y) (* z (* (/ t y) -0.08333333333333333))))))
double code(double x, double y, double z, double t) {
	return x + (-1.0 / (((t / z) / y) - (z * ((t / y) * -0.08333333333333333))));
}
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 + ((-1.0d0) / (((t / z) / y) - (z * ((t / y) * (-0.08333333333333333d0)))))
end function
public static double code(double x, double y, double z, double t) {
	return x + (-1.0 / (((t / z) / y) - (z * ((t / y) * -0.08333333333333333))));
}
def code(x, y, z, t):
	return x + (-1.0 / (((t / z) / y) - (z * ((t / y) * -0.08333333333333333))))
function code(x, y, z, t)
	return Float64(x + Float64(-1.0 / Float64(Float64(Float64(t / z) / y) - Float64(z * Float64(Float64(t / y) * -0.08333333333333333)))))
end
function tmp = code(x, y, z, t)
	tmp = x + (-1.0 / (((t / z) / y) - (z * ((t / y) * -0.08333333333333333))));
end
code[x_, y_, z_, t_] := N[(x + N[(-1.0 / N[(N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(N[(t / y), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{-1}{\frac{\frac{t}{z}}{y} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}
\end{array}
Derivation
  1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
    11. cancel-sign-sub85.9%

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
    14. *-rgt-identity85.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    15. distribute-lft-out--85.9%

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

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

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

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

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

    \[\leadsto x - \frac{\color{blue}{y \cdot \mathsf{expm1}\left(z\right)}}{t} \]
  8. Step-by-step derivation
    1. clear-num83.7%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
    2. inv-pow83.7%

      \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
  9. Applied egg-rr83.7%

    \[\leadsto x - \color{blue}{{\left(\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}\right)}^{-1}} \]
  10. Step-by-step derivation
    1. unpow-183.7%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{t}{y \cdot \mathsf{expm1}\left(z\right)}}} \]
    2. associate-/r*82.5%

      \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
  11. Simplified82.5%

    \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{t}{y}}{\mathsf{expm1}\left(z\right)}}} \]
  12. Taylor expanded in z around 0 66.4%

    \[\leadsto x - \frac{1}{\color{blue}{-1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right) + \left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right)}} \]
  13. Step-by-step derivation
    1. +-commutative66.4%

      \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + -1 \cdot \left(z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
    2. mul-1-neg66.4%

      \[\leadsto x - \frac{1}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) + \color{blue}{\left(-z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)\right)}} \]
    3. unsub-neg66.4%

      \[\leadsto x - \frac{1}{\color{blue}{\left(-0.5 \cdot \frac{t}{y} + \frac{t}{y \cdot z}\right) - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)}} \]
    4. fma-def66.4%

      \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right)} - z \cdot \left(-0.25 \cdot \frac{t}{y} + 0.16666666666666666 \cdot \frac{t}{y}\right)} \]
    5. distribute-rgt-out76.3%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \color{blue}{\left(\frac{t}{y} \cdot \left(-0.25 + 0.16666666666666666\right)\right)}} \]
    6. metadata-eval76.3%

      \[\leadsto x - \frac{1}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot \color{blue}{-0.08333333333333333}\right)} \]
  14. Simplified76.3%

    \[\leadsto x - \frac{1}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{t}{y}, \frac{t}{y \cdot z}\right) - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)}} \]
  15. Taylor expanded in z around 0 82.2%

    \[\leadsto x - \frac{1}{\color{blue}{\frac{t}{y \cdot z}} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \]
  16. Step-by-step derivation
    1. *-commutative82.2%

      \[\leadsto x - \frac{1}{\frac{t}{\color{blue}{z \cdot y}} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \]
    2. associate-/r*83.4%

      \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{z}}{y}} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \]
  17. Simplified83.4%

    \[\leadsto x - \frac{1}{\color{blue}{\frac{\frac{t}{z}}{y}} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \]
  18. Final simplification83.4%

    \[\leadsto x + \frac{-1}{\frac{\frac{t}{z}}{y} - z \cdot \left(\frac{t}{y} \cdot -0.08333333333333333\right)} \]
  19. Add Preprocessing

Alternative 7: 78.8% accurate, 17.6× speedup?

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

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

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


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

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg90.0%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub99.9%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--99.9%

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

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

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

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

    if -1.95e-25 < z

    1. Initial program 56.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg56.7%

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub78.4%

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--78.5%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{t} \cdot z} \]
    7. Simplified86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{-25}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 82.0% accurate, 17.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t) :precision binary64 (if (<= z -7e-27) x (- x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7e-27) {
		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 <= (-7d-27)) 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 <= -7e-27) {
		tmp = x;
	} else {
		tmp = x - (y / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -7e-27:
		tmp = x
	else:
		tmp = x - (y / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -7e-27)
		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 <= -7e-27)
		tmp = x;
	else
		tmp = x - (y / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -7e-27], x, N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg90.0%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
      11. cancel-sign-sub99.9%

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
      14. *-rgt-identity99.9%

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--99.9%

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

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

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

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

    if -7.0000000000000003e-27 < z

    1. Initial program 56.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}\right)\right)} \]
      6. remove-double-neg56.7%

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

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

        \[\leadsto x - \frac{\log \color{blue}{\left(1 + \left(\left(-y\right) + y \cdot e^{z}\right)\right)}}{t} \]
      9. cancel-sign-sub78.4%

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

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

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

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

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

        \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
      15. distribute-lft-out--78.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 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 68.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{\color{blue}{\mathsf{log1p}\left(\left(-y\right) - \left(-y\right) \cdot e^{z}\right)}}{t} \]
    11. cancel-sign-sub85.9%

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

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

      \[\leadsto x - \frac{\mathsf{log1p}\left(\color{blue}{y \cdot e^{z} - y}\right)}{t} \]
    14. *-rgt-identity85.9%

      \[\leadsto x - \frac{\mathsf{log1p}\left(y \cdot e^{z} - \color{blue}{y \cdot 1}\right)}{t} \]
    15. distribute-lft-out--85.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification76.3%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 73.7% 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 2024029 
(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)))