
(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 17 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 (+ z -1.0) (log1p (- y)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -10.0) (not (<= (+ -1.0 x) -1.0))) (- (- (* x (log y)) (* z y)) t) (- (- (* y (- (- z) -1.0)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = ((y * (-z - -1.0)) - log(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) :: tmp
if ((((-1.0d0) + x) <= (-10.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = ((y * (-z - (-1.0d0))) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = ((y * (-z - -1.0)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -10.0) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = ((y * (-z - -1.0)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -10.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(Float64(y * Float64(Float64(-z) - -1.0)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -10.0) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = ((y * (-z - -1.0)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -10.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -10 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(\left(-z\right) - -1\right) - \log y\right) - t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -10.0) (not (<= (+ -1.0 x) -1.0))) (- (- (* x (log y)) (* z y)) t) (- (- (* y (- (- z) -1.0)) t) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = ((y * (-z - -1.0)) - t) - log(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 ((((-1.0d0) + x) <= (-10.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = ((y * (-z - (-1.0d0))) - t) - log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = ((y * (-z - -1.0)) - t) - Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -10.0) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = ((y * (-z - -1.0)) - t) - math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -10.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(Float64(y * Float64(Float64(-z) - -1.0)) - t) - log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -10.0) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = ((y * (-z - -1.0)) - t) - log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -10.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -10 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(\left(-z\right) - -1\right) - t\right) - \log y\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -10.0) (not (<= (+ -1.0 x) -1.0))) (- (- (* x (log y)) (* z y)) t) (- (- (log y)) (+ t (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * log(y)) - (z * y)) - t;
} else {
tmp = -log(y) - (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 ((((-1.0d0) + x) <= (-10.0d0)) .or. (.not. (((-1.0d0) + x) <= (-1.0d0)))) then
tmp = ((x * log(y)) - (z * y)) - t
else
tmp = -log(y) - (t + (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -10.0) || !((-1.0 + x) <= -1.0)) {
tmp = ((x * Math.log(y)) - (z * y)) - t;
} else {
tmp = -Math.log(y) - (t + (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -10.0) or not ((-1.0 + x) <= -1.0): tmp = ((x * math.log(y)) - (z * y)) - t else: tmp = -math.log(y) - (t + (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -10.0) || !(Float64(-1.0 + x) <= -1.0)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(-log(y)) - Float64(t + Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -10.0) || ~(((-1.0 + x) <= -1.0))) tmp = ((x * log(y)) - (z * y)) - t; else tmp = -log(y) - (t + (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -10.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - N[(t + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -10 \lor \neg \left(-1 + x \leq -1\right):\\
\;\;\;\;\left(x \cdot \log y - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - \left(t + z \cdot y\right)\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -1.0000002)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 5e+15)
(- (- (- (log y)) (* z y)) t)
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.0000002) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+15) {
tmp = (-log(y) - (z * y)) - t;
} else {
tmp = (x * log(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) :: tmp
if (((-1.0d0) + x) <= (-1.0000002d0)) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else if (((-1.0d0) + x) <= 5d+15) then
tmp = (-log(y) - (z * y)) - t
else
tmp = (x * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.0000002) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+15) {
tmp = (-Math.log(y) - (z * y)) - t;
} else {
tmp = (x * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -1.0000002: tmp = (math.log(y) * (-1.0 + x)) - t elif (-1.0 + x) <= 5e+15: tmp = (-math.log(y) - (z * y)) - t else: tmp = (x * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -1.0000002) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 5e+15) tmp = Float64(Float64(Float64(-log(y)) - Float64(z * y)) - t); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -1.0000002) tmp = (log(y) * (-1.0 + x)) - t; elseif ((-1.0 + x) <= 5e+15) tmp = (-log(y) - (z * y)) - t; else tmp = (x * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0000002], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 5e+15], N[(N[((-N[Log[y], $MachinePrecision]) - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.0000002:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(-\log y\right) - z \cdot y\right) - t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -1.0000002)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 5e+15)
(- (- (log y)) (+ t (* z y)))
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.0000002) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+15) {
tmp = -log(y) - (t + (z * y));
} else {
tmp = (x * log(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) :: tmp
if (((-1.0d0) + x) <= (-1.0000002d0)) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else if (((-1.0d0) + x) <= 5d+15) then
tmp = -log(y) - (t + (z * y))
else
tmp = (x * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.0000002) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 5e+15) {
tmp = -Math.log(y) - (t + (z * y));
} else {
tmp = (x * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -1.0000002: tmp = (math.log(y) * (-1.0 + x)) - t elif (-1.0 + x) <= 5e+15: tmp = -math.log(y) - (t + (z * y)) else: tmp = (x * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -1.0000002) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 5e+15) tmp = Float64(Float64(-log(y)) - Float64(t + Float64(z * y))); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -1.0000002) tmp = (log(y) * (-1.0 + x)) - t; elseif ((-1.0 + x) <= 5e+15) tmp = -log(y) - (t + (z * y)); else tmp = (x * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0000002], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 5e+15], N[((-N[Log[y], $MachinePrecision]) - N[(t + N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.0000002:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\left(-\log y\right) - \left(t + z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (- (- (/ (log y) (/ 1.0 (+ -1.0 x))) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) / (1.0 / (-1.0 + x))) - (y * (z + -1.0))) - 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 = ((log(y) / (1.0d0 / ((-1.0d0) + x))) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) / (1.0 / (-1.0 + x))) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) / (1.0 / (-1.0 + x))) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) / Float64(1.0 / Float64(-1.0 + x))) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) / (1.0 / (-1.0 + x))) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] / N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\log y}{\frac{1}{-1 + x}} - y \cdot \left(z + -1\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (y * (z + -1.0))) - 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 = ((log(y) * ((-1.0d0) + x)) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - y \cdot \left(z + -1\right)\right) - t
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -1.0)
t_1
(if (<= x 4.6e-41)
(- (- (log y)) t)
(if (<= x 4e+15) (- (* z (- y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 4.6e-41) {
tmp = -log(y) - t;
} else if (x <= 4e+15) {
tmp = (z * -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) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-1.0d0)) then
tmp = t_1
else if (x <= 4.6d-41) then
tmp = -log(y) - t
else if (x <= 4d+15) then
tmp = (z * -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 = (x * Math.log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 4.6e-41) {
tmp = -Math.log(y) - t;
} else if (x <= 4e+15) {
tmp = (z * -y) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -1.0: tmp = t_1 elif x <= 4.6e-41: tmp = -math.log(y) - t elif x <= 4e+15: tmp = (z * -y) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -1.0) tmp = t_1; elseif (x <= 4.6e-41) tmp = Float64(Float64(-log(y)) - t); elseif (x <= 4e+15) tmp = Float64(Float64(z * Float64(-y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -1.0) tmp = t_1; elseif (x <= 4.6e-41) tmp = -log(y) - t; elseif (x <= 4e+15) tmp = (z * -y) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -1.0], t$95$1, If[LessEqual[x, 4.6e-41], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[LessEqual[x, 4e+15], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-41}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+15}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -1.0)
t_1
(if (<= x 4.6e-41)
(- (- y (log y)) t)
(if (<= x 4e+15) (- (* z (- y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 4.6e-41) {
tmp = (y - log(y)) - t;
} else if (x <= 4e+15) {
tmp = (z * -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) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-1.0d0)) then
tmp = t_1
else if (x <= 4.6d-41) then
tmp = (y - log(y)) - t
else if (x <= 4d+15) then
tmp = (z * -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 = (x * Math.log(y)) - t;
double tmp;
if (x <= -1.0) {
tmp = t_1;
} else if (x <= 4.6e-41) {
tmp = (y - Math.log(y)) - t;
} else if (x <= 4e+15) {
tmp = (z * -y) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -1.0: tmp = t_1 elif x <= 4.6e-41: tmp = (y - math.log(y)) - t elif x <= 4e+15: tmp = (z * -y) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -1.0) tmp = t_1; elseif (x <= 4.6e-41) tmp = Float64(Float64(y - log(y)) - t); elseif (x <= 4e+15) tmp = Float64(Float64(z * Float64(-y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -1.0) tmp = t_1; elseif (x <= 4.6e-41) tmp = (y - log(y)) - t; elseif (x <= 4e+15) tmp = (z * -y) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -1.0], t$95$1, If[LessEqual[x, 4.6e-41], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 4e+15], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-41}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+15}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (- (- (* (log y) (+ -1.0 x)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) - (z * y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(y) * ((-1.0d0) + x)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) - (z * y)) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((log(y) * (-1.0 + x)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) - z \cdot y\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= z 1.42e+223) (- (* (log y) (+ -1.0 x)) t) (- (* z (- y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.42e+223) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (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) :: tmp
if (z <= 1.42d+223) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.42e+223) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.42e+223: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.42e+223) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.42e+223) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.42e+223], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.42 \cdot 10^{+223}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.4e+143) (not (<= z 7.2e+158))) (- (* z (- y)) t) (- (- (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+143) || !(z <= 7.2e+158)) {
tmp = (z * -y) - t;
} else {
tmp = -log(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) :: tmp
if ((z <= (-4.4d+143)) .or. (.not. (z <= 7.2d+158))) then
tmp = (z * -y) - t
else
tmp = -log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+143) || !(z <= 7.2e+158)) {
tmp = (z * -y) - t;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.4e+143) or not (z <= 7.2e+158): tmp = (z * -y) - t else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.4e+143) || !(z <= 7.2e+158)) tmp = Float64(Float64(z * Float64(-y)) - t); else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.4e+143) || ~((z <= 7.2e+158))) tmp = (z * -y) - t; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.4e+143], N[Not[LessEqual[z, 7.2e+158]], $MachinePrecision]], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+143} \lor \neg \left(z \leq 7.2 \cdot 10^{+158}\right):\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
return (y * (1.0 - 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 = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
def code(x, y, z, t): return (y * (1.0 - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - t
\end{array}
(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(z * Float64(-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}
\\
z \cdot \left(-y\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (- y t))
double code(double x, double y, double z, double t) {
return 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 = y - t
end function
public static double code(double x, double y, double z, double t) {
return y - t;
}
def code(x, y, z, t): return y - t
function code(x, y, z, t) return Float64(y - t) end
function tmp = code(x, y, z, t) tmp = y - t; end
code[x_, y_, z_, t_] := N[(y - t), $MachinePrecision]
\begin{array}{l}
\\
y - t
\end{array}
(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}
herbie shell --seed 2023343
(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))