replaced some std::log/exp calls by the math::fastlog/exp equivalent

metadata
Wenzel Jakob 2013-01-27 19:50:49 -05:00
parent 58c61d2959
commit 87183a7534
3 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ void PSSMLTSampler::serialize(Stream *stream, InstanceManager *manager) const {
}
void PSSMLTSampler::configure() {
m_logRatio = -std::log(m_s2/m_s1);
m_logRatio = -math::fastlog(m_s2/m_s1);
m_time = 0;
m_largeStepTime = 0;
m_largeStep = false;

View File

@ -137,7 +137,7 @@ Point2 Warp::squareToStdNormal(const Point2 &sample) {
}
Float Warp::squareToStdNormalPdf(const Point2 &pos) {
return INV_TWOPI * std::exp(-(pos.x*pos.x + pos.y*pos.y)/2.0f);
return INV_TWOPI * math::fastexp(-(pos.x*pos.x + pos.y*pos.y)/2.0f);
}
static Float intervalToTent(Float sample) {

View File

@ -52,8 +52,8 @@ public:
Float eval(Float x) const {
Float alpha = -1.0f / (2.0f * m_stddev*m_stddev);
return std::max((Float) 0.0f,
std::exp(alpha * x * x) -
std::exp(alpha * m_radius * m_radius));
math::fastexp(alpha * x * x) -
math::fastexp(alpha * m_radius * m_radius));
}
std::string toString() const {