// Copyright Matthew Pulver 2018 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) #include #include template T fourth_power(T x) { x *= x; return x *= x; } int main() { using namespace boost::math::differentiation; constexpr int Order=5; // The highest order derivative to be calculated. const autodiff_fvar x = make_fvar(2.0); // Find derivatives at x=2. const autodiff_fvar y = fourth_power(x); for (int i=0 ; i<=Order ; ++i) std::cout << "y.derivative("<