multiply_log(0, 0) has infinite gradient
Description
For more details, see https://discourse.mc-stan.org/t/non-linear-modelling-michaelis-menten/22736/8
Example
The gradient for poisson_lpmf(0 | lambda) is infinite at lambda = 0.
Suggested fix
@nhuurre writes on discourse:
We should just special-case a=0.0 like we do with a=1.0
Current Version:
v4.0.1
Ah interesting, it looks like for reverse mode we don't check this, but we do when working with doubles so we def should be doing it for reverse mode!
https://github.com/stan-dev/math/blob/develop/stan/math/rev/fun/multiply_log.hpp
Any chance this could be addressed? I think accounting for this is making formulating complex HMMs on the log scale a bit more verbose than it needs to be.