
(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:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 63.1%
associate-+l-74.5%
sub-neg74.5%
log1p-def82.0%
neg-sub082.0%
associate-+l-82.0%
neg-sub082.0%
neg-mul-182.0%
*-commutative82.0%
distribute-rgt-out82.0%
+-commutative82.0%
metadata-eval82.0%
sub-neg82.0%
expm1-def99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1e-80) (- x (* (expm1 z) (/ y t))) (- x (+ (* 0.5 (/ (* y (* z z)) t)) (* y (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e-80) {
tmp = x - (expm1(z) * (y / t));
} else {
tmp = x - ((0.5 * ((y * (z * z)) / t)) + (y * (z / t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e-80) {
tmp = x - (Math.expm1(z) * (y / t));
} else {
tmp = x - ((0.5 * ((y * (z * z)) / t)) + (y * (z / t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1e-80: tmp = x - (math.expm1(z) * (y / t)) else: tmp = x - ((0.5 * ((y * (z * z)) / t)) + (y * (z / t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1e-80) tmp = Float64(x - Float64(expm1(z) * Float64(y / t))); else tmp = Float64(x - Float64(Float64(0.5 * Float64(Float64(y * Float64(z * z)) / t)) + Float64(y * Float64(z / t)))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e-80], N[(x - N[(N[(Exp[z] - 1), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.5 * N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-80}:\\
\;\;\;\;x - \mathsf{expm1}\left(z\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \left(0.5 \cdot \frac{y \cdot \left(z \cdot z\right)}{t} + y \cdot \frac{z}{t}\right)\\
\end{array}
\end{array}
if z < -9.99999999999999961e-81Initial program 76.5%
associate-+l-77.5%
sub-neg77.5%
log1p-def93.5%
neg-sub093.5%
associate-+l-93.5%
neg-sub093.5%
neg-mul-193.5%
*-commutative93.5%
distribute-rgt-out93.6%
+-commutative93.6%
metadata-eval93.6%
sub-neg93.6%
expm1-def99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 71.9%
expm1-def76.3%
associate-*r/76.3%
Simplified76.3%
if -9.99999999999999961e-81 < z Initial program 52.7%
associate-+l-72.3%
sub-neg72.3%
log1p-def73.0%
neg-sub073.0%
associate-+l-73.0%
neg-sub073.0%
neg-mul-173.0%
*-commutative73.0%
distribute-rgt-out73.0%
+-commutative73.0%
metadata-eval73.0%
sub-neg73.0%
expm1-def98.6%
Simplified98.6%
Taylor expanded in y around 0 72.2%
Taylor expanded in z around 0 89.9%
+-commutative89.9%
unpow289.9%
*-commutative89.9%
associate-/l*85.5%
associate-/r/90.4%
Simplified90.4%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e+213) (+ x (/ -1.0 (* z (* y t)))) (- x (* y (/ (expm1 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+213) {
tmp = x + (-1.0 / (z * (y * t)));
} else {
tmp = x - (y * (expm1(z) / t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+213) {
tmp = x + (-1.0 / (z * (y * t)));
} else {
tmp = x - (y * (Math.expm1(z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e+213: tmp = x + (-1.0 / (z * (y * t))) else: tmp = x - (y * (math.expm1(z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e+213) tmp = Float64(x + Float64(-1.0 / Float64(z * Float64(y * t)))); else tmp = Float64(x - Float64(y * Float64(expm1(z) / t))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e+213], N[(x + N[(-1.0 / N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+213}:\\
\;\;\;\;x + \frac{-1}{z \cdot \left(y \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
\end{array}
\end{array}
if y < -4.3999999999999998e213Initial program 68.4%
associate-+l-77.8%
sub-neg77.8%
log1p-def77.8%
neg-sub077.8%
associate-+l-77.8%
neg-sub077.8%
neg-mul-177.8%
*-commutative77.8%
distribute-rgt-out77.8%
+-commutative77.8%
metadata-eval77.8%
sub-neg77.8%
expm1-def99.8%
Simplified99.8%
Taylor expanded in y around inf 0.0%
+-commutative0.0%
associate-+l+0.0%
*-commutative0.0%
associate-/r*0.0%
expm1-def0.0%
mul-1-neg0.0%
log-rec0.0%
remove-double-neg0.0%
log-prod68.4%
expm1-def90.7%
expm1-def68.4%
*-commutative68.4%
expm1-def90.7%
Simplified90.7%
Taylor expanded in z around 0 39.3%
associate-*r*39.3%
Simplified39.3%
if -4.3999999999999998e213 < y Initial program 62.6%
associate-+l-74.2%
sub-neg74.2%
log1p-def82.4%
neg-sub082.4%
associate-+l-82.4%
neg-sub082.4%
neg-mul-182.4%
*-commutative82.4%
distribute-rgt-out82.4%
+-commutative82.4%
metadata-eval82.4%
sub-neg82.4%
expm1-def99.1%
Simplified99.1%
Taylor expanded in y around 0 77.6%
associate-/l*76.3%
associate-/r/77.6%
expm1-def91.2%
Simplified91.2%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.36e+78) (+ x (/ -1.0 (* z (* y t)))) (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.36e+78) {
tmp = x + (-1.0 / (z * (y * t)));
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.36d+78)) then
tmp = x + ((-1.0d0) / (z * (y * t)))
else
tmp = x - (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.36e+78) {
tmp = x + (-1.0 / (z * (y * t)));
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.36e+78: tmp = x + (-1.0 / (z * (y * t))) else: tmp = x - (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.36e+78) tmp = Float64(x + Float64(-1.0 / Float64(z * Float64(y * t)))); else tmp = Float64(x - Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.36e+78) tmp = x + (-1.0 / (z * (y * t))); else tmp = x - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.36e+78], N[(x + N[(-1.0 / N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{+78}:\\
\;\;\;\;x + \frac{-1}{z \cdot \left(y \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.35999999999999999e78Initial program 77.3%
associate-+l-77.3%
sub-neg77.3%
log1p-def99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
neg-mul-199.9%
*-commutative99.9%
distribute-rgt-out99.9%
+-commutative99.9%
metadata-eval99.9%
sub-neg99.9%
expm1-def99.9%
Simplified99.9%
Taylor expanded in y around inf 0.0%
+-commutative0.0%
associate-+l+0.0%
*-commutative0.0%
associate-/r*0.0%
expm1-def0.0%
mul-1-neg0.0%
log-rec0.0%
remove-double-neg0.0%
log-prod48.0%
expm1-def48.0%
expm1-def48.0%
*-commutative48.0%
expm1-def48.0%
Simplified48.0%
Taylor expanded in z around 0 56.4%
associate-*r*54.8%
Simplified54.8%
if -1.35999999999999999e78 < z Initial program 58.5%
associate-+l-73.6%
sub-neg73.6%
log1p-def76.1%
neg-sub076.1%
associate-+l-76.1%
neg-sub076.1%
neg-mul-176.1%
*-commutative76.1%
distribute-rgt-out76.1%
+-commutative76.1%
metadata-eval76.1%
sub-neg76.1%
expm1-def98.9%
Simplified98.9%
clear-num98.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in z around 0 84.5%
*-commutative84.5%
associate-/l*81.3%
associate-/r/84.9%
Simplified84.9%
Final simplification77.5%
(FPCore (x y z t) :precision binary64 (if (<= z -3.7e+77) (+ x (/ (/ -1.0 y) (* z t))) (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+77) {
tmp = x + ((-1.0 / y) / (z * t));
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.7d+77)) then
tmp = x + (((-1.0d0) / y) / (z * t))
else
tmp = x - (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+77) {
tmp = x + ((-1.0 / y) / (z * t));
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.7e+77: tmp = x + ((-1.0 / y) / (z * t)) else: tmp = x - (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+77) tmp = Float64(x + Float64(Float64(-1.0 / y) / Float64(z * t))); else tmp = Float64(x - Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.7e+77) tmp = x + ((-1.0 / y) / (z * t)); else tmp = x - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+77], N[(x + N[(N[(-1.0 / y), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+77}:\\
\;\;\;\;x + \frac{\frac{-1}{y}}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -3.69999999999999995e77Initial program 77.3%
associate-+l-77.3%
sub-neg77.3%
log1p-def99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
neg-mul-199.9%
*-commutative99.9%
distribute-rgt-out99.9%
+-commutative99.9%
metadata-eval99.9%
sub-neg99.9%
expm1-def99.9%
Simplified99.9%
Taylor expanded in y around inf 0.0%
+-commutative0.0%
associate-+l+0.0%
*-commutative0.0%
associate-/r*0.0%
expm1-def0.0%
mul-1-neg0.0%
log-rec0.0%
remove-double-neg0.0%
log-prod48.0%
expm1-def48.0%
expm1-def48.0%
*-commutative48.0%
expm1-def48.0%
Simplified48.0%
Taylor expanded in z around 0 56.4%
associate-/r*56.4%
*-commutative56.4%
Simplified56.4%
if -3.69999999999999995e77 < z Initial program 58.5%
associate-+l-73.6%
sub-neg73.6%
log1p-def76.1%
neg-sub076.1%
associate-+l-76.1%
neg-sub076.1%
neg-mul-176.1%
*-commutative76.1%
distribute-rgt-out76.1%
+-commutative76.1%
metadata-eval76.1%
sub-neg76.1%
expm1-def98.9%
Simplified98.9%
clear-num98.8%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in z around 0 84.5%
*-commutative84.5%
associate-/l*81.3%
associate-/r/84.9%
Simplified84.9%
Final simplification77.9%
(FPCore (x y z t) :precision binary64 (- x (* z (/ y t))))
double code(double x, double y, double z, double t) {
return x - (z * (y / 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 - (z * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x - (z * (y / t));
}
def code(x, y, z, t): return x - (z * (y / t))
function code(x, y, z, t) return Float64(x - Float64(z * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x - (z * (y / t)); end
code[x_, y_, z_, t_] := N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - z \cdot \frac{y}{t}
\end{array}
Initial program 63.1%
associate-+l-74.5%
sub-neg74.5%
log1p-def82.0%
neg-sub082.0%
associate-+l-82.0%
neg-sub082.0%
neg-mul-182.0%
*-commutative82.0%
distribute-rgt-out82.0%
+-commutative82.0%
metadata-eval82.0%
sub-neg82.0%
expm1-def99.1%
Simplified99.1%
Taylor expanded in z around 0 71.1%
associate-/l*71.7%
associate-/r/69.5%
Simplified69.5%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (- x (* y (/ z t))))
double code(double x, double y, double z, double t) {
return x - (y * (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 - (y * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x - (y * (z / t));
}
def code(x, y, z, t): return x - (y * (z / t))
function code(x, y, z, t) return Float64(x - Float64(y * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x - (y * (z / t)); end
code[x_, y_, z_, t_] := N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{z}{t}
\end{array}
Initial program 63.1%
associate-+l-74.5%
sub-neg74.5%
log1p-def82.0%
neg-sub082.0%
associate-+l-82.0%
neg-sub082.0%
neg-mul-182.0%
*-commutative82.0%
distribute-rgt-out82.0%
+-commutative82.0%
metadata-eval82.0%
sub-neg82.0%
expm1-def99.1%
Simplified99.1%
clear-num99.1%
associate-/r/99.0%
Applied egg-rr99.0%
Taylor expanded in z around 0 71.1%
*-commutative71.1%
associate-/l*70.1%
associate-/r/71.7%
Simplified71.7%
Final simplification71.7%
(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}
herbie shell --seed 2023200
(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)))