cherry-pick 8f31c4e764a26d685cd0d96587802761e891f27f
fixed NaN test for fdim
added failing NaN test for fdim
fixed agrad/rev/fdim so gradients return nan for input nan
added NaN test for fdim
added NaN and derivative doc for fdim in manual
Merge branch 'develop' into feature/test-nan-fdim
Merge branch 'develop' into feature/test-nan-fdim
Merge pull request #972 from stan-dev/feature/test-nan-fdim

Feature/test nan fdim