Stan Math Library: stan/math/fwd/scal/fun/cbrt.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

cbrt.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_SCAL_FUN_CBRT_HPP
2 #define STAN_MATH_FWD_SCAL_FUN_CBRT_HPP
3
4 #include <math.h>
5 #include <stan/math/fwd/core.hpp>
6 #include <stan/math/prim/scal/fun/square.hpp>
7
8 namespace stan {
9 namespace math {
10
11 template <typename T>
12 inline
13 fvar<T>
14 cbrt(const fvar<T>& x) {
15 using ::cbrt;
16 using stan::math::square;
17 return fvar<T>(cbrt(x.val_),
18 x.d_ / (square(cbrt(x.val_)) * 3.0));
19 }
20
21 }
22 }
23 #endif
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:15
stan
Definition: log_sum_exp.hpp:8
stan::math::cbrt
fvar< T > cbrt(const fvar< T > &x)
Definition: cbrt.hpp:14
square.hpp
stan::math::square
fvar< T > square(const fvar< T > &x)
Definition: square.hpp:15
stan::math::fvar::val_
T val_
Definition: fvar.hpp:14
stan::math::fvar
Definition: fvar.hpp:13
stan::math::cbrt
var cbrt(const var &a)
Returns the cube root of the specified variable (C99).
Definition: cbrt.hpp:56

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