We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d070e18 commit 0943428Copy full SHA for 0943428
1 file changed
stan/math/fwd/fun/pow.hpp
@@ -25,15 +25,15 @@ inline fvar<T> pow(const fvar<T>& x1, const fvar<T>& x2) {
25
}
26
27
template <typename T, typename U, typename = require_arithmetic_t<U>>
28
-inline fvar<T> pow(U x1, const fvar<T>& x2) {
+inline fvar<T> pow(const U& x1, const fvar<T>& x2) {
29
using std::log;
30
using std::pow;
31
T u = pow(x1, x2.val_);
32
return fvar<T>(u, x2.d_ * log(x1) * u);
33
34
35
36
-inline fvar<T> pow(const fvar<T>& x1, U x2) {
+inline fvar<T> pow(const fvar<T>& x1, const U& x2) {
37
38
using std::sqrt;
39
if (x2 == -2) {
0 commit comments