
(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 57.8%
sub-neg57.8%
associate-+l+73.4%
cancel-sign-sub73.4%
log1p-def80.1%
cancel-sign-sub80.1%
+-commutative80.1%
neg-mul-180.1%
metadata-eval80.1%
cancel-sign-sub-inv80.1%
*-commutative80.1%
distribute-lft-out--80.1%
expm1-def97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e-31) (+ x (/ -1.0 (+ (* t 0.5) (/ t (* y (+ (exp z) -1.0)))))) (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e-31) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0)))));
} 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.25d-31)) then
tmp = x + ((-1.0d0) / ((t * 0.5d0) + (t / (y * (exp(z) + (-1.0d0))))))
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.25e-31) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (Math.exp(z) + -1.0)))));
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e-31: tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (math.exp(z) + -1.0))))) else: tmp = x - (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e-31) tmp = Float64(x + Float64(-1.0 / Float64(Float64(t * 0.5) + Float64(t / Float64(y * Float64(exp(z) + -1.0)))))); 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.25e-31) tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0))))); else tmp = x - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e-31], N[(x + N[(-1.0 / N[(N[(t * 0.5), $MachinePrecision] + N[(t / N[(y * N[(N[Exp[z], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $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.25 \cdot 10^{-31}:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.25e-31Initial program 79.0%
sub-neg79.0%
associate-+l+80.2%
cancel-sign-sub80.2%
log1p-def98.1%
cancel-sign-sub98.1%
+-commutative98.1%
neg-mul-198.1%
metadata-eval98.1%
cancel-sign-sub-inv98.1%
*-commutative98.1%
distribute-lft-out--98.1%
expm1-def100.0%
Simplified100.0%
div-inv99.8%
*-commutative99.8%
Applied egg-rr99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 83.2%
if -1.25e-31 < z Initial program 47.7%
sub-neg47.7%
associate-+l+70.2%
cancel-sign-sub70.2%
log1p-def71.4%
cancel-sign-sub71.4%
+-commutative71.4%
neg-mul-171.4%
metadata-eval71.4%
cancel-sign-sub-inv71.4%
*-commutative71.4%
distribute-lft-out--71.4%
expm1-def96.0%
Simplified96.0%
div-inv96.1%
*-commutative96.1%
Applied egg-rr96.1%
associate-/r/96.0%
Applied egg-rr96.0%
Taylor expanded in z around 0 86.1%
associate-*r/88.7%
Simplified88.7%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (<= y -9.5e+171) x (- x (* (expm1 z) (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+171) {
tmp = x;
} else {
tmp = x - (expm1(z) * (y / t));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+171) {
tmp = x;
} else {
tmp = x - (Math.expm1(z) * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e+171: tmp = x else: tmp = x - (math.expm1(z) * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e+171) tmp = x; else tmp = Float64(x - Float64(expm1(z) * Float64(y / t))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e+171], x, N[(x - N[(N[(Exp[z] - 1), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+171}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{expm1}\left(z\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -9.49999999999999924e171Initial program 46.2%
sub-neg46.2%
associate-+l+66.6%
cancel-sign-sub66.6%
log1p-def66.6%
cancel-sign-sub66.6%
+-commutative66.6%
neg-mul-166.6%
metadata-eval66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
distribute-lft-out--66.6%
expm1-def99.7%
Simplified99.7%
Taylor expanded in x around inf 44.7%
if -9.49999999999999924e171 < y Initial program 59.3%
sub-neg59.3%
associate-+l+74.3%
cancel-sign-sub74.3%
log1p-def81.8%
cancel-sign-sub81.8%
+-commutative81.8%
neg-mul-181.8%
metadata-eval81.8%
cancel-sign-sub-inv81.8%
*-commutative81.8%
distribute-lft-out--81.8%
expm1-def97.0%
Simplified97.0%
Taylor expanded in y around 0 77.8%
associate-/l*77.8%
associate-/r/77.6%
expm1-def89.7%
Simplified89.7%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e+211) x (- x (/ (* y (expm1 z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+211) {
tmp = x;
} else {
tmp = x - ((y * expm1(z)) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+211) {
tmp = x;
} else {
tmp = x - ((y * Math.expm1(z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e+211: tmp = x else: tmp = x - ((y * math.expm1(z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+211) tmp = x; else tmp = Float64(x - Float64(Float64(y * expm1(z)) / t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+211], x, N[(x - N[(N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \mathsf{expm1}\left(z\right)}{t}\\
\end{array}
\end{array}
if y < -2.1e211Initial program 42.6%
sub-neg42.6%
associate-+l+60.1%
cancel-sign-sub60.1%
log1p-def60.1%
cancel-sign-sub60.1%
+-commutative60.1%
neg-mul-160.1%
metadata-eval60.1%
cancel-sign-sub-inv60.1%
*-commutative60.1%
distribute-lft-out--60.1%
expm1-def99.5%
Simplified99.5%
Taylor expanded in x around inf 42.9%
if -2.1e211 < y Initial program 58.9%
sub-neg58.9%
associate-+l+74.4%
cancel-sign-sub74.4%
log1p-def81.5%
cancel-sign-sub81.5%
+-commutative81.5%
neg-mul-181.5%
metadata-eval81.5%
cancel-sign-sub-inv81.5%
*-commutative81.5%
distribute-lft-out--81.5%
expm1-def97.1%
Simplified97.1%
Taylor expanded in y around 0 76.1%
expm1-def88.2%
Simplified88.2%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= x -6.2e-227) x (if (<= x 5.9e-263) (* y (/ (- z) t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.2e-227) {
tmp = x;
} else if (x <= 5.9e-263) {
tmp = y * (-z / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-6.2d-227)) then
tmp = x
else if (x <= 5.9d-263) then
tmp = y * (-z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.2e-227) {
tmp = x;
} else if (x <= 5.9e-263) {
tmp = y * (-z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.2e-227: tmp = x elif x <= 5.9e-263: tmp = y * (-z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.2e-227) tmp = x; elseif (x <= 5.9e-263) tmp = Float64(y * Float64(Float64(-z) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.2e-227) tmp = x; elseif (x <= 5.9e-263) tmp = y * (-z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.2e-227], x, If[LessEqual[x, 5.9e-263], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-227}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{-263}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.19999999999999959e-227 or 5.89999999999999972e-263 < x Initial program 61.4%
sub-neg61.4%
associate-+l+78.3%
cancel-sign-sub78.3%
log1p-def84.4%
cancel-sign-sub84.4%
+-commutative84.4%
neg-mul-184.4%
metadata-eval84.4%
cancel-sign-sub-inv84.4%
*-commutative84.4%
distribute-lft-out--84.4%
expm1-def97.8%
Simplified97.8%
Taylor expanded in x around inf 72.7%
if -6.19999999999999959e-227 < x < 5.89999999999999972e-263Initial program 20.5%
sub-neg20.5%
associate-+l+21.6%
cancel-sign-sub21.6%
log1p-def34.5%
cancel-sign-sub34.5%
+-commutative34.5%
neg-mul-134.5%
metadata-eval34.5%
cancel-sign-sub-inv34.5%
*-commutative34.5%
distribute-lft-out--34.5%
expm1-def92.2%
Simplified92.2%
Taylor expanded in z around 0 49.9%
associate-/l*53.0%
associate-/r/52.8%
Simplified52.8%
Taylor expanded in x around 0 41.6%
associate-*r/41.6%
neg-mul-141.6%
distribute-lft-neg-in41.6%
associate-*l/44.5%
Simplified44.5%
Taylor expanded in y around 0 41.6%
mul-1-neg41.6%
associate-*r/48.5%
distribute-rgt-neg-out48.5%
distribute-neg-frac48.5%
Simplified48.5%
Final simplification70.6%
(FPCore (x y z t) :precision binary64 (if (<= z -6.2e+59) x (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e+59) {
tmp = x;
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.2d+59)) then
tmp = x
else
tmp = x - (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e+59) {
tmp = x;
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e+59: tmp = x else: tmp = x - (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e+59) tmp = x; else tmp = Float64(x - Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.2e+59) tmp = x; else tmp = x - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e+59], x, N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -6.20000000000000029e59Initial program 84.4%
sub-neg84.4%
associate-+l+84.4%
cancel-sign-sub84.4%
log1p-def99.9%
cancel-sign-sub99.9%
+-commutative99.9%
neg-mul-199.9%
metadata-eval99.9%
cancel-sign-sub-inv99.9%
*-commutative99.9%
distribute-lft-out--99.9%
expm1-def99.9%
Simplified99.9%
Taylor expanded in x around inf 64.8%
if -6.20000000000000029e59 < z Initial program 49.4%
sub-neg49.4%
associate-+l+70.0%
cancel-sign-sub70.0%
log1p-def73.7%
cancel-sign-sub73.7%
+-commutative73.7%
neg-mul-173.7%
metadata-eval73.7%
cancel-sign-sub-inv73.7%
*-commutative73.7%
distribute-lft-out--73.7%
expm1-def96.5%
Simplified96.5%
div-inv96.5%
*-commutative96.5%
Applied egg-rr96.5%
associate-/r/96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 83.2%
associate-*r/85.5%
Simplified85.5%
Final simplification80.5%
(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}
Initial program 57.8%
sub-neg57.8%
associate-+l+73.4%
cancel-sign-sub73.4%
log1p-def80.1%
cancel-sign-sub80.1%
+-commutative80.1%
neg-mul-180.1%
metadata-eval80.1%
cancel-sign-sub-inv80.1%
*-commutative80.1%
distribute-lft-out--80.1%
expm1-def97.3%
Simplified97.3%
Taylor expanded in x around inf 67.6%
Final simplification67.6%
(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 2023301
(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)))