
(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 12 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 fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(log(y) * Float64(-1.0 + x)) - t)) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \log y \cdot \left(-1 + x\right) - t\right)
\end{array}
Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
associate-+l+87.7%
fma-def87.7%
sub-neg87.7%
metadata-eval87.7%
sub-neg87.7%
log1p-def99.9%
sub-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (+ (* z (log1p (- y))) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return ((z * log1p(-y)) + (log(y) * (-1.0 + x))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((z * Math.log1p(-y)) + (Math.log(y) * (-1.0 + x))) - t;
}
def code(x, y, z, t): return ((z * math.log1p(-y)) + (math.log(y) * (-1.0 + x))) - t
function code(x, y, z, t) return Float64(Float64(Float64(z * log1p(Float64(-y))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot \mathsf{log1p}\left(-y\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 87.7%
Taylor expanded in z around inf 87.7%
sub-neg87.7%
log1p-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma y (- 1.0 z) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma(y, (1.0 - z), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(y, Float64(1.0 - z), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 1 - z, \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 87.7%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
+-commutative99.6%
distribute-rgt-out99.6%
fma-def99.6%
mul-1-neg99.6%
fma-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -1.0) (not (<= (+ -1.0 x) 50.0))) (- (* (log y) (+ -1.0 x)) t) (- (- (- (log y)) (* z y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -1.0) || !((-1.0 + x) <= 50.0)) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (-log(y) - (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 ((((-1.0d0) + x) <= (-1.0d0)) .or. (.not. (((-1.0d0) + x) <= 50.0d0))) then
tmp = (log(y) * ((-1.0d0) + x)) - t
else
tmp = (-log(y) - (z * 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.0) || !((-1.0 + x) <= 50.0)) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (-Math.log(y) - (z * y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -1.0) or not ((-1.0 + x) <= 50.0): tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (-math.log(y) - (z * y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -1.0) || !(Float64(-1.0 + x) <= 50.0)) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(z * y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -1.0) || ~(((-1.0 + x) <= 50.0))) tmp = (log(y) * (-1.0 + x)) - t; else tmp = (-log(y) - (z * y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.0], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], 50.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1 \lor \neg \left(-1 + x \leq 50\right):\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - z \cdot y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1 or 50 < (-.f64 x 1) Initial program 87.9%
Taylor expanded in z around inf 87.9%
sub-neg87.9%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 87.8%
if -1 < (-.f64 x 1) < 50Initial program 71.6%
Taylor expanded in y around 0 85.4%
+-commutative85.4%
sub-neg85.4%
metadata-eval85.4%
+-commutative85.4%
distribute-rgt-out85.4%
+-commutative85.4%
distribute-rgt-out85.4%
fma-def85.4%
mul-1-neg85.4%
fma-neg85.4%
+-commutative85.4%
sub-neg85.4%
metadata-eval85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in x around 0 57.2%
mul-1-neg57.2%
Simplified57.2%
Taylor expanded in z around inf 57.2%
Final simplification87.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e+176) (not (<= z 7.8e+258))) (- (* z (- y)) t) (- (* (log y) (+ -1.0 x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e+176) || !(z <= 7.8e+258)) {
tmp = (z * -y) - t;
} else {
tmp = (log(y) * (-1.0 + x)) - 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 <= (-6d+176)) .or. (.not. (z <= 7.8d+258))) then
tmp = (z * -y) - t
else
tmp = (log(y) * ((-1.0d0) + x)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e+176) || !(z <= 7.8e+258)) {
tmp = (z * -y) - t;
} else {
tmp = (Math.log(y) * (-1.0 + x)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e+176) or not (z <= 7.8e+258): tmp = (z * -y) - t else: tmp = (math.log(y) * (-1.0 + x)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e+176) || !(z <= 7.8e+258)) tmp = Float64(Float64(z * Float64(-y)) - t); else tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e+176) || ~((z <= 7.8e+258))) tmp = (z * -y) - t; else tmp = (log(y) * (-1.0 + x)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e+176], N[Not[LessEqual[z, 7.8e+258]], $MachinePrecision]], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+176} \lor \neg \left(z \leq 7.8 \cdot 10^{+258}\right):\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\end{array}
\end{array}
if z < -6e176 or 7.80000000000000074e258 < z Initial program 44.1%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-rgt-out100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
mul-1-neg100.0%
fma-neg100.0%
+-commutative100.0%
sub-neg100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 86.2%
neg-mul-186.2%
distribute-rgt-neg-in86.2%
Simplified86.2%
if -6e176 < z < 7.80000000000000074e258Initial program 94.6%
Taylor expanded in z around inf 94.6%
sub-neg94.6%
log1p-def99.8%
Simplified99.8%
Taylor expanded in y around 0 94.1%
Final simplification93.0%
(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}
Initial program 87.7%
Taylor expanded in z around inf 87.7%
sub-neg87.7%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
neg-mul-199.6%
unsub-neg99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -45000000000.0) (not (<= x 300.0))) (- (* x (log y)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -45000000000.0) || !(x <= 300.0)) {
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 <= -45000000000.0) || !(x <= 300.0)) {
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 <= -45000000000.0) or not (x <= 300.0): 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 <= -45000000000.0) || !(x <= 300.0)) 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, -45000000000.0], N[Not[LessEqual[x, 300.0]], $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 -45000000000 \lor \neg \left(x \leq 300\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if x < -4.5e10 or 300 < x Initial program 94.0%
Taylor expanded in z around inf 94.0%
sub-neg94.0%
log1p-def99.7%
Simplified99.7%
Taylor expanded in x around inf 93.2%
*-commutative93.2%
Simplified93.2%
if -4.5e10 < x < 300Initial program 82.9%
Taylor expanded in z around inf 82.9%
sub-neg82.9%
log1p-def100.0%
Simplified100.0%
Taylor expanded in z around inf 46.9%
sub-neg46.9%
mul-1-neg46.9%
log1p-def63.5%
mul-1-neg63.5%
Simplified63.5%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -28500000000.0) (not (<= x 90.0))) (- (* x (log y)) t) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -28500000000.0) || !(x <= 90.0)) {
tmp = (x * log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-28500000000.0d0)) .or. (.not. (x <= 90.0d0))) then
tmp = (x * log(y)) - t
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -28500000000.0) || !(x <= 90.0)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -28500000000.0) or not (x <= 90.0): tmp = (x * math.log(y)) - t else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -28500000000.0) || !(x <= 90.0)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -28500000000.0) || ~((x <= 90.0))) tmp = (x * log(y)) - t; else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -28500000000.0], N[Not[LessEqual[x, 90.0]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28500000000 \lor \neg \left(x \leq 90\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -2.85e10 or 90 < x Initial program 94.0%
Taylor expanded in z around inf 94.0%
sub-neg94.0%
log1p-def99.7%
Simplified99.7%
Taylor expanded in x around inf 93.2%
*-commutative93.2%
Simplified93.2%
if -2.85e10 < x < 90Initial program 82.9%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
+-commutative99.6%
distribute-rgt-out99.6%
fma-def99.6%
mul-1-neg99.6%
fma-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 63.4%
Final simplification76.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.8e-5) (not (<= t 2.6e+14))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.8e-5) || !(t <= 2.6e+14)) {
tmp = -t;
} else {
tmp = 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 ((t <= (-3.8d-5)) .or. (.not. (t <= 2.6d+14))) then
tmp = -t
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.8e-5) || !(t <= 2.6e+14)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.8e-5) or not (t <= 2.6e+14): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.8e-5) || !(t <= 2.6e+14)) tmp = Float64(-t); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.8e-5) || ~((t <= 2.6e+14))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.8e-5], N[Not[LessEqual[t, 2.6e+14]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-5} \lor \neg \left(t \leq 2.6 \cdot 10^{+14}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -3.8000000000000002e-5 or 2.6e14 < t Initial program 97.0%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
distribute-rgt-out99.9%
+-commutative99.9%
distribute-rgt-out99.9%
fma-def99.9%
mul-1-neg99.9%
fma-neg99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 76.3%
neg-mul-176.3%
distribute-rgt-neg-in76.3%
Simplified76.3%
Taylor expanded in y around 0 73.4%
neg-mul-173.4%
Simplified73.4%
if -3.8000000000000002e-5 < t < 2.6e14Initial program 78.6%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
distribute-rgt-out99.4%
+-commutative99.4%
distribute-rgt-out99.4%
fma-def99.3%
mul-1-neg99.3%
fma-neg99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 22.9%
neg-mul-122.9%
distribute-rgt-neg-in22.9%
Simplified22.9%
Taylor expanded in y around inf 22.6%
mul-1-neg22.6%
distribute-rgt-neg-out22.6%
Simplified22.6%
Final simplification47.6%
(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 87.7%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
+-commutative99.6%
distribute-rgt-out99.6%
fma-def99.6%
mul-1-neg99.6%
fma-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 49.4%
Final simplification49.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(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}
Initial program 87.7%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
+-commutative99.6%
distribute-rgt-out99.6%
fma-def99.6%
mul-1-neg99.6%
fma-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around inf 49.2%
neg-mul-149.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
Final simplification49.2%
(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 87.7%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
+-commutative99.6%
distribute-rgt-out99.6%
fma-def99.6%
mul-1-neg99.6%
fma-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in z around inf 49.2%
neg-mul-149.2%
distribute-rgt-neg-in49.2%
Simplified49.2%
Taylor expanded in y around 0 37.8%
neg-mul-137.8%
Simplified37.8%
Final simplification37.8%
herbie shell --seed 2023298
(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))