Created
May 13, 2020 19:51
-
-
Save SteveBronder/6f03dbf282a031e81beea46e8312e5be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef STAN_MATH_REV_FUN_LAMBERT_W_HPP | |
#define STAN_MATH_REV_FUN_LAMBERT_W_HPP | |
#include <stan/math/rev/core.hpp> | |
#include <stan/math/rev/meta.hpp> | |
#include <stan/math/prim/meta.hpp> | |
#include <stan/math/prim/fun/lambert_w.hpp> | |
namespace stan { | |
namespace math { | |
namespace internal { | |
class lambertw0_vari : public op_v_vari { | |
public: | |
explicit lambertw0_vari(vari* avi) : op_v_vari(lambert_w0(avi->val_), avi) {} | |
void chain() { | |
avi_->adj_ += adj_ + boost::math::lambert_w0_prime(avi_->val_) ; | |
} | |
}; | |
} // namespace internal | |
inline var lambert_w0(const var& a) { return var(new internal::lambertw0_vari(a.vi_)); } | |
} // namespace math | |
} // namespace stan | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment