
(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 13 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 (+ x -1.0) (log y) (* (log1p (- y)) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return fma((x + -1.0), log(y), (log1p(-y) * (z + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(x + -1.0), log(y), Float64(log1p(Float64(-y)) * Float64(z + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x + -1, \log y, \mathsf{log1p}\left(-y\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.9%
cancel-sign-sub90.9%
distribute-lft-neg-in90.9%
fma-neg90.9%
remove-double-neg90.9%
sub-neg90.9%
log1p-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (- (* y (* y -0.5)) y) (+ z -1.0)) (* (+ x -1.0) (log y))) t))
double code(double x, double y, double z, double t) {
return ((((y * (y * -0.5)) - y) * (z + -1.0)) + ((x + -1.0) * log(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 * (y * (-0.5d0))) - y) * (z + (-1.0d0))) + ((x + (-1.0d0)) * log(y))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((((y * (y * -0.5)) - y) * (z + -1.0)) + ((x + -1.0) * Math.log(y))) - t;
}
def code(x, y, z, t): return ((((y * (y * -0.5)) - y) * (z + -1.0)) + ((x + -1.0) * math.log(y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(Float64(y * Float64(y * -0.5)) - y) * Float64(z + -1.0)) + Float64(Float64(x + -1.0) * log(y))) - t) end
function tmp = code(x, y, z, t) tmp = ((((y * (y * -0.5)) - y) * (z + -1.0)) + ((x + -1.0) * log(y))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y \cdot \left(y \cdot -0.5\right) - y\right) \cdot \left(z + -1\right) + \left(x + -1\right) \cdot \log y\right) - t
\end{array}
Initial program 90.9%
Taylor expanded in y around 0 99.2%
mul-1-neg99.2%
unsub-neg99.2%
*-commutative99.2%
unpow299.2%
associate-*l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (<= (+ x -1.0) -1.0)
(- (* (+ x -1.0) (log y)) t)
(if (<= (+ x -1.0) 1.0)
(- (- (* y (- 1.0 z)) (log y)) t)
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + -1.0) <= -1.0) {
tmp = ((x + -1.0) * log(y)) - t;
} else if ((x + -1.0) <= 1.0) {
tmp = ((y * (1.0 - z)) - log(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 ((x + (-1.0d0)) <= (-1.0d0)) then
tmp = ((x + (-1.0d0)) * log(y)) - t
else if ((x + (-1.0d0)) <= 1.0d0) then
tmp = ((y * (1.0d0 - z)) - log(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 ((x + -1.0) <= -1.0) {
tmp = ((x + -1.0) * Math.log(y)) - t;
} else if ((x + -1.0) <= 1.0) {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
} else {
tmp = (x * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + -1.0) <= -1.0: tmp = ((x + -1.0) * math.log(y)) - t elif (x + -1.0) <= 1.0: tmp = ((y * (1.0 - z)) - math.log(y)) - t else: tmp = (x * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + -1.0) <= -1.0) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); elseif (Float64(x + -1.0) <= 1.0) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(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 ((x + -1.0) <= -1.0) tmp = ((x + -1.0) * log(y)) - t; elseif ((x + -1.0) <= 1.0) tmp = ((y * (1.0 - z)) - log(y)) - t; else tmp = (x * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + -1.0), $MachinePrecision], -1.0], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(x + -1.0), $MachinePrecision], 1.0], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -1:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{elif}\;x + -1 \leq 1:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1Initial program 90.4%
Taylor expanded in y around 0 88.2%
if -1 < (-.f64 x 1) < 1Initial program 50.4%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
*-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 66.1%
fma-neg66.1%
*-lft-identity66.1%
pow-base-166.1%
mul-1-neg66.1%
fma-def66.1%
+-commutative66.1%
pow-base-166.1%
*-lft-identity66.1%
mul-1-neg66.1%
unsub-neg66.1%
associate-*r*66.1%
sub-neg66.1%
metadata-eval66.1%
+-commutative66.1%
neg-mul-166.1%
*-commutative66.1%
distribute-neg-in66.1%
metadata-eval66.1%
sub-neg66.1%
Simplified66.1%
if 1 < (-.f64 x 1) Initial program 93.3%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
*-commutative99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 92.8%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (- (- (* (+ x -1.0) (log y)) (* y (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) - (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 = (((x + (-1.0d0)) * log(y)) - (y * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) - (y * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) - (y * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) - Float64(y * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) - (y * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y - y \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 90.9%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
*-commutative98.9%
+-commutative98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (- (- (* (+ x -1.0) (log y)) (* y z)) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) - (y * 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 + (-1.0d0)) * log(y)) - (y * z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) - (y * z)) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) - (y * z)) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) - Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) - (y * z)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y - y \cdot z\right) - t
\end{array}
Initial program 90.9%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
*-commutative98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 98.7%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.8e-96) (not (<= x 5.5))) (- (* x (log y)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.8e-96) || !(x <= 5.5)) {
tmp = (x * log(y)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.8e-96) || !(x <= 5.5)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.8e-96) or not (x <= 5.5): tmp = (x * math.log(y)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.8e-96) || !(x <= 5.5)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.8e-96], N[Not[LessEqual[x, 5.5]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-96} \lor \neg \left(x \leq 5.5\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if x < -6.8000000000000002e-96 or 5.5 < x Initial program 95.8%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 89.6%
if -6.8000000000000002e-96 < x < 5.5Initial program 82.2%
Taylor expanded in z around inf 47.2%
sub-neg47.2%
mul-1-neg47.2%
log1p-def63.8%
mul-1-neg63.8%
Simplified63.8%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.8e-96) (not (<= x 1650.0))) (- (* x (log y)) t) (- (- (* z (* -0.5 (* y y))) t) (* y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.8e-96) || !(x <= 1650.0)) {
tmp = (x * log(y)) - t;
} else {
tmp = ((z * (-0.5 * (y * y))) - t) - (y * 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 ((x <= (-6.8d-96)) .or. (.not. (x <= 1650.0d0))) then
tmp = (x * log(y)) - t
else
tmp = ((z * ((-0.5d0) * (y * y))) - t) - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.8e-96) || !(x <= 1650.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = ((z * (-0.5 * (y * y))) - t) - (y * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.8e-96) or not (x <= 1650.0): tmp = (x * math.log(y)) - t else: tmp = ((z * (-0.5 * (y * y))) - t) - (y * z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6.8e-96) || !(x <= 1650.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(Float64(z * Float64(-0.5 * Float64(y * y))) - t) - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.8e-96) || ~((x <= 1650.0))) tmp = (x * log(y)) - t; else tmp = ((z * (-0.5 * (y * y))) - t) - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.8e-96], N[Not[LessEqual[x, 1650.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(z * N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-96} \lor \neg \left(x \leq 1650\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(-0.5 \cdot \left(y \cdot y\right)\right) - t\right) - y \cdot z\\
\end{array}
\end{array}
if x < -6.8000000000000002e-96 or 1650 < x Initial program 95.8%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
+-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
*-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 89.6%
if -6.8000000000000002e-96 < x < 1650Initial program 82.2%
Taylor expanded in z around inf 47.2%
sub-neg47.2%
mul-1-neg47.2%
log1p-def63.8%
mul-1-neg63.8%
Simplified63.8%
Taylor expanded in y around 0 62.5%
neg-mul-162.5%
associate-+r+62.5%
mul-1-neg62.5%
*-commutative62.5%
unsub-neg62.5%
unsub-neg62.5%
associate-*r*62.5%
unpow262.5%
*-commutative62.5%
Simplified62.5%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= z -4.6e+260) (- (* z (log1p (- y))) t) (- (* (+ x -1.0) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+260) {
tmp = (z * log1p(-y)) - t;
} else {
tmp = ((x + -1.0) * log(y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+260) {
tmp = (z * Math.log1p(-y)) - t;
} else {
tmp = ((x + -1.0) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e+260: tmp = (z * math.log1p(-y)) - t else: tmp = ((x + -1.0) * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e+260) tmp = Float64(Float64(z * log1p(Float64(-y))) - t); else tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e+260], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+260}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\end{array}
\end{array}
if z < -4.60000000000000022e260Initial program 44.6%
Taylor expanded in z around inf 28.0%
sub-neg28.0%
mul-1-neg28.0%
log1p-def83.2%
mul-1-neg83.2%
Simplified83.2%
if -4.60000000000000022e260 < z Initial program 93.0%
Taylor expanded in y around 0 91.5%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (- (- (* z (* -0.5 (* y y))) t) (* y z)))
double code(double x, double y, double z, double t) {
return ((z * (-0.5 * (y * y))) - t) - (y * z);
}
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 * ((-0.5d0) * (y * y))) - t) - (y * z)
end function
public static double code(double x, double y, double z, double t) {
return ((z * (-0.5 * (y * y))) - t) - (y * z);
}
def code(x, y, z, t): return ((z * (-0.5 * (y * y))) - t) - (y * z)
function code(x, y, z, t) return Float64(Float64(Float64(z * Float64(-0.5 * Float64(y * y))) - t) - Float64(y * z)) end
function tmp = code(x, y, z, t) tmp = ((z * (-0.5 * (y * y))) - t) - (y * z); end
code[x_, y_, z_, t_] := N[(N[(N[(z * N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \left(-0.5 \cdot \left(y \cdot y\right)\right) - t\right) - y \cdot z
\end{array}
Initial program 90.9%
Taylor expanded in z around inf 35.3%
sub-neg35.3%
mul-1-neg35.3%
log1p-def43.7%
mul-1-neg43.7%
Simplified43.7%
Taylor expanded in y around 0 43.1%
neg-mul-143.1%
associate-+r+43.1%
mul-1-neg43.1%
*-commutative43.1%
unsub-neg43.1%
unsub-neg43.1%
associate-*r*43.1%
unpow243.1%
*-commutative43.1%
Simplified43.1%
Final simplification43.1%
(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}
Initial program 90.9%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
*-commutative98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in y around inf 43.0%
Final simplification43.0%
(FPCore (x y z t) :precision binary64 (- (- (* y z)) t))
double code(double x, double y, double z, double t) {
return -(y * 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 * z) - t
end function
public static double code(double x, double y, double z, double t) {
return -(y * z) - t;
}
def code(x, y, z, t): return -(y * z) - t
function code(x, y, z, t) return Float64(Float64(-Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = -(y * z) - t; end
code[x_, y_, z_, t_] := N[((-N[(y * z), $MachinePrecision]) - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-y \cdot z\right) - t
\end{array}
Initial program 90.9%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
+-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
*-commutative98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in z around inf 42.8%
associate-*r*42.8%
mul-1-neg42.8%
Simplified42.8%
Final simplification42.8%
(FPCore (x y z t) :precision binary64 (- (* y z) t))
double code(double x, double y, double z, double t) {
return (y * 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 * z) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * z) - t;
}
def code(x, y, z, t): return (y * z) - t
function code(x, y, z, t) return Float64(Float64(y * z) - t) end
function tmp = code(x, y, z, t) tmp = (y * z) - t; end
code[x_, y_, z_, t_] := N[(N[(y * z), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot z - t
\end{array}
Initial program 90.9%
Taylor expanded in z around inf 35.3%
sub-neg35.3%
mul-1-neg35.3%
log1p-def43.7%
mul-1-neg43.7%
Simplified43.7%
sub-neg43.7%
add-sqr-sqrt0.0%
sqrt-unprod33.6%
sqr-neg33.6%
sqrt-unprod33.7%
add-sqr-sqrt33.7%
Applied egg-rr33.7%
sub-neg33.7%
Simplified33.7%
Taylor expanded in y around 0 33.7%
Final simplification33.7%
(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 90.9%
cancel-sign-sub90.9%
distribute-lft-neg-in90.9%
fma-neg90.9%
remove-double-neg90.9%
sub-neg90.9%
log1p-def99.8%
Simplified99.8%
Taylor expanded in t around inf 33.7%
neg-mul-133.7%
Simplified33.7%
Final simplification33.7%
herbie shell --seed 2023181
(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))