diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7bb82d5..8ac47c00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Change Log / Ray Tracing in One Weekend
- Fix -- Remove premature source line for call to `get_sphere_uv` (#1701)
### The Rest of Your Life
+ - Fix -- Fix ICD formula for solved PDF in Importance Sampling (#1622)
----------------------------------------------------------------------------------------------------
diff --git a/books/RayTracingTheRestOfYourLife.html b/books/RayTracingTheRestOfYourLife.html
index 5af3fc0a..704a611e 100644
--- a/books/RayTracingTheRestOfYourLife.html
+++ b/books/RayTracingTheRestOfYourLife.html
@@ -1310,7 +1310,7 @@
and
- $$ P^{-1}(x) = \operatorname{ICD}(d) = 8d^\frac{1}{3} $$
+ $$ P^{-1}(x) = \operatorname{ICD}(d) = 2d^\frac{1}{3} $$
For just one sample we get:
@@ -1318,7 +1318,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
double icd(double d) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
- return 8.0 * std::pow(d, 1.0/3.0);
+ return 2.0 * std::pow(d, 1.0/3.0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
}
@@ -1362,8 +1362,8 @@
nonuniform PDF is usually called _importance sampling_.
In all of the examples given, we always converged to the correct answer of $8/3$. We got the same
-answer when we used both a uniform PDF and the "correct" PDF (that is, $\operatorname{ICD}(d) =
-8d^{\frac{1}{3}}$). While they both converged to the same answer, the uniform PDF took much longer.
+answer when we used both a uniform PDF and the solved PDF (that is, $p(r) =
+\frac{3}{8}r^2$). While they both converged to the same answer, the uniform PDF took much longer.
After all, we only needed a single sample from the PDF that perfectly matched the integral. This
should make sense, as we were choosing to sample the important parts of the distribution more often,
whereas the uniform PDF just sampled the whole distribution equally, without taking importance into
diff --git a/src/TheRestOfYourLife/integrate_x_sq.cc b/src/TheRestOfYourLife/integrate_x_sq.cc
index e680d553..7b95affe 100644
--- a/src/TheRestOfYourLife/integrate_x_sq.cc
+++ b/src/TheRestOfYourLife/integrate_x_sq.cc
@@ -16,7 +16,7 @@
double icd(double d) {
- return 8.0 * std::pow(d, 1.0/3.0);
+ return 2.0 * std::pow(d, 1.0/3.0);
}