Log Minus Digamma function#2957
Conversation
std/internal/math/gammafunction.d
Outdated
There was a problem hiding this comment.
float equality comparison feels wrong, even if the unittest works
|
why is it only defined for real, what about float and double. precision isn't everything. |
|
Because we need a full support of |
|
Of course, but this is not reason not to start here. |
|
Generally Yes, but not for |
|
Furthermore, |
|
this could be the start to put some pressure on math and mathspecial to work better with float and double. any start is better than no start |
|
I have already start (and not only I). See my PRs: I have no idea how to make fast Note: |
|
OK, so lets forget the float and double versions for now. the code still compares against 0, well 0.0 but the problem is the same. |
std/internal/math/gammafunction.d
Outdated
There was a problem hiding this comment.
I'd move the declaration of y down here…
|
@burner: Are you sure this is actually an issue here? The general rules for floating point math notwithstanding, this seems to be special-cased merely to ensure that a special value (0) is mapped to another special value (infinity) in the correct way. Other Phobos special functions are implemented in a similar way, although I didn't actually verify the approximation used here. |
|
@burner Do you mean that the problem is sign? (+0.0 / -0.0) |
|
@9il: |
|
@klickverbot : 95% of this code is from |
logmdigamma: fix comprasion move declarations
|
Ah okay, thanks. Maybe include these as references in the source code? |
|
well than, other than the zero thing the doc is quite sparse. and what about pure safe nothrow |
|
@burner attributes was defined for all module. |
|
References added. |
|
LGTM |
|
Auto-merge toggled on |
|
Inverse version of this function #3020. |
digamma(x)is asymptotically equivalent tolog(x).logmdigamma(x)computeslog(x) - digamma(x)without subtractive cancellation for large x. See also cran.statmod.