Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/pow"
"@stdlib/math/base/special/pow",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -61,7 +62,8 @@
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/exp",
"@stdlib/constants/float64/eps",
"@stdlib/math/base/special/pow"
"@stdlib/math/base/special/pow",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -79,7 +81,8 @@
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/exp",
"@stdlib/math/base/special/pow"
"@stdlib/math/base/special/pow",
"@stdlib/constants/float64/nan"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "stdlib/math/base/special/abs.h"
#include "stdlib/math/base/special/exp.h"
#include "stdlib/math/base/special/pow.h"
#include "stdlib/constants/float64/nan.h"

/**
* Evaluates the moment-generating function (MGF) for a Laplace (double exponential) distribution with location parameter `mu` and scale parameter `b` at a value `t`.
Expand All @@ -43,7 +44,7 @@ double stdlib_base_dists_laplace_mgf( const double t, const double mu, const dou
b <= 0.0 ||
stdlib_base_abs( t ) >= 1.0/b
) {
return 0.0/0.0; // NaN
return STDLIB_CONSTANT_FLOAT64_NAN;
}
bt = b * t;
return stdlib_base_exp( mu * t ) / ( 1.0 - stdlib_base_pow( bt, 2.0 ) );
Expand Down
Loading