To cite the 'madness' package in publications use:

Steven E. Pav (2019). madness: Automatic Differentiation of Multivariate Operations. R package version 0.2.6.

Corresponding BibTeX entry:

  @Manual{madness-Manual,
    title = {{madness}: Automatic Differentiation of Multivariate
      Operations},
    author = {Steven E. Pav},
    year = {2019},
    note = {R package version 0.2.6},
    url = {https://github.com/shabbychef/madness},
  }