Average Error: 1.3 → 1.0
Time: 6.8s
Precision: binary32
\[\left(0 \leq s \land s \leq 256\right) \land \left(0.25 \leq u \land u \leq 1\right)\]
\[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
\[\begin{array}{l} t_0 := \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)\\ s \cdot \left(\sqrt[3]{t_0 \cdot {t_0}^{2}} \cdot -3\right) \end{array} \]
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
\begin{array}{l}
t_0 := \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)\\
s \cdot \left(\sqrt[3]{t_0 \cdot {t_0}^{2}} \cdot -3\right)
\end{array}
(FPCore (s u)
 :precision binary32
 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
(FPCore (s u)
 :precision binary32
 (let* ((t_0 (log (fma u -1.3333333333333333 1.3333333333333333))))
   (* s (* (cbrt (* t_0 (pow t_0 2.0))) -3.0))))
float code(float s, float u) {
	return (3.0f * s) * logf(1.0f / (1.0f - ((u - 0.25f) / 0.75f)));
}
float code(float s, float u) {
	float t_0 = logf(fmaf(u, -1.3333333333333333f, 1.3333333333333333f));
	return s * (cbrtf(t_0 * powf(t_0, 2.0f)) * -3.0f);
}

Error

Bits error versus s

Bits error versus u

Derivation

  1. Initial program 1.3

    \[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
  2. Simplified1.0

    \[\leadsto \color{blue}{s \cdot \left(\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right) \cdot -3\right)} \]
  3. Applied add-cbrt-cube_binary321.0

    \[\leadsto s \cdot \left(\color{blue}{\sqrt[3]{\left(\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right) \cdot \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)\right) \cdot \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}} \cdot -3\right) \]
  4. Applied pow1_binary321.0

    \[\leadsto s \cdot \left(\sqrt[3]{\left(\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right) \cdot \color{blue}{{\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}^{1}}\right) \cdot \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)} \cdot -3\right) \]
  5. Applied pow1_binary321.0

    \[\leadsto s \cdot \left(\sqrt[3]{\left(\color{blue}{{\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}^{1}} \cdot {\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}^{1}\right) \cdot \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)} \cdot -3\right) \]
  6. Applied pow-sqr_binary321.0

    \[\leadsto s \cdot \left(\sqrt[3]{\color{blue}{{\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}^{\left(2 \cdot 1\right)}} \cdot \log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)} \cdot -3\right) \]
  7. Final simplification1.0

    \[\leadsto s \cdot \left(\sqrt[3]{\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right) \cdot {\log \left(\mathsf{fma}\left(u, -1.3333333333333333, 1.3333333333333333\right)\right)}^{2}} \cdot -3\right) \]

Reproduce

herbie shell --seed 2021329 
(FPCore (s u)
  :name "Disney BSSRDF, sample scattering profile, upper"
  :precision binary32
  :pre (and (and (<= 0.0 s) (<= s 256.0)) (and (<= 0.25 u) (<= u 1.0)))
  (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))