newton-bisection robustness improvements

metadata
Wenzel Jakob 2016-10-27 09:33:46 +02:00
parent 87816597b7
commit d81fbae942
1 changed files with 2 additions and 2 deletions

View File

@ -157,7 +157,7 @@ Float sampleCubicInterp1D(size_t idx, const Float *values, size_t size, Float mi
/* Invert CDF using Newton-Bisection */ /* Invert CDF using Newton-Bisection */
while (true) { while (true) {
if (!(b >= a && b <= c)) if (!(b > a && b < c))
b = 0.5f * (a + c); b = 0.5f * (a + c);
/* CDF and PDF in Horner form */ /* CDF and PDF in Horner form */
@ -210,7 +210,7 @@ Float sampleCubicInterp1DN(size_t idx, const Float *nodes, const Float *values,
/* Invert CDF using Newton-Bisection */ /* Invert CDF using Newton-Bisection */
while (true) { while (true) {
if (!(b >= a && b <= c)) if (!(b > a && b < c))
b = 0.5f * (a + c); b = 0.5f * (a + c);
/* CDF and PDF in Horner form */ /* CDF and PDF in Horner form */