cos.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_SCAL_FUN_COS_HPP
#define STAN_MATH_FWD_SCAL_FUN_COS_HPP
#include <stan/math/fwd/core.hpp>
#include <cmath>
namespace stan {
namespace math {
template <typename T>
inline
fvar<T>
cos(const fvar<T>& x) {
using std::sin;
using std::cos;
return fvar<T>(cos(x.val_), x.d_ * -sin(x.val_));
}
}
}
#endif
stan::math::cos
fvar< T > cos(const fvar< T > &x)
Definition: cos.hpp:13
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:16
stan::math::cos
var cos(const var &a)
Return the cosine of a radian-scaled variable (cmath).
Definition: cos.hpp:49
stan
Definition: log_sum_exp.hpp:8
stan::math::sin
fvar< T > sin(const fvar< T > &x)
Definition: sin.hpp:12
stan::math::fvar::val_
T val_
Definition: fvar.hpp:15
stan::math::fvar
Definition: fvar.hpp:14

[ Stan Home Page ] © 2011–2016, Stan Development Team.