
(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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
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}
Herbie found 6 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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
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
(let* ((t_1 (* (expm1 z) y)))
(if (<= y -9.5e+72)
(- x (/ (log t_1) t))
(if (<= y 7.5e+166) (- x (/ t_1 t)) (- x (/ (log (fma z y 1.0)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = expm1(z) * y;
double tmp;
if (y <= -9.5e+72) {
tmp = x - (log(t_1) / t);
} else if (y <= 7.5e+166) {
tmp = x - (t_1 / t);
} else {
tmp = x - (log(fma(z, y, 1.0)) / t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(expm1(z) * y) tmp = 0.0 if (y <= -9.5e+72) tmp = Float64(x - Float64(log(t_1) / t)); elseif (y <= 7.5e+166) tmp = Float64(x - Float64(t_1 / t)); else tmp = Float64(x - Float64(log(fma(z, y, 1.0)) / t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(Exp[z] - 1), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -9.5e+72], N[(x - N[(N[Log[t$95$1], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+166], N[(x - N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(z * y + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{expm1}\left(z\right) \cdot y\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+72}:\\
\;\;\;\;x - \frac{\log t\_1}{t}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+166}:\\
\;\;\;\;x - \frac{t\_1}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\
\end{array}
\end{array}
if y < -9.50000000000000054e72Initial program 61.5%
Taylor expanded in y around inf
+-commutativeN/A
log-pow-revN/A
sum-logN/A
unpow-1N/A
inv-powN/A
pow-negN/A
metadata-evalN/A
unpow1N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-expm1.f6435.1
Applied rewrites35.1%
if -9.50000000000000054e72 < y < 7.50000000000000029e166Initial program 61.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-expm1.f6485.5
Applied rewrites85.5%
if 7.50000000000000029e166 < y Initial program 61.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6470.8
Applied rewrites70.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ (log (fma z y 1.0)) t))))
(if (<= y -1.8e+58)
t_1
(if (<= y 7.5e+166) (- x (/ (* (expm1 z) y) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x - (log(fma(z, y, 1.0)) / t);
double tmp;
if (y <= -1.8e+58) {
tmp = t_1;
} else if (y <= 7.5e+166) {
tmp = x - ((expm1(z) * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x - Float64(log(fma(z, y, 1.0)) / t)) tmp = 0.0 if (y <= -1.8e+58) tmp = t_1; elseif (y <= 7.5e+166) tmp = Float64(x - Float64(Float64(expm1(z) * y) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(N[Log[N[(z * y + 1.0), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+58], t$95$1, If[LessEqual[y, 7.5e+166], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{\log \left(\mathsf{fma}\left(z, y, 1\right)\right)}{t}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+166}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.79999999999999998e58 or 7.50000000000000029e166 < y Initial program 61.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6470.8
Applied rewrites70.8%
if -1.79999999999999998e58 < y < 7.50000000000000029e166Initial program 61.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-expm1.f6485.5
Applied rewrites85.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ (log (* z y)) t))))
(if (<= y -9e+73)
t_1
(if (<= y 3.1e+229) (- x (/ (* (expm1 z) y) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x - (log((z * y)) / t);
double tmp;
if (y <= -9e+73) {
tmp = t_1;
} else if (y <= 3.1e+229) {
tmp = x - ((expm1(z) * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x - (Math.log((z * y)) / t);
double tmp;
if (y <= -9e+73) {
tmp = t_1;
} else if (y <= 3.1e+229) {
tmp = x - ((Math.expm1(z) * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (math.log((z * y)) / t) tmp = 0 if y <= -9e+73: tmp = t_1 elif y <= 3.1e+229: tmp = x - ((math.expm1(z) * y) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(log(Float64(z * y)) / t)) tmp = 0.0 if (y <= -9e+73) tmp = t_1; elseif (y <= 3.1e+229) tmp = Float64(x - Float64(Float64(expm1(z) * y) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+73], t$95$1, If[LessEqual[y, 3.1e+229], N[(x - N[(N[(N[(Exp[z] - 1), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{\log \left(z \cdot y\right)}{t}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+229}:\\
\;\;\;\;x - \frac{\mathsf{expm1}\left(z\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.99999999999999969e73 or 3.10000000000000014e229 < y Initial program 61.5%
Taylor expanded in y around inf
+-commutativeN/A
log-pow-revN/A
sum-logN/A
unpow-1N/A
inv-powN/A
pow-negN/A
metadata-evalN/A
unpow1N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-expm1.f6435.1
Applied rewrites35.1%
Taylor expanded in z around 0
Applied rewrites28.6%
if -8.99999999999999969e73 < y < 3.10000000000000014e229Initial program 61.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-expm1.f6485.5
Applied rewrites85.5%
(FPCore (x y z t) :precision binary64 (if (<= (exp z) 0.9999999995) (- (- x)) (fma (/ (- z) t) y x)))
double code(double x, double y, double z, double t) {
double tmp;
if (exp(z) <= 0.9999999995) {
tmp = -(-x);
} else {
tmp = fma((-z / t), y, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (exp(z) <= 0.9999999995) tmp = Float64(-Float64(-x)); else tmp = fma(Float64(Float64(-z) / t), y, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.9999999995], (-(-x)), N[(N[((-z) / t), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0.9999999995:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-z}{t}, y, x\right)\\
\end{array}
\end{array}
if (exp.f64 z) < 0.99999999949999996Initial program 61.5%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.1%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6471.6
Applied rewrites71.6%
if 0.99999999949999996 < (exp.f64 z) Initial program 61.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lift-exp.f6475.5
Applied rewrites75.5%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6474.7
Applied rewrites74.7%
(FPCore (x y z t) :precision binary64 (if (<= (exp z) 0.9999999995) (- (- x)) (- x (/ (* z y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (exp(z) <= 0.9999999995) {
tmp = -(-x);
} else {
tmp = x - ((z * y) / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (exp(z) <= 0.9999999995d0) 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 (Math.exp(z) <= 0.9999999995) {
tmp = -(-x);
} else {
tmp = x - ((z * y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if math.exp(z) <= 0.9999999995: tmp = -(-x) else: tmp = x - ((z * y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (exp(z) <= 0.9999999995) tmp = Float64(-Float64(-x)); else tmp = Float64(x - Float64(Float64(z * y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (exp(z) <= 0.9999999995) tmp = -(-x); else tmp = x - ((z * y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.9999999995], (-(-x)), N[(x - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0.9999999995:\\
\;\;\;\;-\left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{t}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.99999999949999996Initial program 61.5%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.1%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6471.6
Applied rewrites71.6%
if 0.99999999949999996 < (exp.f64 z) Initial program 61.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6474.0
Applied rewrites74.0%
(FPCore (x y z t) :precision binary64 (- (- x)))
double code(double x, double y, double z, double t) {
return -(-x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
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 Float64(-Float64(-x)) end
function tmp = code(x, y, z, t) tmp = -(-x); end
code[x_, y_, z_, t_] := (-(-x))
\begin{array}{l}
\\
-\left(-x\right)
\end{array}
Initial program 61.5%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.1%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6471.6
Applied rewrites71.6%
herbie shell --seed 2025140
(FPCore (x y z t)
:name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
:precision binary64
(- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))