
(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 20 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}
Initial program 88.1%
+-commutative88.1%
fma-def88.1%
sub-neg88.1%
metadata-eval88.1%
sub-neg88.1%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ -1.0 x)) (* z (log1p (- y)))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (-1.0 + x)) + (z * log1p(-y))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((Math.log(y) * (-1.0 + x)) + (z * Math.log1p(-y))) - t;
}
def code(x, y, z, t): return ((math.log(y) * (-1.0 + x)) + (z * math.log1p(-y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(-1.0 + x)) + Float64(z * log1p(Float64(-y)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(-1 + x\right) + z \cdot \mathsf{log1p}\left(-y\right)\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in z around inf 88.0%
*-commutative88.0%
sub-neg88.0%
mul-1-neg88.0%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (* y (- z)) t)))
(if (<= x -1.65e+166)
t_1
(if (<= x -9e+122)
t_2
(if (<= x -5e+19)
t_1
(if (<= x -2.9e-228)
t_2
(if (<= x 3.9e+31) (- (- (log y)) t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (y * -z) - t;
double tmp;
if (x <= -1.65e+166) {
tmp = t_1;
} else if (x <= -9e+122) {
tmp = t_2;
} else if (x <= -5e+19) {
tmp = t_1;
} else if (x <= -2.9e-228) {
tmp = t_2;
} else if (x <= 3.9e+31) {
tmp = -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 = x * log(y)
t_2 = (y * -z) - t
if (x <= (-1.65d+166)) then
tmp = t_1
else if (x <= (-9d+122)) then
tmp = t_2
else if (x <= (-5d+19)) then
tmp = t_1
else if (x <= (-2.9d-228)) then
tmp = t_2
else if (x <= 3.9d+31) then
tmp = -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 = x * Math.log(y);
double t_2 = (y * -z) - t;
double tmp;
if (x <= -1.65e+166) {
tmp = t_1;
} else if (x <= -9e+122) {
tmp = t_2;
} else if (x <= -5e+19) {
tmp = t_1;
} else if (x <= -2.9e-228) {
tmp = t_2;
} else if (x <= 3.9e+31) {
tmp = -Math.log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (y * -z) - t tmp = 0 if x <= -1.65e+166: tmp = t_1 elif x <= -9e+122: tmp = t_2 elif x <= -5e+19: tmp = t_1 elif x <= -2.9e-228: tmp = t_2 elif x <= 3.9e+31: tmp = -math.log(y) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(y * Float64(-z)) - t) tmp = 0.0 if (x <= -1.65e+166) tmp = t_1; elseif (x <= -9e+122) tmp = t_2; elseif (x <= -5e+19) tmp = t_1; elseif (x <= -2.9e-228) tmp = t_2; elseif (x <= 3.9e+31) tmp = Float64(Float64(-log(y)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (y * -z) - t; tmp = 0.0; if (x <= -1.65e+166) tmp = t_1; elseif (x <= -9e+122) tmp = t_2; elseif (x <= -5e+19) tmp = t_1; elseif (x <= -2.9e-228) tmp = t_2; elseif (x <= 3.9e+31) tmp = -log(y) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -1.65e+166], t$95$1, If[LessEqual[x, -9e+122], t$95$2, If[LessEqual[x, -5e+19], t$95$1, If[LessEqual[x, -2.9e-228], t$95$2, If[LessEqual[x, 3.9e+31], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := y \cdot \left(-z\right) - t\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-228}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+31}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.6500000000000001e166 or -8.99999999999999995e122 < x < -5e19 or 3.89999999999999999e31 < x Initial program 97.0%
Taylor expanded in y around 0 99.0%
mul-1-neg99.0%
Simplified99.0%
+-commutative99.0%
fma-def99.0%
sub-neg99.0%
metadata-eval99.0%
sub-neg99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 76.0%
*-commutative76.0%
Simplified76.0%
if -1.6500000000000001e166 < x < -8.99999999999999995e122 or -5e19 < x < -2.9000000000000001e-228Initial program 67.2%
Taylor expanded in y around 0 98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in z around inf 89.6%
associate-*r*89.6%
neg-mul-189.6%
Simplified89.6%
if -2.9000000000000001e-228 < x < 3.89999999999999999e31Initial program 89.5%
+-commutative89.5%
fma-def89.5%
sub-neg89.5%
metadata-eval89.5%
sub-neg89.5%
log1p-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 89.1%
fma-neg89.1%
sub-neg89.1%
metadata-eval89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in x around 0 86.9%
neg-mul-186.9%
Simplified86.9%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ -1.0 x) -5e+19) (not (<= (+ -1.0 x) -0.99999999999995))) (- (- (* x (log y)) (* y (+ z -1.0))) t) (- (- (* y (- (- -1.0) z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((-1.0 + x) <= -5e+19) || !((-1.0 + x) <= -0.99999999999995)) {
tmp = ((x * log(y)) - (y * (z + -1.0))) - t;
} else {
tmp = ((y * (-(-1.0) - z)) - 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) <= (-5d+19)) .or. (.not. (((-1.0d0) + x) <= (-0.99999999999995d0)))) then
tmp = ((x * log(y)) - (y * (z + (-1.0d0)))) - t
else
tmp = ((y * (-(-1.0d0) - z)) - 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) <= -5e+19) || !((-1.0 + x) <= -0.99999999999995)) {
tmp = ((x * Math.log(y)) - (y * (z + -1.0))) - t;
} else {
tmp = ((y * (-(-1.0) - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((-1.0 + x) <= -5e+19) or not ((-1.0 + x) <= -0.99999999999995): tmp = ((x * math.log(y)) - (y * (z + -1.0))) - t else: tmp = ((y * (-(-1.0) - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(-1.0 + x) <= -5e+19) || !(Float64(-1.0 + x) <= -0.99999999999995)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(y * Float64(z + -1.0))) - t); else tmp = Float64(Float64(Float64(y * Float64(Float64(-(-1.0)) - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((-1.0 + x) <= -5e+19) || ~(((-1.0 + x) <= -0.99999999999995))) tmp = ((x * log(y)) - (y * (z + -1.0))) - t; else tmp = ((y * (-(-1.0) - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(-1.0 + x), $MachinePrecision], -5e+19], N[Not[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99999999999995]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[((--1.0) - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -5 \cdot 10^{+19} \lor \neg \left(-1 + x \leq -0.99999999999995\right):\\
\;\;\;\;\left(x \cdot \log y - y \cdot \left(z + -1\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(\left(--1\right) - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -5e19 or -0.99999999999995004 < (-.f64 x 1) Initial program 94.8%
*-commutative94.8%
sub-neg94.8%
metadata-eval94.8%
flip-+53.8%
associate-*r/53.7%
metadata-eval53.7%
fma-neg53.7%
metadata-eval53.7%
sub-neg53.7%
metadata-eval53.7%
+-commutative53.7%
Applied egg-rr53.7%
associate-/l*53.7%
Simplified53.7%
Taylor expanded in x around inf 94.2%
Taylor expanded in y around 0 98.6%
log-pow9.1%
+-commutative9.1%
mul-1-neg9.1%
unsub-neg9.1%
log-pow98.6%
*-commutative98.6%
sub-neg98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
if -5e19 < (-.f64 x 1) < -0.99999999999995004Initial program 81.1%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
mul-1-neg99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-neg-out99.4%
unsub-neg99.4%
+-commutative99.4%
Simplified99.4%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -5e+19)
(- (* x (log y)) t)
(if (<= (+ -1.0 x) -0.99999995)
(- (- (* y (- (- -1.0) z)) (log y)) t)
(- (+ y (* (log y) (+ -1.0 x))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -5e+19) {
tmp = (x * log(y)) - t;
} else if ((-1.0 + x) <= -0.99999995) {
tmp = ((y * (-(-1.0) - z)) - log(y)) - t;
} else {
tmp = (y + (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 (((-1.0d0) + x) <= (-5d+19)) then
tmp = (x * log(y)) - t
else if (((-1.0d0) + x) <= (-0.99999995d0)) then
tmp = ((y * (-(-1.0d0) - z)) - log(y)) - t
else
tmp = (y + (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 ((-1.0 + x) <= -5e+19) {
tmp = (x * Math.log(y)) - t;
} else if ((-1.0 + x) <= -0.99999995) {
tmp = ((y * (-(-1.0) - z)) - Math.log(y)) - t;
} else {
tmp = (y + (Math.log(y) * (-1.0 + x))) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (-1.0 + x) <= -5e+19: tmp = (x * math.log(y)) - t elif (-1.0 + x) <= -0.99999995: tmp = ((y * (-(-1.0) - z)) - math.log(y)) - t else: tmp = (y + (math.log(y) * (-1.0 + x))) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -5e+19) tmp = Float64(Float64(x * log(y)) - t); elseif (Float64(-1.0 + x) <= -0.99999995) tmp = Float64(Float64(Float64(y * Float64(Float64(-(-1.0)) - z)) - log(y)) - t); else tmp = Float64(Float64(y + Float64(log(y) * Float64(-1.0 + x))) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((-1.0 + x) <= -5e+19) tmp = (x * log(y)) - t; elseif ((-1.0 + x) <= -0.99999995) tmp = ((y * (-(-1.0) - z)) - log(y)) - t; else tmp = (y + (log(y) * (-1.0 + x))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -5e+19], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99999995], N[(N[(N[(y * N[((--1.0) - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -5 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;-1 + x \leq -0.99999995:\\
\;\;\;\;\left(y \cdot \left(\left(--1\right) - z\right) - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y + \log y \cdot \left(-1 + x\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -5e19Initial program 94.9%
Taylor expanded in z around inf 94.9%
*-commutative94.9%
sub-neg94.9%
mul-1-neg94.9%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 94.9%
*-commutative94.9%
Simplified94.9%
if -5e19 < (-.f64 x 1) < -0.999999949999999971Initial program 80.5%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
distribute-lft-out99.4%
mul-1-neg99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-neg-out99.4%
unsub-neg99.4%
+-commutative99.4%
Simplified99.4%
if -0.999999949999999971 < (-.f64 x 1) Initial program 96.3%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around 0 94.8%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.65e+166)
t_1
(if (<= x -9e+122)
(- (* y (- z)) t)
(if (or (<= x -4.5e+19) (not (<= x 6.5e+29)))
t_1
(- (* y (- (- -1.0) z)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.65e+166) {
tmp = t_1;
} else if (x <= -9e+122) {
tmp = (y * -z) - t;
} else if ((x <= -4.5e+19) || !(x <= 6.5e+29)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.65d+166)) then
tmp = t_1
else if (x <= (-9d+122)) then
tmp = (y * -z) - t
else if ((x <= (-4.5d+19)) .or. (.not. (x <= 6.5d+29))) then
tmp = t_1
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 t_1 = x * Math.log(y);
double tmp;
if (x <= -1.65e+166) {
tmp = t_1;
} else if (x <= -9e+122) {
tmp = (y * -z) - t;
} else if ((x <= -4.5e+19) || !(x <= 6.5e+29)) {
tmp = t_1;
} else {
tmp = (y * (-(-1.0) - z)) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.65e+166: tmp = t_1 elif x <= -9e+122: tmp = (y * -z) - t elif (x <= -4.5e+19) or not (x <= 6.5e+29): tmp = t_1 else: tmp = (y * (-(-1.0) - z)) - t return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.65e+166) tmp = t_1; elseif (x <= -9e+122) tmp = Float64(Float64(y * Float64(-z)) - t); elseif ((x <= -4.5e+19) || !(x <= 6.5e+29)) tmp = t_1; else tmp = Float64(Float64(y * Float64(Float64(-(-1.0)) - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.65e+166) tmp = t_1; elseif (x <= -9e+122) tmp = (y * -z) - t; elseif ((x <= -4.5e+19) || ~((x <= 6.5e+29))) tmp = t_1; else tmp = (y * (-(-1.0) - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+166], t$95$1, If[LessEqual[x, -9e+122], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[x, -4.5e+19], N[Not[LessEqual[x, 6.5e+29]], $MachinePrecision]], t$95$1, N[(N[(y * N[((--1.0) - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+122}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+19} \lor \neg \left(x \leq 6.5 \cdot 10^{+29}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(--1\right) - z\right) - t\\
\end{array}
\end{array}
if x < -1.6500000000000001e166 or -8.99999999999999995e122 < x < -4.5e19 or 6.49999999999999971e29 < x Initial program 97.0%
Taylor expanded in y around 0 99.0%
mul-1-neg99.0%
Simplified99.0%
+-commutative99.0%
fma-def99.0%
sub-neg99.0%
metadata-eval99.0%
sub-neg99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 76.0%
*-commutative76.0%
Simplified76.0%
if -1.6500000000000001e166 < x < -8.99999999999999995e122Initial program 65.6%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 92.8%
associate-*r*92.8%
neg-mul-192.8%
Simplified92.8%
if -4.5e19 < x < 6.49999999999999971e29Initial program 81.9%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in y around inf 73.4%
mul-1-neg73.4%
sub-neg73.4%
metadata-eval73.4%
*-commutative73.4%
distribute-rgt-neg-out73.4%
+-commutative73.4%
Simplified73.4%
Final simplification75.1%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.15e-111)
(- (* y (- (- -1.0) z)) t)
(if (or (<= t -4.85e-203) (and (not (<= t -2.6e-305)) (<= t 1.8e-11)))
(- (log y))
(- (* y (- z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.15e-111) {
tmp = (y * (-(-1.0) - z)) - t;
} else if ((t <= -4.85e-203) || (!(t <= -2.6e-305) && (t <= 1.8e-11))) {
tmp = -log(y);
} else {
tmp = (y * -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 (t <= (-3.15d-111)) then
tmp = (y * (-(-1.0d0) - z)) - t
else if ((t <= (-4.85d-203)) .or. (.not. (t <= (-2.6d-305))) .and. (t <= 1.8d-11)) then
tmp = -log(y)
else
tmp = (y * -z) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.15e-111) {
tmp = (y * (-(-1.0) - z)) - t;
} else if ((t <= -4.85e-203) || (!(t <= -2.6e-305) && (t <= 1.8e-11))) {
tmp = -Math.log(y);
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.15e-111: tmp = (y * (-(-1.0) - z)) - t elif (t <= -4.85e-203) or (not (t <= -2.6e-305) and (t <= 1.8e-11)): tmp = -math.log(y) else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.15e-111) tmp = Float64(Float64(y * Float64(Float64(-(-1.0)) - z)) - t); elseif ((t <= -4.85e-203) || (!(t <= -2.6e-305) && (t <= 1.8e-11))) tmp = Float64(-log(y)); else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.15e-111) tmp = (y * (-(-1.0) - z)) - t; elseif ((t <= -4.85e-203) || (~((t <= -2.6e-305)) && (t <= 1.8e-11))) tmp = -log(y); else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.15e-111], N[(N[(y * N[((--1.0) - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[t, -4.85e-203], And[N[Not[LessEqual[t, -2.6e-305]], $MachinePrecision], LessEqual[t, 1.8e-11]]], (-N[Log[y], $MachinePrecision]), N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.15 \cdot 10^{-111}:\\
\;\;\;\;y \cdot \left(\left(--1\right) - z\right) - t\\
\mathbf{elif}\;t \leq -4.85 \cdot 10^{-203} \lor \neg \left(t \leq -2.6 \cdot 10^{-305}\right) \land t \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;-\log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if t < -3.1500000000000002e-111Initial program 89.6%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 68.2%
mul-1-neg68.2%
sub-neg68.2%
metadata-eval68.2%
*-commutative68.2%
distribute-rgt-neg-out68.2%
+-commutative68.2%
Simplified68.2%
if -3.1500000000000002e-111 < t < -4.8499999999999998e-203 or -2.6000000000000002e-305 < t < 1.79999999999999992e-11Initial program 89.2%
+-commutative89.2%
fma-def89.2%
sub-neg89.2%
metadata-eval89.2%
sub-neg89.2%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 86.5%
fma-neg86.5%
sub-neg86.5%
metadata-eval86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 36.8%
neg-mul-136.8%
Simplified36.8%
Taylor expanded in t around 0 36.8%
neg-mul-136.8%
Simplified36.8%
if -4.8499999999999998e-203 < t < -2.6000000000000002e-305 or 1.79999999999999992e-11 < t Initial program 85.3%
Taylor expanded in y around 0 99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 71.6%
associate-*r*71.6%
neg-mul-171.6%
Simplified71.6%
Final simplification59.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -95000000000000.0)
t_1
(if (<= x -1e-230)
(- (* y (- z)) t)
(if (<= x 9e-14) (- (- (log 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 <= -95000000000000.0) {
tmp = t_1;
} else if (x <= -1e-230) {
tmp = (y * -z) - t;
} else if (x <= 9e-14) {
tmp = -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) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-95000000000000.0d0)) then
tmp = t_1
else if (x <= (-1d-230)) then
tmp = (y * -z) - t
else if (x <= 9d-14) then
tmp = -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 = (x * Math.log(y)) - t;
double tmp;
if (x <= -95000000000000.0) {
tmp = t_1;
} else if (x <= -1e-230) {
tmp = (y * -z) - t;
} else if (x <= 9e-14) {
tmp = -Math.log(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 <= -95000000000000.0: tmp = t_1 elif x <= -1e-230: tmp = (y * -z) - t elif x <= 9e-14: tmp = -math.log(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 <= -95000000000000.0) tmp = t_1; elseif (x <= -1e-230) tmp = Float64(Float64(y * Float64(-z)) - t); elseif (x <= 9e-14) tmp = Float64(Float64(-log(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 <= -95000000000000.0) tmp = t_1; elseif (x <= -1e-230) tmp = (y * -z) - t; elseif (x <= 9e-14) tmp = -log(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, -95000000000000.0], t$95$1, If[LessEqual[x, -1e-230], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 9e-14], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -95000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-230}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.5e13 or 8.9999999999999995e-14 < x Initial program 94.8%
Taylor expanded in z around inf 94.8%
*-commutative94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -9.5e13 < x < -1.00000000000000005e-230Initial program 67.4%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around inf 89.2%
associate-*r*89.2%
neg-mul-189.2%
Simplified89.2%
if -1.00000000000000005e-230 < x < 8.9999999999999995e-14Initial program 89.3%
+-commutative89.3%
fma-def89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
log1p-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 88.9%
fma-neg88.9%
sub-neg88.9%
metadata-eval88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in x around 0 88.8%
neg-mul-188.8%
Simplified88.8%
Final simplification91.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -32000000000.0)
t_1
(if (<= x -2.9e-228)
(- (* y (- z)) t)
(if (<= x 9e-14) (- (- y (log 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 <= -32000000000.0) {
tmp = t_1;
} else if (x <= -2.9e-228) {
tmp = (y * -z) - t;
} else if (x <= 9e-14) {
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) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-32000000000.0d0)) then
tmp = t_1
else if (x <= (-2.9d-228)) then
tmp = (y * -z) - t
else if (x <= 9d-14) 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 = (x * Math.log(y)) - t;
double tmp;
if (x <= -32000000000.0) {
tmp = t_1;
} else if (x <= -2.9e-228) {
tmp = (y * -z) - t;
} else if (x <= 9e-14) {
tmp = (y - Math.log(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 <= -32000000000.0: tmp = t_1 elif x <= -2.9e-228: tmp = (y * -z) - t elif x <= 9e-14: tmp = (y - math.log(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 <= -32000000000.0) tmp = t_1; elseif (x <= -2.9e-228) tmp = Float64(Float64(y * Float64(-z)) - t); elseif (x <= 9e-14) 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 = (x * log(y)) - t; tmp = 0.0; if (x <= -32000000000.0) tmp = t_1; elseif (x <= -2.9e-228) tmp = (y * -z) - t; elseif (x <= 9e-14) 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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -32000000000.0], t$95$1, If[LessEqual[x, -2.9e-228], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 9e-14], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -32000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-228}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.2e10 or 8.9999999999999995e-14 < x Initial program 94.8%
Taylor expanded in z around inf 94.8%
*-commutative94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -3.2e10 < x < -2.9000000000000001e-228Initial program 67.4%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in z around inf 89.2%
associate-*r*89.2%
neg-mul-189.2%
Simplified89.2%
if -2.9000000000000001e-228 < x < 8.9999999999999995e-14Initial program 89.3%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 89.3%
Taylor expanded in x around 0 89.3%
neg-mul-189.3%
unsub-neg89.3%
Simplified89.3%
Final simplification91.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -33000000000.0)
t_1
(if (<= x -3.3e-230)
(- (* z (log1p (- y))) t)
(if (<= x 9e-14) (- (- y (log 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 <= -33000000000.0) {
tmp = t_1;
} else if (x <= -3.3e-230) {
tmp = (z * log1p(-y)) - t;
} else if (x <= 9e-14) {
tmp = (y - log(y)) - t;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - t;
double tmp;
if (x <= -33000000000.0) {
tmp = t_1;
} else if (x <= -3.3e-230) {
tmp = (z * Math.log1p(-y)) - t;
} else if (x <= 9e-14) {
tmp = (y - Math.log(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 <= -33000000000.0: tmp = t_1 elif x <= -3.3e-230: tmp = (z * math.log1p(-y)) - t elif x <= 9e-14: tmp = (y - math.log(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 <= -33000000000.0) tmp = t_1; elseif (x <= -3.3e-230) tmp = Float64(Float64(z * log1p(Float64(-y))) - t); elseif (x <= 9e-14) 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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -33000000000.0], t$95$1, If[LessEqual[x, -3.3e-230], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 9e-14], N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -33000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-230}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-14}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.3e10 or 8.9999999999999995e-14 < x Initial program 94.8%
Taylor expanded in z around inf 94.8%
*-commutative94.8%
sub-neg94.8%
mul-1-neg94.8%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in x around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -3.3e10 < x < -3.29999999999999994e-230Initial program 67.4%
Taylor expanded in z around inf 67.4%
*-commutative67.4%
sub-neg67.4%
mul-1-neg67.4%
log1p-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 57.7%
sub-neg57.7%
log1p-def90.7%
Simplified90.7%
if -3.29999999999999994e-230 < x < 8.9999999999999995e-14Initial program 89.3%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 89.3%
Taylor expanded in x around 0 89.3%
neg-mul-189.3%
unsub-neg89.3%
Simplified89.3%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -9e+219)
(- (* y (- z)) t)
(if (<= z 2.15e+250)
(- (+ y (* (log y) (+ -1.0 x))) t)
(- (* z (log1p (- y))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+219) {
tmp = (y * -z) - t;
} else if (z <= 2.15e+250) {
tmp = (y + (log(y) * (-1.0 + x))) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+219) {
tmp = (y * -z) - t;
} else if (z <= 2.15e+250) {
tmp = (y + (Math.log(y) * (-1.0 + x))) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9e+219: tmp = (y * -z) - t elif z <= 2.15e+250: tmp = (y + (math.log(y) * (-1.0 + x))) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9e+219) tmp = Float64(Float64(y * Float64(-z)) - t); elseif (z <= 2.15e+250) tmp = Float64(Float64(y + Float64(log(y) * Float64(-1.0 + x))) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -9e+219], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 2.15e+250], N[(N[(y + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+219}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+250}:\\
\;\;\;\;\left(y + \log y \cdot \left(-1 + x\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if z < -9.00000000000000047e219Initial program 37.1%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 85.2%
associate-*r*85.2%
neg-mul-185.2%
Simplified85.2%
if -9.00000000000000047e219 < z < 2.15e250Initial program 95.8%
Taylor expanded in y around 0 99.5%
mul-1-neg99.5%
Simplified99.5%
Taylor expanded in z around 0 95.4%
if 2.15e250 < z Initial program 39.1%
Taylor expanded in z around inf 39.1%
*-commutative39.1%
sub-neg39.1%
mul-1-neg39.1%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 39.2%
sub-neg39.2%
log1p-def91.8%
Simplified91.8%
Final simplification94.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.8e+220)
(- (* y (- z)) t)
(if (<= z 3.6e+251)
(- (* (log y) (+ -1.0 x)) t)
(- (* z (log1p (- y))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+220) {
tmp = (y * -z) - t;
} else if (z <= 3.6e+251) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+220) {
tmp = (y * -z) - t;
} else if (z <= 3.6e+251) {
tmp = (Math.log(y) * (-1.0 + x)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+220: tmp = (y * -z) - t elif z <= 3.6e+251: tmp = (math.log(y) * (-1.0 + x)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+220) tmp = Float64(Float64(y * Float64(-z)) - t); elseif (z <= 3.6e+251) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+220], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 3.6e+251], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+220}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+251}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if z < -3.79999999999999984e220Initial program 37.1%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 85.2%
associate-*r*85.2%
neg-mul-185.2%
Simplified85.2%
if -3.79999999999999984e220 < z < 3.59999999999999997e251Initial program 95.8%
+-commutative95.8%
fma-def95.8%
sub-neg95.8%
metadata-eval95.8%
sub-neg95.8%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 95.2%
if 3.59999999999999997e251 < z Initial program 39.1%
Taylor expanded in z around inf 39.1%
*-commutative39.1%
sub-neg39.1%
mul-1-neg39.1%
log1p-def99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 39.2%
sub-neg39.2%
log1p-def91.8%
Simplified91.8%
Final simplification94.2%
(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}
Initial program 88.1%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Final simplification99.3%
(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 88.1%
Taylor expanded in z around inf 88.0%
*-commutative88.0%
sub-neg88.0%
mul-1-neg88.0%
log1p-def99.7%
mul-1-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.2e-16) (not (<= t 8.5e+27))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e-16) || !(t <= 8.5e+27)) {
tmp = -t;
} else {
tmp = y * (1.0 - 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 ((t <= (-4.2d-16)) .or. (.not. (t <= 8.5d+27))) then
tmp = -t
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e-16) || !(t <= 8.5e+27)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.2e-16) or not (t <= 8.5e+27): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.2e-16) || !(t <= 8.5e+27)) tmp = Float64(-t); else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.2e-16) || ~((t <= 8.5e+27))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.2e-16], N[Not[LessEqual[t, 8.5e+27]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-16} \lor \neg \left(t \leq 8.5 \cdot 10^{+27}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -4.2000000000000002e-16 or 8.5e27 < t Initial program 96.7%
+-commutative96.7%
fma-def96.7%
sub-neg96.7%
metadata-eval96.7%
sub-neg96.7%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 73.8%
neg-mul-173.8%
Simplified73.8%
if -4.2000000000000002e-16 < t < 8.5e27Initial program 78.3%
Taylor expanded in y around 0 98.6%
mul-1-neg98.6%
Simplified98.6%
+-commutative98.6%
fma-def98.6%
sub-neg98.6%
metadata-eval98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in y around inf 23.5%
mul-1-neg23.5%
sub-neg23.5%
metadata-eval23.5%
distribute-rgt-neg-in23.5%
+-commutative23.5%
distribute-neg-in23.5%
metadata-eval23.5%
Simplified23.5%
Final simplification50.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.3e-16) (not (<= t 1.75e+21))) (- t) (* y (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-16) || !(t <= 1.75e+21)) {
tmp = -t;
} else {
tmp = 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 ((t <= (-3.3d-16)) .or. (.not. (t <= 1.75d+21))) then
tmp = -t
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-16) || !(t <= 1.75e+21)) {
tmp = -t;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.3e-16) or not (t <= 1.75e+21): tmp = -t else: tmp = y * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.3e-16) || !(t <= 1.75e+21)) tmp = Float64(-t); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.3e-16) || ~((t <= 1.75e+21))) tmp = -t; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e-16], N[Not[LessEqual[t, 1.75e+21]], $MachinePrecision]], (-t), N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-16} \lor \neg \left(t \leq 1.75 \cdot 10^{+21}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -3.29999999999999988e-16 or 1.75e21 < t Initial program 96.7%
+-commutative96.7%
fma-def96.7%
sub-neg96.7%
metadata-eval96.7%
sub-neg96.7%
log1p-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 73.8%
neg-mul-173.8%
Simplified73.8%
if -3.29999999999999988e-16 < t < 1.75e21Initial program 78.3%
Taylor expanded in y around 0 98.6%
mul-1-neg98.6%
Simplified98.6%
+-commutative98.6%
fma-def98.6%
sub-neg98.6%
metadata-eval98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 23.2%
mul-1-neg23.2%
distribute-rgt-neg-in23.2%
Simplified23.2%
Final simplification50.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(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(\left(--1\right) - z\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Taylor expanded in y around inf 52.1%
mul-1-neg52.1%
sub-neg52.1%
metadata-eval52.1%
*-commutative52.1%
distribute-rgt-neg-out52.1%
+-commutative52.1%
Simplified52.1%
Final simplification52.1%
(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 * Float64(-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 \left(-z\right) - t
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Taylor expanded in z around inf 52.0%
associate-*r*52.0%
neg-mul-152.0%
Simplified52.0%
Final simplification52.0%
(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 88.1%
+-commutative88.1%
fma-def88.1%
sub-neg88.1%
metadata-eval88.1%
sub-neg88.1%
log1p-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 40.8%
neg-mul-140.8%
Simplified40.8%
Final simplification40.8%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
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
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 88.1%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Taylor expanded in z around 0 87.4%
Taylor expanded in y around inf 2.8%
Final simplification2.8%
herbie shell --seed 2024031
(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))