This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.wordWrap": "on", | |
"editor.fontFamily": "SauceCodePro Nerd Font", | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.colorTheme": "One Dark Pro", | |
"materialTheme.cache.workbench.settings": { | |
"themeColours": "Default High Contrast", | |
"accent": "Cyan", | |
"accentPrevious": "Indigo" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
T norm_pdf(T x, T mu, T sigma) | |
{ | |
static const T inv_sqrt_2pi = static_cast<T>(0.3989422804014327); // Precomputed 1/sqrt(2*PI) to avoid sqrt() | |
T a = (x - mu) / sigma; | |
return inv_sqrt_2pi / sigma * std::exp(-T(0.5) * a * a); | |
} | |
template <typename T> |