Skip to content

Commit 8d6c43b

Browse files
author
Andrew Johnson
committed
Use inv
1 parent 79a96b9 commit 8d6c43b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stan/math/prim/prob/lognormal_lpdf.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <stan/math/prim/fun/size.hpp>
1111
#include <stan/math/prim/fun/size_zero.hpp>
1212
#include <stan/math/prim/fun/value_of.hpp>
13-
#include <stan/math/prim/fun/value_of_rec.hpp>
1413
#include <cmath>
1514

1615
namespace stan {
@@ -65,7 +64,7 @@ return_type_t<T_y, T_loc, T_scale> lognormal_lpdf(const T_y& y, const T_loc& mu,
6564
inv_sigma_sq(size(sigma));
6665
if (include_summand<propto, T_y, T_loc, T_scale>::value) {
6766
for (size_t n = 0; n < stan::math::size(sigma); n++) {
68-
inv_sigma[n] = 1 / value_of_rec(sigma_vec[n]);
67+
inv_sigma[n] = inv(value_of(sigma_vec[n]));
6968
}
7069
}
7170
if (include_summand<propto, T_y, T_loc, T_scale>::value) {
@@ -87,7 +86,7 @@ return_type_t<T_y, T_loc, T_scale> lognormal_lpdf(const T_y& y, const T_loc& mu,
8786
stan::math::size(y));
8887
if (!is_constant_all<T_y>::value) {
8988
for (size_t n = 0; n < stan::math::size(y); n++) {
90-
inv_y[n] = 1 / value_of_rec(y_vec[n]);
89+
inv_y[n] = inv(value_of(y_vec[n]));
9190
}
9291
}
9392

0 commit comments

Comments
 (0)