Skip to content

Commit 4b08e16

Browse files
committed
investigate drift in tests
1 parent 3fcf593 commit 4b08e16

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ TEST(MathFunctions, expInt0) {
1010
EXPECT_FLOAT_EQ(std::exp(3.1), exp(3.1));
1111
EXPECT_FLOAT_EQ(std::exp(3.0), exp(3.0));
1212
}
13+
TEST(MathFuncions, investigateDrift) {
14+
using stan::math::exp;
15+
for (size_t i = 0; i < 100; ++i) {
16+
EXPECT_FLOAT_EQ(std::exp(i), exp(i));
17+
std::cout << "std::exp: " << std::exp(i) << std::endl;
18+
std::cout << "stan::math::exp(i): " << stan::math::exp(i) << std::endl;
19+
}
20+
}
1321

1422
TEST(MathFunctions, expVecN100) {
1523
using stan::math::exp;
@@ -307,6 +315,15 @@ TEST(MathFunctions, expVecBench_10000000) {
307315
std::cout << ms_double.count() << "ms\n";
308316
}
309317

318+
TEST(MathFuncions, investigateDrift) {
319+
using stan::math::exp;
320+
for (size_t i = 0; i < 100; ++i) {
321+
EXPECT_FLOAT_EQ(std::exp(i), exp(i));
322+
std::cout << "std::exp: " << std::exp(i) << std::endl;
323+
std::cout << "stan::math::exp(i): " << stan::math::exp(i) << std::endl;
324+
}
325+
}
326+
310327
TEST(MathFunctions, expVecBench) {
311328
std::cout << "NO THREADING 10000 Nincr\n";
312329
// std timing includes

0 commit comments

Comments
 (0)