
(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 13 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.2%
associate-+l-75.0%
sub-neg75.0%
log1p-define78.9%
neg-sub078.9%
associate-+l-78.9%
neg-sub078.9%
+-commutative78.9%
unsub-neg78.9%
*-rgt-identity78.9%
distribute-lft-out--78.9%
expm1-define98.0%
Simplified98.0%
(FPCore (x y z t)
:precision binary64
(if (<= (exp z) 0.0)
(+ x (/ -1.0 (+ (* t 0.5) (/ t (* y (+ (exp z) -1.0))))))
(-
x
(/
(log1p
(*
z
(+
y
(*
z
(+
(* y 0.5)
(*
z
(+ (* 0.041666666666666664 (* y z)) (* y 0.16666666666666666))))))))
t))))
double code(double x, double y, double z, double t) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0)))));
} else {
tmp = x - (log1p((z * (y + (z * ((y * 0.5) + (z * ((0.041666666666666664 * (y * z)) + (y * 0.16666666666666666)))))))) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (Math.exp(z) + -1.0)))));
} else {
tmp = x - (Math.log1p((z * (y + (z * ((y * 0.5) + (z * ((0.041666666666666664 * (y * z)) + (y * 0.16666666666666666)))))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (math.exp(z) + -1.0))))) else: tmp = x - (math.log1p((z * (y + (z * ((y * 0.5) + (z * ((0.041666666666666664 * (y * z)) + (y * 0.16666666666666666)))))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (exp(z) <= 0.0) 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(log1p(Float64(z * Float64(y + Float64(z * Float64(Float64(y * 0.5) + Float64(z * Float64(Float64(0.041666666666666664 * Float64(y * z)) + Float64(y * 0.16666666666666666)))))))) / t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], 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[(N[Log[1 + N[(z * N[(y + N[(z * N[(N[(y * 0.5), $MachinePrecision] + N[(z * N[(N[(0.041666666666666664 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(z \cdot \left(y + z \cdot \left(y \cdot 0.5 + z \cdot \left(0.041666666666666664 \cdot \left(y \cdot z\right) + y \cdot 0.16666666666666666\right)\right)\right)\right)}{t}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 84.7%
associate-+l-84.7%
sub-neg84.7%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.3%
Taylor expanded in y around inf 84.5%
if 0.0 < (exp.f64 z) Initial program 55.8%
associate-+l-71.6%
sub-neg71.6%
log1p-define71.6%
neg-sub071.6%
associate-+l-71.6%
neg-sub071.6%
+-commutative71.6%
unsub-neg71.6%
*-rgt-identity71.6%
distribute-lft-out--71.6%
expm1-define97.4%
Simplified97.4%
Taylor expanded in z around 0 97.4%
Final simplification94.1%
(FPCore (x y z t) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ y (* t (+ (* y -0.5) (/ -1.0 (expm1 z)))))) (- x (/ (log1p (* z (+ y (* 0.5 (* y z))))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (y / (t * ((y * -0.5) + (-1.0 / expm1(z)))));
} else {
tmp = x - (log1p((z * (y + (0.5 * (y * z))))) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (y / (t * ((y * -0.5) + (-1.0 / Math.expm1(z)))));
} else {
tmp = x - (Math.log1p((z * (y + (0.5 * (y * z))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (y / (t * ((y * -0.5) + (-1.0 / math.expm1(z))))) else: tmp = x - (math.log1p((z * (y + (0.5 * (y * z))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(y / Float64(t * Float64(Float64(y * -0.5) + Float64(-1.0 / expm1(z)))))); else tmp = Float64(x - Float64(log1p(Float64(z * Float64(y + Float64(0.5 * Float64(y * z))))) / t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(y / N[(t * N[(N[(y * -0.5), $MachinePrecision] + N[(-1.0 / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[1 + N[(z * N[(y + N[(0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{y}{t \cdot \left(y \cdot -0.5 + \frac{-1}{\mathsf{expm1}\left(z\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(z \cdot \left(y + 0.5 \cdot \left(y \cdot z\right)\right)\right)}{t}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 84.7%
associate-+l-84.7%
sub-neg84.7%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.3%
Taylor expanded in t around -inf 84.4%
associate-*r/84.4%
neg-mul-184.4%
*-commutative84.4%
expm1-define84.4%
Simplified84.4%
if 0.0 < (exp.f64 z) Initial program 55.8%
associate-+l-71.6%
sub-neg71.6%
log1p-define71.6%
neg-sub071.6%
associate-+l-71.6%
neg-sub071.6%
+-commutative71.6%
unsub-neg71.6%
*-rgt-identity71.6%
distribute-lft-out--71.6%
expm1-define97.4%
Simplified97.4%
Taylor expanded in z around 0 97.2%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.8e+38)
(+ x (/ -1.0 (+ (* t 0.5) (/ t (* y (+ (exp z) -1.0))))))
(-
x
(/
(log1p (* z (+ y (* z (+ (* y 0.5) (* (* y z) 0.16666666666666666))))))
t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+38) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0)))));
} else {
tmp = x - (log1p((z * (y + (z * ((y * 0.5) + ((y * z) * 0.16666666666666666)))))) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+38) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (Math.exp(z) + -1.0)))));
} else {
tmp = x - (Math.log1p((z * (y + (z * ((y * 0.5) + ((y * z) * 0.16666666666666666)))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+38: tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (math.exp(z) + -1.0))))) else: tmp = x - (math.log1p((z * (y + (z * ((y * 0.5) + ((y * z) * 0.16666666666666666)))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+38) 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(log1p(Float64(z * Float64(y + Float64(z * Float64(Float64(y * 0.5) + Float64(Float64(y * z) * 0.16666666666666666)))))) / t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+38], 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[(N[Log[1 + N[(z * N[(y + N[(z * N[(N[(y * 0.5), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(z \cdot \left(y + z \cdot \left(y \cdot 0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right)\right)\right)}{t}\\
\end{array}
\end{array}
if z < -3.7999999999999998e38Initial program 82.9%
associate-+l-82.9%
sub-neg82.9%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 85.6%
Taylor expanded in y around inf 85.8%
if -3.7999999999999998e38 < z Initial program 57.3%
associate-+l-72.6%
sub-neg72.6%
log1p-define72.6%
neg-sub072.6%
associate-+l-72.6%
neg-sub072.6%
+-commutative72.6%
unsub-neg72.6%
*-rgt-identity72.6%
distribute-lft-out--72.6%
expm1-define97.5%
Simplified97.5%
Taylor expanded in z around 0 96.6%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -7e-23)
(+ x (/ -1.0 (/ (/ (+ t (* z (* 0.5 (- (* y t) t)))) z) y)))
(if (<= y 2e+39)
(- x (* y (/ (expm1 z) t)))
(- x (/ (log1p (* z (+ y (* 0.5 (* y z))))) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-23) {
tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y));
} else if (y <= 2e+39) {
tmp = x - (y * (expm1(z) / t));
} else {
tmp = x - (log1p((z * (y + (0.5 * (y * z))))) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-23) {
tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y));
} else if (y <= 2e+39) {
tmp = x - (y * (Math.expm1(z) / t));
} else {
tmp = x - (Math.log1p((z * (y + (0.5 * (y * z))))) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e-23: tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y)) elif y <= 2e+39: tmp = x - (y * (math.expm1(z) / t)) else: tmp = x - (math.log1p((z * (y + (0.5 * (y * z))))) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e-23) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(t + Float64(z * Float64(0.5 * Float64(Float64(y * t) - t)))) / z) / y))); elseif (y <= 2e+39) tmp = Float64(x - Float64(y * Float64(expm1(z) / t))); else tmp = Float64(x - Float64(log1p(Float64(z * Float64(y + Float64(0.5 * Float64(y * z))))) / t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e-23], N[(x + N[(-1.0 / N[(N[(N[(t + N[(z * N[(0.5 * N[(N[(y * t), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+39], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[1 + N[(z * N[(y + N[(0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t + z \cdot \left(0.5 \cdot \left(y \cdot t - t\right)\right)}{z}}{y}}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+39}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(z \cdot \left(y + 0.5 \cdot \left(y \cdot z\right)\right)\right)}{t}\\
\end{array}
\end{array}
if y < -6.99999999999999987e-23Initial program 47.0%
associate-+l-70.2%
sub-neg70.2%
log1p-define70.2%
neg-sub070.2%
associate-+l-70.2%
neg-sub070.2%
+-commutative70.2%
unsub-neg70.2%
*-rgt-identity70.2%
distribute-lft-out--70.2%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.8%
Applied egg-rr99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.8%
Taylor expanded in z around 0 73.3%
distribute-lft-out--73.3%
*-commutative73.3%
Simplified73.3%
if -6.99999999999999987e-23 < y < 1.99999999999999988e39Initial program 80.2%
associate-+l-82.2%
sub-neg82.2%
log1p-define88.4%
neg-sub088.4%
associate-+l-88.4%
neg-sub088.4%
+-commutative88.4%
unsub-neg88.4%
*-rgt-identity88.4%
distribute-lft-out--88.4%
expm1-define97.0%
Simplified97.0%
Taylor expanded in y around 0 87.8%
associate-/l*87.7%
expm1-define98.7%
Simplified98.7%
if 1.99999999999999988e39 < y Initial program 9.7%
associate-+l-47.9%
sub-neg47.9%
log1p-define47.9%
neg-sub047.9%
associate-+l-47.9%
neg-sub047.9%
+-commutative47.9%
unsub-neg47.9%
*-rgt-identity47.9%
distribute-lft-out--47.8%
expm1-define99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (<= z -6.6) (+ x (/ -1.0 (+ (* t 0.5) (/ t (* y (+ (exp z) -1.0)))))) (- x (* (/ 1.0 t) (log1p (* z (+ y (* 0.5 (* y z)))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (exp(z) + -1.0)))));
} else {
tmp = x - ((1.0 / t) * log1p((z * (y + (0.5 * (y * z))))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6) {
tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (Math.exp(z) + -1.0)))));
} else {
tmp = x - ((1.0 / t) * Math.log1p((z * (y + (0.5 * (y * z))))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.6: tmp = x + (-1.0 / ((t * 0.5) + (t / (y * (math.exp(z) + -1.0))))) else: tmp = x - ((1.0 / t) * math.log1p((z * (y + (0.5 * (y * z)))))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.6) 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(Float64(1.0 / t) * log1p(Float64(z * Float64(y + Float64(0.5 * Float64(y * z))))))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.6], 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[(N[(1.0 / t), $MachinePrecision] * N[Log[1 + N[(z * N[(y + N[(0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6:\\
\;\;\;\;x + \frac{-1}{t \cdot 0.5 + \frac{t}{y \cdot \left(e^{z} + -1\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{t} \cdot \mathsf{log1p}\left(z \cdot \left(y + 0.5 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -6.5999999999999996Initial program 84.7%
associate-+l-84.7%
sub-neg84.7%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.3%
Taylor expanded in y around inf 84.5%
if -6.5999999999999996 < z Initial program 55.8%
associate-+l-71.6%
sub-neg71.6%
log1p-define71.6%
neg-sub071.6%
associate-+l-71.6%
neg-sub071.6%
+-commutative71.6%
unsub-neg71.6%
*-rgt-identity71.6%
distribute-lft-out--71.6%
expm1-define97.4%
Simplified97.4%
clear-num97.3%
associate-/r/97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 97.3%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (<= z -6.6) (+ x (/ y (* t (+ (* y -0.5) (/ -1.0 (expm1 z)))))) (- x (* (/ 1.0 t) (log1p (* z (+ y (* 0.5 (* y z)))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6) {
tmp = x + (y / (t * ((y * -0.5) + (-1.0 / expm1(z)))));
} else {
tmp = x - ((1.0 / t) * log1p((z * (y + (0.5 * (y * z))))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6) {
tmp = x + (y / (t * ((y * -0.5) + (-1.0 / Math.expm1(z)))));
} else {
tmp = x - ((1.0 / t) * Math.log1p((z * (y + (0.5 * (y * z))))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.6: tmp = x + (y / (t * ((y * -0.5) + (-1.0 / math.expm1(z))))) else: tmp = x - ((1.0 / t) * math.log1p((z * (y + (0.5 * (y * z)))))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.6) tmp = Float64(x + Float64(y / Float64(t * Float64(Float64(y * -0.5) + Float64(-1.0 / expm1(z)))))); else tmp = Float64(x - Float64(Float64(1.0 / t) * log1p(Float64(z * Float64(y + Float64(0.5 * Float64(y * z))))))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.6], N[(x + N[(y / N[(t * N[(N[(y * -0.5), $MachinePrecision] + N[(-1.0 / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(1.0 / t), $MachinePrecision] * N[Log[1 + N[(z * N[(y + N[(0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6:\\
\;\;\;\;x + \frac{y}{t \cdot \left(y \cdot -0.5 + \frac{-1}{\mathsf{expm1}\left(z\right)}\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{t} \cdot \mathsf{log1p}\left(z \cdot \left(y + 0.5 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -6.5999999999999996Initial program 84.7%
associate-+l-84.7%
sub-neg84.7%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 84.3%
Taylor expanded in t around -inf 84.4%
associate-*r/84.4%
neg-mul-184.4%
*-commutative84.4%
expm1-define84.4%
Simplified84.4%
if -6.5999999999999996 < z Initial program 55.8%
associate-+l-71.6%
sub-neg71.6%
log1p-define71.6%
neg-sub071.6%
associate-+l-71.6%
neg-sub071.6%
+-commutative71.6%
unsub-neg71.6%
*-rgt-identity71.6%
distribute-lft-out--71.6%
expm1-define97.4%
Simplified97.4%
clear-num97.3%
associate-/r/97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 97.3%
Final simplification93.9%
(FPCore (x y z t) :precision binary64 (if (<= y -7e-23) (+ x (/ -1.0 (/ (/ (+ t (* z (* 0.5 (- (* y t) t)))) z) y))) (- x (* y (/ (expm1 z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e-23) {
tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / 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 <= -7e-23) {
tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y));
} else {
tmp = x - (y * (Math.expm1(z) / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e-23: tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y)) else: tmp = x - (y * (math.expm1(z) / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e-23) tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(t + Float64(z * Float64(0.5 * Float64(Float64(y * t) - t)))) / z) / y))); else tmp = Float64(x - Float64(y * Float64(expm1(z) / t))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e-23], N[(x + N[(-1.0 / N[(N[(N[(t + N[(z * N[(0.5 * N[(N[(y * t), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $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 -7 \cdot 10^{-23}:\\
\;\;\;\;x + \frac{-1}{\frac{\frac{t + z \cdot \left(0.5 \cdot \left(y \cdot t - t\right)\right)}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
\end{array}
\end{array}
if y < -6.99999999999999987e-23Initial program 47.0%
associate-+l-70.2%
sub-neg70.2%
log1p-define70.2%
neg-sub070.2%
associate-+l-70.2%
neg-sub070.2%
+-commutative70.2%
unsub-neg70.2%
*-rgt-identity70.2%
distribute-lft-out--70.2%
expm1-define99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.8%
Applied egg-rr99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 43.8%
Taylor expanded in z around 0 73.3%
distribute-lft-out--73.3%
*-commutative73.3%
Simplified73.3%
if -6.99999999999999987e-23 < y Initial program 68.5%
associate-+l-76.5%
sub-neg76.5%
log1p-define81.7%
neg-sub081.7%
associate-+l-81.7%
neg-sub081.7%
+-commutative81.7%
unsub-neg81.7%
*-rgt-identity81.7%
distribute-lft-out--81.7%
expm1-define97.5%
Simplified97.5%
Taylor expanded in y around 0 80.5%
associate-/l*80.4%
expm1-define93.5%
Simplified93.5%
Final simplification88.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.22e+99) x (+ x (/ -1.0 (/ (+ (* 0.5 (* y t)) (/ t z)) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.22e+99) {
tmp = x;
} else {
tmp = x + (-1.0 / (((0.5 * (y * t)) + (t / z)) / y));
}
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.22d+99)) then
tmp = x
else
tmp = x + ((-1.0d0) / (((0.5d0 * (y * t)) + (t / z)) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.22e+99) {
tmp = x;
} else {
tmp = x + (-1.0 / (((0.5 * (y * t)) + (t / z)) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.22e+99: tmp = x else: tmp = x + (-1.0 / (((0.5 * (y * t)) + (t / z)) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.22e+99) tmp = x; else tmp = Float64(x + Float64(-1.0 / Float64(Float64(Float64(0.5 * Float64(y * t)) + Float64(t / z)) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.22e+99) tmp = x; else tmp = x + (-1.0 / (((0.5 * (y * t)) + (t / z)) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.22e+99], x, N[(x + N[(-1.0 / N[(N[(N[(0.5 * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{\frac{0.5 \cdot \left(y \cdot t\right) + \frac{t}{z}}{y}}\\
\end{array}
\end{array}
if z < -1.2199999999999999e99Initial program 81.9%
associate-+l-81.9%
sub-neg81.9%
log1p-define99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
*-rgt-identity99.9%
distribute-lft-out--99.9%
expm1-define99.9%
Simplified99.9%
Taylor expanded in y around 0 75.3%
Taylor expanded in x around inf 68.7%
if -1.2199999999999999e99 < z Initial program 59.4%
associate-+l-73.5%
sub-neg73.5%
log1p-define74.5%
neg-sub074.5%
associate-+l-74.5%
neg-sub074.5%
+-commutative74.5%
unsub-neg74.5%
*-rgt-identity74.5%
distribute-lft-out--74.5%
expm1-define97.6%
Simplified97.6%
clear-num97.6%
associate-/r/97.7%
Applied egg-rr97.7%
associate-*l/97.6%
*-un-lft-identity97.6%
clear-num97.6%
Applied egg-rr97.6%
Taylor expanded in y around 0 68.4%
Taylor expanded in z around 0 88.3%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (+ x (/ -1.0 (/ (/ (+ t (* z (* 0.5 (- (* y t) t)))) z) y))))
double code(double x, double y, double z, double t) {
return x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y));
}
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 * (0.5d0 * ((y * t) - t)))) / z) / y))
end function
public static double code(double x, double y, double z, double t) {
return x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y));
}
def code(x, y, z, t): return x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y))
function code(x, y, z, t) return Float64(x + Float64(-1.0 / Float64(Float64(Float64(t + Float64(z * Float64(0.5 * Float64(Float64(y * t) - t)))) / z) / y))) end
function tmp = code(x, y, z, t) tmp = x + (-1.0 / (((t + (z * (0.5 * ((y * t) - t)))) / z) / y)); end
code[x_, y_, z_, t_] := N[(x + N[(-1.0 / N[(N[(N[(t + N[(z * N[(0.5 * N[(N[(y * t), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\frac{\frac{t + z \cdot \left(0.5 \cdot \left(y \cdot t - t\right)\right)}{z}}{y}}
\end{array}
Initial program 63.2%
associate-+l-75.0%
sub-neg75.0%
log1p-define78.9%
neg-sub078.9%
associate-+l-78.9%
neg-sub078.9%
+-commutative78.9%
unsub-neg78.9%
*-rgt-identity78.9%
distribute-lft-out--78.9%
expm1-define98.0%
Simplified98.0%
clear-num98.0%
associate-/r/98.0%
Applied egg-rr98.0%
associate-*l/98.0%
*-un-lft-identity98.0%
clear-num98.0%
Applied egg-rr98.0%
Taylor expanded in y around 0 72.0%
Taylor expanded in z around 0 86.2%
distribute-lft-out--86.2%
*-commutative86.2%
Simplified86.2%
Final simplification86.2%
(FPCore (x y z t) :precision binary64 (if (<= z -0.0012) x (- x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.0012) {
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 <= (-0.0012d0)) 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 <= -0.0012) {
tmp = x;
} else {
tmp = x - (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.0012: tmp = x else: tmp = x - (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.0012) 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 <= -0.0012) tmp = x; else tmp = x - (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.0012], x, N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0012:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -0.00119999999999999989Initial program 85.5%
associate-+l-85.5%
sub-neg85.5%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
Taylor expanded in y around 0 71.4%
Taylor expanded in x around inf 66.3%
if -0.00119999999999999989 < z Initial program 54.8%
associate-+l-71.0%
sub-neg71.0%
log1p-define71.0%
neg-sub071.0%
associate-+l-71.0%
neg-sub071.0%
+-commutative71.0%
unsub-neg71.0%
*-rgt-identity71.0%
distribute-lft-out--71.0%
expm1-define97.4%
Simplified97.4%
Taylor expanded in z around 0 87.7%
associate-/l*90.2%
Simplified90.2%
clear-num90.2%
un-div-inv90.2%
Applied egg-rr90.2%
(FPCore (x y z t) :precision binary64 (if (<= z -0.00135) x (- x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.00135) {
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 <= (-0.00135d0)) 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 <= -0.00135) {
tmp = x;
} else {
tmp = x - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.00135: tmp = x else: tmp = x - (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.00135) 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 <= -0.00135) tmp = x; else tmp = x - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.00135], x, N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00135:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -0.0013500000000000001Initial program 85.5%
associate-+l-85.5%
sub-neg85.5%
log1p-define99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
*-rgt-identity99.8%
distribute-lft-out--99.8%
expm1-define99.8%
Simplified99.8%
Taylor expanded in y around 0 71.4%
Taylor expanded in x around inf 66.3%
if -0.0013500000000000001 < z Initial program 54.8%
associate-+l-71.0%
sub-neg71.0%
log1p-define71.0%
neg-sub071.0%
associate-+l-71.0%
neg-sub071.0%
+-commutative71.0%
unsub-neg71.0%
*-rgt-identity71.0%
distribute-lft-out--71.0%
expm1-define97.4%
Simplified97.4%
Taylor expanded in z around 0 87.7%
associate-/l*90.2%
Simplified90.2%
(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 63.2%
associate-+l-75.0%
sub-neg75.0%
log1p-define78.9%
neg-sub078.9%
associate-+l-78.9%
neg-sub078.9%
+-commutative78.9%
unsub-neg78.9%
*-rgt-identity78.9%
distribute-lft-out--78.9%
expm1-define98.0%
Simplified98.0%
Taylor expanded in y around 0 70.6%
Taylor expanded in x around inf 69.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 2024100
(FPCore (x y z t)
:name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
:precision binary64
:alt
(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)))