log_sum_exp is implemented this way.

I have found some potential improvements (not tested yet) to fwd-diff functions I'm handling in separated branch https://github.com/randommm/stan/compare/develop...feature;fix_log_exp