replaced some std::log/exp calls by the math::fastlog/exp equivalent
parent
58c61d2959
commit
87183a7534
|
@ -50,7 +50,7 @@ void PSSMLTSampler::serialize(Stream *stream, InstanceManager *manager) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSSMLTSampler::configure() {
|
void PSSMLTSampler::configure() {
|
||||||
m_logRatio = -std::log(m_s2/m_s1);
|
m_logRatio = -math::fastlog(m_s2/m_s1);
|
||||||
m_time = 0;
|
m_time = 0;
|
||||||
m_largeStepTime = 0;
|
m_largeStepTime = 0;
|
||||||
m_largeStep = false;
|
m_largeStep = false;
|
||||||
|
|
|
@ -137,7 +137,7 @@ Point2 Warp::squareToStdNormal(const Point2 &sample) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Float Warp::squareToStdNormalPdf(const Point2 &pos) {
|
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) {
|
static Float intervalToTent(Float sample) {
|
||||||
|
|
|
@ -52,8 +52,8 @@ public:
|
||||||
Float eval(Float x) const {
|
Float eval(Float x) const {
|
||||||
Float alpha = -1.0f / (2.0f * m_stddev*m_stddev);
|
Float alpha = -1.0f / (2.0f * m_stddev*m_stddev);
|
||||||
return std::max((Float) 0.0f,
|
return std::max((Float) 0.0f,
|
||||||
std::exp(alpha * x * x) -
|
math::fastexp(alpha * x * x) -
|
||||||
std::exp(alpha * m_radius * m_radius));
|
math::fastexp(alpha * m_radius * m_radius));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string toString() const {
|
std::string toString() const {
|
||||||
|
|
Loading…
Reference in New Issue