
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (fma (* (fma -0.3333333333333333 y -0.5) (- z 1.0)) y (fma -1.0 z 1.0)) y (fma (- x 1.0) (log y) (- t))))
double code(double x, double y, double z, double t) {
return fma(fma((fma(-0.3333333333333333, y, -0.5) * (z - 1.0)), y, fma(-1.0, z, 1.0)), y, fma((x - 1.0), log(y), -t));
}
function code(x, y, z, t) return fma(fma(Float64(fma(-0.3333333333333333, y, -0.5) * Float64(z - 1.0)), y, fma(-1.0, z, 1.0)), y, fma(Float64(x - 1.0), log(y), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-0.3333333333333333 * y + -0.5), $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * y + N[(-1.0 * z + 1.0), $MachinePrecision]), $MachinePrecision] * y + N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, y, -0.5\right) \cdot \left(z - 1\right), y, \mathsf{fma}\left(-1, z, 1\right)\right), y, \mathsf{fma}\left(x - 1, \log y, -t\right)\right)
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y)))))
(if (<= t_2 -2e+124)
t_1
(if (<= t_2 350.0)
(- (fma (- z) y y) t)
(if (<= t_2 4000000000000.0) (- (- y (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = (log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y));
double tmp;
if (t_2 <= -2e+124) {
tmp = t_1;
} else if (t_2 <= 350.0) {
tmp = fma(-z, y, y) - t;
} else if (t_2 <= 4000000000000.0) {
tmp = (y - log(y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y))) tmp = 0.0 if (t_2 <= -2e+124) tmp = t_1; elseif (t_2 <= 350.0) tmp = Float64(fma(Float64(-z), y, y) - t); elseif (t_2 <= 4000000000000.0) tmp = Float64(Float64(y - log(y)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+124], t$95$1, If[LessEqual[t$95$2, 350.0], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 4000000000000.0], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 350:\\
\;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\
\mathbf{elif}\;t\_2 \leq 4000000000000:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.9999999999999999e124 or 4e12 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) Initial program 95.7%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.9
Applied rewrites79.9%
if -1.9999999999999999e124 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 350Initial program 71.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.5
Applied rewrites99.5%
Taylor expanded in y around inf
Applied rewrites64.4%
if 350 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 4e12Initial program 89.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites98.0%
Taylor expanded in z around 0
Applied rewrites87.1%
Final simplification76.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y)))))
(if (<= t_2 -2e+124)
t_1
(if (<= t_2 350.0)
(- (fma (- z) y y) t)
(if (<= t_2 4000000000000.0) (- (- (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = (log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y));
double tmp;
if (t_2 <= -2e+124) {
tmp = t_1;
} else if (t_2 <= 350.0) {
tmp = fma(-z, y, y) - t;
} else if (t_2 <= 4000000000000.0) {
tmp = -log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y))) tmp = 0.0 if (t_2 <= -2e+124) tmp = t_1; elseif (t_2 <= 350.0) tmp = Float64(fma(Float64(-z), y, y) - t); elseif (t_2 <= 4000000000000.0) tmp = Float64(Float64(-log(y)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+124], t$95$1, If[LessEqual[t$95$2, 350.0], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 4000000000000.0], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 350:\\
\;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\
\mathbf{elif}\;t\_2 \leq 4000000000000:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < -1.9999999999999999e124 or 4e12 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) Initial program 95.7%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.9
Applied rewrites79.9%
if -1.9999999999999999e124 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 350Initial program 71.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.5
Applied rewrites99.5%
Taylor expanded in y around inf
Applied rewrites64.4%
if 350 < (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) < 4e12Initial program 89.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites98.0%
Taylor expanded in y around 0
Applied rewrites87.1%
Final simplification76.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (log y) x) t))
(t_2 (- (- (* (log (- 1.0 y)) (- z 1.0)) (* (- 1.0 x) (log y))) t)))
(if (<= t_2 -10000000000000.0)
t_1
(if (<= t_2 2000.0) (- (- y (log y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * x) - t;
double t_2 = ((log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y))) - t;
double tmp;
if (t_2 <= -10000000000000.0) {
tmp = t_1;
} else if (t_2 <= 2000.0) {
tmp = (y - log(y)) - t;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = (log(y) * x) - t
t_2 = ((log((1.0d0 - y)) * (z - 1.0d0)) - ((1.0d0 - x) * log(y))) - t
if (t_2 <= (-10000000000000.0d0)) then
tmp = t_1
else if (t_2 <= 2000.0d0) then
tmp = (y - log(y)) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.log(y) * x) - t;
double t_2 = ((Math.log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * Math.log(y))) - t;
double tmp;
if (t_2 <= -10000000000000.0) {
tmp = t_1;
} else if (t_2 <= 2000.0) {
tmp = (y - Math.log(y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (math.log(y) * x) - t t_2 = ((math.log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * math.log(y))) - t tmp = 0 if t_2 <= -10000000000000.0: tmp = t_1 elif t_2 <= 2000.0: tmp = (y - math.log(y)) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * x) - t) t_2 = Float64(Float64(Float64(log(Float64(1.0 - y)) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y))) - t) tmp = 0.0 if (t_2 <= -10000000000000.0) tmp = t_1; elseif (t_2 <= 2000.0) tmp = Float64(Float64(y - log(y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (log(y) * x) - t; t_2 = ((log((1.0 - y)) * (z - 1.0)) - ((1.0 - x) * log(y))) - t; tmp = 0.0; if (t_2 <= -10000000000000.0) tmp = t_1; elseif (t_2 <= 2000.0) tmp = (y - log(y)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$2, -10000000000000.0], t$95$1, If[LessEqual[t$95$2, 2000.0], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x - t\\
t_2 := \left(\log \left(1 - y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\right) - t\\
\mathbf{if}\;t\_2 \leq -10000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2000:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -1e13 or 2e3 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) Initial program 89.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6488.5
Applied rewrites88.5%
if -1e13 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 2e3Initial program 72.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
Applied rewrites97.5%
Taylor expanded in z around 0
Applied rewrites69.3%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (- (- (* (* (fma (fma -0.3333333333333333 y -0.5) y -1.0) y) (- z 1.0)) (* (- 1.0 x) (log y))) t))
double code(double x, double y, double z, double t) {
return (((fma(fma(-0.3333333333333333, y, -0.5), y, -1.0) * y) * (z - 1.0)) - ((1.0 - x) * log(y))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(fma(fma(-0.3333333333333333, y, -0.5), y, -1.0) * y) * Float64(z - 1.0)) - Float64(Float64(1.0 - x) * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(N[(-0.3333333333333333 * y + -0.5), $MachinePrecision] * y + -1.0), $MachinePrecision] * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, -1\right) \cdot y\right) \cdot \left(z - 1\right) - \left(1 - x\right) \cdot \log y\right) - t
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- x 1.0) (log y) (- t))))
(if (<= (- x 1.0) -300000000.0)
t_1
(if (<= (- x 1.0) -0.99999999999999)
(fma (- 1.0 z) y (- (+ (log y) t)))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma((x - 1.0), log(y), -t);
double tmp;
if ((x - 1.0) <= -300000000.0) {
tmp = t_1;
} else if ((x - 1.0) <= -0.99999999999999) {
tmp = fma((1.0 - z), y, -(log(y) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(x - 1.0), log(y), Float64(-t)) tmp = 0.0 if (Float64(x - 1.0) <= -300000000.0) tmp = t_1; elseif (Float64(x - 1.0) <= -0.99999999999999) tmp = fma(Float64(1.0 - z), y, Float64(-Float64(log(y) + t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -300000000.0], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], -0.99999999999999], N[(N[(1.0 - z), $MachinePrecision] * y + (-N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision])), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\
\mathbf{if}\;x - 1 \leq -300000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x - 1 \leq -0.99999999999999:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, -\left(\log y + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -3e8 or -0.99999999999999001 < (-.f64 x #s(literal 1 binary64)) Initial program 91.4%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
if -3e8 < (-.f64 x #s(literal 1 binary64)) < -0.99999999999999001Initial program 78.8%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
associate--l+N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
sub-negN/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
+-commutativeN/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in x around 0
Applied rewrites98.6%
(FPCore (x y z t) :precision binary64 (- (fma (* (- z 1.0) y) (fma -0.5 y -1.0) (* (log y) (- x 1.0))) t))
double code(double x, double y, double z, double t) {
return fma(((z - 1.0) * y), fma(-0.5, y, -1.0), (log(y) * (x - 1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(Float64(z - 1.0) * y), fma(-0.5, y, -1.0), Float64(log(y) * Float64(x - 1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(z - 1.0), $MachinePrecision] * y), $MachinePrecision] * N[(-0.5 * y + -1.0), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(z - 1\right) \cdot y, \mathsf{fma}\left(-0.5, y, -1\right), \log y \cdot \left(x - 1\right)\right) - t
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (- x 1.0) (log y) (- t))))
(if (<= (- x 1.0) -300000000.0)
t_1
(if (<= (- x 1.0) -0.99999999999999) (- (- y (fma y z (log y))) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma((x - 1.0), log(y), -t);
double tmp;
if ((x - 1.0) <= -300000000.0) {
tmp = t_1;
} else if ((x - 1.0) <= -0.99999999999999) {
tmp = (y - fma(y, z, log(y))) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(x - 1.0), log(y), Float64(-t)) tmp = 0.0 if (Float64(x - 1.0) <= -300000000.0) tmp = t_1; elseif (Float64(x - 1.0) <= -0.99999999999999) tmp = Float64(Float64(y - fma(y, z, log(y))) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -300000000.0], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], -0.99999999999999], N[(N[(y - N[(y * z + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - 1, \log y, -t\right)\\
\mathbf{if}\;x - 1 \leq -300000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x - 1 \leq -0.99999999999999:\\
\;\;\;\;\left(y - \mathsf{fma}\left(y, z, \log y\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -3e8 or -0.99999999999999001 < (-.f64 x #s(literal 1 binary64)) Initial program 91.4%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
if -3e8 < (-.f64 x #s(literal 1 binary64)) < -0.99999999999999001Initial program 78.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.2
Applied rewrites99.2%
Taylor expanded in z around inf
Applied rewrites64.7%
Taylor expanded in x around 0
Applied rewrites98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (log1p (- y)) z) t)))
(if (<= (- z 1.0) -1e+247)
t_1
(if (<= (- z 1.0) 1e+154) (fma (- x 1.0) (log y) (- t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (log1p(-y) * z) - t;
double tmp;
if ((z - 1.0) <= -1e+247) {
tmp = t_1;
} else if ((z - 1.0) <= 1e+154) {
tmp = fma((x - 1.0), log(y), -t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log1p(Float64(-y)) * z) - t) tmp = 0.0 if (Float64(z - 1.0) <= -1e+247) tmp = t_1; elseif (Float64(z - 1.0) <= 1e+154) tmp = fma(Float64(x - 1.0), log(y), Float64(-t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[1 + (-y)], $MachinePrecision] * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[N[(z - 1.0), $MachinePrecision], -1e+247], t$95$1, If[LessEqual[N[(z - 1.0), $MachinePrecision], 1e+154], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{log1p}\left(-y\right) \cdot z - t\\
\mathbf{if}\;z - 1 \leq -1 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z - 1 \leq 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < -9.99999999999999952e246 or 1.00000000000000004e154 < (-.f64 z #s(literal 1 binary64)) Initial program 42.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6478.8
Applied rewrites78.8%
if -9.99999999999999952e246 < (-.f64 z #s(literal 1 binary64)) < 1.00000000000000004e154Initial program 95.6%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower-neg.f6495.2
Applied rewrites95.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= (- x 1.0) -5e+20)
t_1
(if (<= (- x 1.0) 2e+120) (- (fma (- z) y y) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if ((x - 1.0) <= -5e+20) {
tmp = t_1;
} else if ((x - 1.0) <= 2e+120) {
tmp = fma(-z, y, y) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (Float64(x - 1.0) <= -5e+20) tmp = t_1; elseif (Float64(x - 1.0) <= 2e+120) tmp = Float64(fma(Float64(-z), y, y) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[N[(x - 1.0), $MachinePrecision], -5e+20], t$95$1, If[LessEqual[N[(x - 1.0), $MachinePrecision], 2e+120], N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x - 1 \leq -5 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x - 1 \leq 2 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -5e20 or 2e120 < (-.f64 x #s(literal 1 binary64)) Initial program 96.5%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6481.8
Applied rewrites81.8%
if -5e20 < (-.f64 x #s(literal 1 binary64)) < 2e120Initial program 79.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.3
Applied rewrites99.3%
Taylor expanded in y around inf
Applied rewrites62.7%
(FPCore (x y z t) :precision binary64 (fma (- 1.0 z) y (fma (log y) (- x 1.0) (- t))))
double code(double x, double y, double z, double t) {
return fma((1.0 - z), y, fma(log(y), (x - 1.0), -t));
}
function code(x, y, z, t) return fma(Float64(1.0 - z), y, fma(log(y), Float64(x - 1.0), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(1.0 - z), $MachinePrecision] * y + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - z, y, \mathsf{fma}\left(\log y, x - 1, -t\right)\right)
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in y around 0
associate--l+N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
sub-negN/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
+-commutativeN/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1.05e-11) (- t) (if (<= t 62000000.0) (- y (* z y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-11) {
tmp = -t;
} else if (t <= 62000000.0) {
tmp = y - (z * y);
} else {
tmp = -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 (t <= (-1.05d-11)) then
tmp = -t
else if (t <= 62000000.0d0) then
tmp = y - (z * y)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-11) {
tmp = -t;
} else if (t <= 62000000.0) {
tmp = y - (z * y);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.05e-11: tmp = -t elif t <= 62000000.0: tmp = y - (z * y) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.05e-11) tmp = Float64(-t); elseif (t <= 62000000.0) tmp = Float64(y - Float64(z * y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.05e-11) tmp = -t; elseif (t <= 62000000.0) tmp = y - (z * y); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e-11], (-t), If[LessEqual[t, 62000000.0], N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 62000000:\\
\;\;\;\;y - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.0499999999999999e-11 or 6.2e7 < t Initial program 91.8%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6468.0
Applied rewrites68.0%
if -1.0499999999999999e-11 < t < 6.2e7Initial program 78.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
associate--l+N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
sub-negN/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
+-commutativeN/A
distribute-rgt-outN/A
lower-fma.f64N/A
Applied rewrites99.4%
Taylor expanded in y around inf
Applied rewrites24.9%
Final simplification44.6%
(FPCore (x y z t) :precision binary64 (if (<= t -1.05e-11) (- t) (if (<= t 62000000.0) (* (- y) z) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-11) {
tmp = -t;
} else if (t <= 62000000.0) {
tmp = -y * z;
} else {
tmp = -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 (t <= (-1.05d-11)) then
tmp = -t
else if (t <= 62000000.0d0) then
tmp = -y * z
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-11) {
tmp = -t;
} else if (t <= 62000000.0) {
tmp = -y * z;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.05e-11: tmp = -t elif t <= 62000000.0: tmp = -y * z else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.05e-11) tmp = Float64(-t); elseif (t <= 62000000.0) tmp = Float64(Float64(-y) * z); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.05e-11) tmp = -t; elseif (t <= 62000000.0) tmp = -y * z; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e-11], (-t), If[LessEqual[t, 62000000.0], N[((-y) * z), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 62000000:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.0499999999999999e-11 or 6.2e7 < t Initial program 91.8%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6468.0
Applied rewrites68.0%
if -1.0499999999999999e-11 < t < 6.2e7Initial program 78.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
mul-1-negN/A
lower-log1p.f64N/A
mul-1-negN/A
lower-neg.f6424.5
Applied rewrites24.5%
Taylor expanded in y around 0
Applied rewrites24.4%
(FPCore (x y z t) :precision binary64 (- (fma (- z) y y) t))
double code(double x, double y, double z, double t) {
return fma(-z, y, y) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-z), y, y) - t) end
code[x_, y_, z_, t_] := N[(N[((-z) * y + y), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-z, y, y\right) - t
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.4
Applied rewrites99.4%
Taylor expanded in y around inf
Applied rewrites48.4%
(FPCore (x y z t) :precision binary64 (- (* (- z) y) t))
double code(double x, double y, double z, double t) {
return (-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 = (-z * y) - t
end function
public static double code(double x, double y, double z, double t) {
return (-z * y) - t;
}
def code(x, y, z, t): return (-z * y) - t
function code(x, y, z, t) return Float64(Float64(Float64(-z) * y) - t) end
function tmp = code(x, y, z, t) tmp = (-z * y) - t; end
code[x_, y_, z_, t_] := N[(N[((-z) * y), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) \cdot y - t
\end{array}
Initial program 84.8%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f6499.4
Applied rewrites99.4%
Taylor expanded in z around inf
Applied rewrites48.3%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -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 = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 84.8%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6432.8
Applied rewrites32.8%
herbie shell --seed 2024298
(FPCore (x y z t)
:name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
:precision binary64
(- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))