1#ifndef STAN_MATH_REV_FUN_LDEXP_HPP
2#define STAN_MATH_REV_FUN_LDEXP_HPP
11class ldexp_vari :
public op_vd_vari {
13 explicit ldexp_vari(
vari* avi,
int b)
14 : op_vd_vari(
ldexp(avi->val_, b), avi, b) {}
15 void chain() { avi_->adj_ +=
ldexp(adj_, bd_); }
19inline var ldexp(
const var& a,
int b) {
return var(
new ldexp_vari(a.vi_, b)); }
vari_value< double > vari
fvar< T > ldexp(const fvar< T > &a, int b)
Returns the product of a (the significand) times 2 to power b (the exponent).
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...