Skip to content

Commit 4cc48dc

Browse files
committed
Fix naming for hypergeometric_1F0
1 parent cf3d0dd commit 4cc48dc

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

stan/math/fwd/fun/hypergeometric_1F0.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ namespace math {
3131
template <typename Ta, typename Tz, typename FvarT = return_type_t<Ta, Tz>,
3232
require_all_stan_scalar_t<Ta, Tz>* = nullptr,
3333
require_any_fvar_t<Ta, Tz>* = nullptr>
34-
FvarT hypergeometric_1f0(const Ta& a, const Tz& z) {
34+
FvarT hypergeometric_1F0(const Ta& a, const Tz& z) {
3535
partials_type_t<Ta> a_val = value_of(a);
3636
partials_type_t<Tz> z_val = value_of(z);
37-
FvarT rtn = FvarT(hypergeometric_1f0(a_val, z_val), 0.0);
37+
FvarT rtn = FvarT(hypergeometric_1F0(a_val, z_val), 0.0);
3838
if (!is_constant_all<Ta>::value) {
3939
rtn.d_ += forward_as<FvarT>(a).d() * -rtn.val() * log1m(z_val);
4040
}

stan/math/prim/fun/hypergeometric_1F0.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ namespace math {
2828
* @return Hypergeometric 1F0 function
2929
*/
3030
template <typename Ta, typename Tz, require_all_arithmetic_t<Ta, Tz>* = nullptr>
31-
return_type_t<Ta, Tz> hypergeometric_1f0(const Ta& a, const Tz& z) {
32-
constexpr const char* function = "hypergeometric_1f0";
33-
check_less("hypergeometric_1f0", "abs(z)", std::fabs(z), 1.0);
31+
return_type_t<Ta, Tz> hypergeometric_1F0(const Ta& a, const Tz& z) {
32+
constexpr const char* function = "hypergeometric_1F0";
33+
check_less("hypergeometric_1F0", "abs(z)", std::fabs(z), 1.0);
3434

3535
return boost::math::hypergeometric_1F0(a, z, boost_policy_t<>());
3636
}

stan/math/rev/fun/hypergeometric_1F0.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ namespace math {
3131
template <typename Ta, typename Tz,
3232
require_all_stan_scalar_t<Ta, Tz>* = nullptr,
3333
require_any_var_t<Ta, Tz>* = nullptr>
34-
var hypergeometric_1f0(const Ta& a, const Tz& z) {
34+
var hypergeometric_1F0(const Ta& a, const Tz& z) {
3535
double a_val = value_of(a);
3636
double z_val = value_of(z);
37-
double rtn = hypergeometric_1f0(a_val, z_val);
37+
double rtn = hypergeometric_1F0(a_val, z_val);
3838
return make_callback_var(rtn, [rtn, a, z, a_val, z_val](auto& vi) mutable {
3939
if (!is_constant_all<Ta>::value) {
4040
forward_as<var>(a).adj() += vi.adj() * -rtn * log1m(z_val);

test/unit/math/mix/fun/hypergeometric_1F0_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <test/unit/math/test_ad.hpp>
22

3-
TEST(mathMixScalFun, hypergeometric_1f0) {
3+
TEST(mathMixScalFun, hypergeometric_1F0) {
44
auto f = [](const auto& x1, const auto& x2) {
5-
using stan::math::hypergeometric_1f0;
6-
return hypergeometric_1f0(x1, x2);
5+
using stan::math::hypergeometric_1F0;
6+
return hypergeometric_1F0(x1, x2);
77
};
88

99
stan::test::expect_ad(f, 5, 0.3);

test/unit/math/prim/fun/hypergeometric_1F0_test.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
#include <cmath>
44
#include <limits>
55

6-
TEST(MathFunctions, hypergeometric_1f0Double) {
7-
using stan::math::hypergeometric_1f0;
6+
TEST(MathFunctions, hypergeometric_1F0Double) {
7+
using stan::math::hypergeometric_1F0;
88
using stan::math::inv;
99

10-
EXPECT_FLOAT_EQ(4.62962962963, hypergeometric_1f0(3, 0.4));
11-
EXPECT_FLOAT_EQ(0.510204081633, hypergeometric_1f0(2, -0.4));
12-
EXPECT_FLOAT_EQ(300.906354890, hypergeometric_1f0(16.0, 0.3));
13-
EXPECT_FLOAT_EQ(0.531441, hypergeometric_1f0(-6.0, 0.1));
10+
EXPECT_FLOAT_EQ(4.62962962963, hypergeometric_1F0(3, 0.4));
11+
EXPECT_FLOAT_EQ(0.510204081633, hypergeometric_1F0(2, -0.4));
12+
EXPECT_FLOAT_EQ(300.906354890, hypergeometric_1F0(16.0, 0.3));
13+
EXPECT_FLOAT_EQ(0.531441, hypergeometric_1F0(-6.0, 0.1));
1414
}
1515

16-
TEST(MathFunctions, hypergeometric_1f0_throw) {
17-
using stan::math::hypergeometric_1f0;
16+
TEST(MathFunctions, hypergeometric_1F0_throw) {
17+
using stan::math::hypergeometric_1F0;
1818

19-
EXPECT_THROW(hypergeometric_1f0(2.1, 1.0), std::domain_error);
20-
EXPECT_THROW(hypergeometric_1f0(0.5, 1.5), std::domain_error);
21-
EXPECT_THROW(hypergeometric_1f0(0.5, -1.0), std::domain_error);
22-
EXPECT_THROW(hypergeometric_1f0(0.5, -1.5), std::domain_error);
19+
EXPECT_THROW(hypergeometric_1F0(2.1, 1.0), std::domain_error);
20+
EXPECT_THROW(hypergeometric_1F0(0.5, 1.5), std::domain_error);
21+
EXPECT_THROW(hypergeometric_1F0(0.5, -1.0), std::domain_error);
22+
EXPECT_THROW(hypergeometric_1F0(0.5, -1.5), std::domain_error);
2323
}

0 commit comments

Comments
 (0)