\begin{algorithm}[t]
	\caption{\label{alg:diffRadiances}
		Unbiased Monte Carlo estimators of $\dev\Lv$ and $\dev\Ls$
	}
	\begin{algorithmic}[1]
		\Function{diffVolumeRadiance}{$\bx$, $\bom$}
		\Comment{$\dev\Lv(\bx, \bom)$}
			\State Calculate $d$ (via ray tracing) and $\dev d$
			\State $\tau \gets -\log(\mathrm{rand}())/\sigma_t$
			\If{$\tau < d$} \Comment{Calculate $\dev\Lins$}
				\State $\bx' \gets \bx - \tau\bom$
				\State Draw $\bom'$ from $f_p(\bom', \bom)$
				\State $v_1 \gets \textsc{diffVolumeRadiance}(\bx', \bom')$
				\State Draw $\by$ from $\boundary(\bx')$ with some probability density $p(\by)$
				\If{$\bx'$ and $\by$ are mutually visible}
					\State $\bom'' \gets (\by \to \bx')$
					\State Calculate $\gnorm$ and $\velocity$ \Comment{Eqs.~(\ref{eqn:rte3d_sph_norm}, \ref{eqn:rte3d_sph_vel})}
					\State $\Delta L \gets \textsc{volumeRadiance}(\bx', \bom'' - \epsilon\velocity)$
					\Statex[5] $-\; \textsc{volumeRadiance}(\bx', \bom'' + \epsilon\velocity)$
					\State $v_2 \gets | \langle \gnorm, \velocity \rangle | \, f_p(\bom'', \bom) \, \Delta L \, \frac{\sin\theta}{\| \by - \bx' \| \, p(\by)}$
				\Else
					\State $v_2 \gets 0$
				\EndIf
				\State \Return $\frac{\sigma_s}{\sigma_t}(v_1 + v_2)$
			\Else
				\State $v_1 \gets \textsc{diffSurfaceRadiance}(\bx_0, \bom)$
				\State $v_2 \gets \sigma_s \cdot \textsc{inScatteredRadiance}(\bx_0, \bom)$
				\Statex[4] $-\; \sigma_t \cdot \textsc{surfaceRadiance}(\bx_0, \bom)$
				\State \Return $v_1 + (\dev d) \; v_2$
			\EndIf
		\EndFunction
	\end{algorithmic}
	\vspace{0.5em}
	\begin{algorithmic}[1]
		\Function{diffSurfaceRadiance}{$\bx$, $\bom$}
		\Comment{$\dev\Ls(\bx, \bom)$}
			\State Draw $\bom'$ with some probability density $p(\bom')$
			\State $v_1 \gets \textsc{diffVolumeRadiance}(\bx, -\bom') \, f_s(\bom', \bom) / p(\bom')$
			\State Draw $\by$ from $\boundary(\bx)$ with probability density $p(\by)$
			\If{$\bx$ and $\by$ are mutually visible}
				\State $\bom'' \gets (\bx \to \by)$
				\State Calculate $\gnorm$ and $\velocity$ \Comment{Eqs.~(\ref{eqn:rte3d_sph_norm}, \ref{eqn:rte3d_sph_vel})}
				\State $\Delta\Li \gets \textsc{volumeRadiance}(\bx, -\bom'' - \epsilon\velocity)$
				\Statex[4] $-\; \textsc{volumeRadiance}(\bx, -\bom'' + \epsilon\velocity)$ 
				\State $v_2 \gets |\langle \gnorm, \velocity \rangle| \, f_s(\bom'', \bom) \, \Delta\Li \frac{\sin\theta}{\| \by - \bx \| p(\by)}$
			\Else
				\State $v_2 \gets 0$
			\EndIf
			\State \Return $v_1 + v_2$
		\EndFunction
	\end{algorithmic}
\end{algorithm}
