Disney BSSRDF, sample scattering profile, upper

Percentage Accurate: 95.9% → 96.2%
Time: 7.9s
Alternatives: 4
Speedup: 1.2×

Specification

?
\[\left(0 \leq s \land s \leq 256\right) \land \left(0.25 \leq u \land u \leq 1\right)\]
\[\begin{array}{l} \\ \left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \end{array} \]
(FPCore (s u)
 :precision binary32
 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
float code(float s, float u) {
	return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
function code(s, u)
	return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75))))))
end
function tmp = code(s, u)
	tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75)))));
end
\begin{array}{l}

\\
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
\end{array}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 4 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \end{array} \]
(FPCore (s u)
 :precision binary32
 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
float code(float s, float u) {
	return (3.0f * s) * logf((1.0f / (1.0f - ((u - 0.25f) / 0.75f))));
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = (3.0e0 * s) * log((1.0e0 / (1.0e0 - ((u - 0.25e0) / 0.75e0))))
end function
function code(s, u)
	return Float32(Float32(Float32(3.0) * s) * log(Float32(Float32(1.0) / Float32(Float32(1.0) - Float32(Float32(u - Float32(0.25)) / Float32(0.75))))))
end
function tmp = code(s, u)
	tmp = (single(3.0) * s) * log((single(1.0) / (single(1.0) - ((u - single(0.25)) / single(0.75)))));
end
\begin{array}{l}

\\
\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)
\end{array}

Alternative 1: 96.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ s \cdot \left(\log \left(1.3333333333333333 - u \cdot 1.3333333333333333\right) \cdot -3\right) \end{array} \]
(FPCore (s u)
 :precision binary32
 (* s (* (log (- 1.3333333333333333 (* u 1.3333333333333333))) -3.0)))
float code(float s, float u) {
	return s * (logf((1.3333333333333333f - (u * 1.3333333333333333f))) * -3.0f);
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = s * (log((1.3333333333333333e0 - (u * 1.3333333333333333e0))) * (-3.0e0))
end function
function code(s, u)
	return Float32(s * Float32(log(Float32(Float32(1.3333333333333333) - Float32(u * Float32(1.3333333333333333)))) * Float32(-3.0)))
end
function tmp = code(s, u)
	tmp = s * (log((single(1.3333333333333333) - (u * single(1.3333333333333333)))) * single(-3.0));
end
\begin{array}{l}

\\
s \cdot \left(\log \left(1.3333333333333333 - u \cdot 1.3333333333333333\right) \cdot -3\right)
\end{array}
Derivation
  1. Initial program 95.9%

    \[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \color{blue}{\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right)} \]
    2. lift-*.f32N/A

      \[\leadsto \color{blue}{\left(3 \cdot s\right)} \cdot \log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right) \]
    3. associate-*l*N/A

      \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right)\right)} \]
    4. *-commutativeN/A

      \[\leadsto 3 \cdot \color{blue}{\left(\log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right) \cdot s\right)} \]
    5. associate-*r*N/A

      \[\leadsto \color{blue}{\left(3 \cdot \log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right)\right) \cdot s} \]
    6. lower-*.f32N/A

      \[\leadsto \color{blue}{\left(3 \cdot \log \left(\frac{1}{1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}}\right)\right) \cdot s} \]
  4. Applied rewrites34.1%

    \[\leadsto \color{blue}{\left(-3 \cdot \mathsf{log1p}\left(-1.3333333333333333 \cdot \left(u - 0.25\right)\right)\right) \cdot s} \]
  5. Applied rewrites9.9%

    \[\leadsto \left(-3 \cdot \color{blue}{\log \left(1 - \mathsf{fma}\left(u, -1.3333333333333333, 0.3333333333333333\right)\right)}\right) \cdot s \]
  6. Applied rewrites96.6%

    \[\leadsto \left(-3 \cdot \log \color{blue}{\left(1.3333333333333333 - 1.3333333333333333 \cdot u\right)}\right) \cdot s \]
  7. Final simplification96.6%

    \[\leadsto s \cdot \left(\log \left(1.3333333333333333 - u \cdot 1.3333333333333333\right) \cdot -3\right) \]
  8. Add Preprocessing

Alternative 2: 30.3% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\frac{3}{u} + 1.5\right) \cdot s\right) \cdot u\right) \cdot u \end{array} \]
(FPCore (s u) :precision binary32 (* (* (* (+ (/ 3.0 u) 1.5) s) u) u))
float code(float s, float u) {
	return ((((3.0f / u) + 1.5f) * s) * u) * u;
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = ((((3.0e0 / u) + 1.5e0) * s) * u) * u
end function
function code(s, u)
	return Float32(Float32(Float32(Float32(Float32(Float32(3.0) / u) + Float32(1.5)) * s) * u) * u)
end
function tmp = code(s, u)
	tmp = ((((single(3.0) / u) + single(1.5)) * s) * u) * u;
end
\begin{array}{l}

\\
\left(\left(\left(\frac{3}{u} + 1.5\right) \cdot s\right) \cdot u\right) \cdot u
\end{array}
Derivation
  1. Initial program 95.9%

    \[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in u around 0

    \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
    2. lower-*.f32N/A

      \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
    4. lower-*.f32N/A

      \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
    5. lower-log.f327.4

      \[\leadsto \left(\color{blue}{\log 0.75} \cdot s\right) \cdot 3 \]
  5. Applied rewrites7.4%

    \[\leadsto \color{blue}{\left(\log 0.75 \cdot s\right) \cdot 3} \]
  6. Taylor expanded in u around 0

    \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right) + 3 \cdot s\right)} \]
  7. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \color{blue}{\left(3 \cdot s + \frac{3}{2} \cdot \left(s \cdot u\right)\right)} \]
    2. distribute-lft-inN/A

      \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(u \cdot \left(3 \cdot s\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right)\right)} \]
    3. *-commutativeN/A

      \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \left(u \cdot \left(3 \cdot s\right) + \color{blue}{\left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u}\right) \]
    4. associate-+r+N/A

      \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(3 \cdot s\right)\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u} \]
    5. *-commutativeN/A

      \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(3 \cdot s\right) \cdot u}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    6. associate-*r*N/A

      \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{3 \cdot \left(s \cdot u\right)}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    7. +-commutativeN/A

      \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot u\right) + 3 \cdot \left(s \cdot \log \frac{3}{4}\right)\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    8. distribute-lft-outN/A

      \[\leadsto \color{blue}{3 \cdot \left(s \cdot u + s \cdot \log \frac{3}{4}\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    9. *-commutativeN/A

      \[\leadsto \color{blue}{\left(s \cdot u + s \cdot \log \frac{3}{4}\right) \cdot 3} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    10. distribute-lft-outN/A

      \[\leadsto \color{blue}{\left(s \cdot \left(u + \log \frac{3}{4}\right)\right)} \cdot 3 + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    11. associate-*l*N/A

      \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
    12. *-commutativeN/A

      \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(\left(s \cdot u\right) \cdot \frac{3}{2}\right)} \cdot u \]
    13. associate-*l*N/A

      \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(s \cdot u\right) \cdot \left(\frac{3}{2} \cdot u\right)} \]
    14. associate-*l*N/A

      \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{s \cdot \left(u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
    15. distribute-lft-outN/A

      \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
    16. lower-*.f32N/A

      \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
    17. lower-fma.f32N/A

      \[\leadsto s \cdot \color{blue}{\mathsf{fma}\left(u + \log \frac{3}{4}, 3, u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
  8. Applied rewrites15.0%

    \[\leadsto \color{blue}{s \cdot \mathsf{fma}\left(\log 0.75 + u, 3, \left(u \cdot u\right) \cdot 1.5\right)} \]
  9. Taylor expanded in u around inf

    \[\leadsto {u}^{2} \cdot \color{blue}{\left(\frac{3}{2} \cdot s + 3 \cdot \frac{s}{u}\right)} \]
  10. Step-by-step derivation
    1. Applied rewrites29.9%

      \[\leadsto \left(\left(s \cdot \left(\frac{3}{u} + 1.5\right)\right) \cdot u\right) \cdot \color{blue}{u} \]
    2. Final simplification29.9%

      \[\leadsto \left(\left(\left(\frac{3}{u} + 1.5\right) \cdot s\right) \cdot u\right) \cdot u \]
    3. Add Preprocessing

    Alternative 3: 30.3% accurate, 4.6× speedup?

    \[\begin{array}{l} \\ \left(u \cdot u\right) \cdot \left(\left(\frac{3}{u} + 1.5\right) \cdot s\right) \end{array} \]
    (FPCore (s u) :precision binary32 (* (* u u) (* (+ (/ 3.0 u) 1.5) s)))
    float code(float s, float u) {
    	return (u * u) * (((3.0f / u) + 1.5f) * s);
    }
    
    real(4) function code(s, u)
        real(4), intent (in) :: s
        real(4), intent (in) :: u
        code = (u * u) * (((3.0e0 / u) + 1.5e0) * s)
    end function
    
    function code(s, u)
    	return Float32(Float32(u * u) * Float32(Float32(Float32(Float32(3.0) / u) + Float32(1.5)) * s))
    end
    
    function tmp = code(s, u)
    	tmp = (u * u) * (((single(3.0) / u) + single(1.5)) * s);
    end
    
    \begin{array}{l}
    
    \\
    \left(u \cdot u\right) \cdot \left(\left(\frac{3}{u} + 1.5\right) \cdot s\right)
    \end{array}
    
    Derivation
    1. Initial program 95.9%

      \[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in u around 0

      \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
      2. lower-*.f32N/A

        \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
      4. lower-*.f32N/A

        \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
      5. lower-log.f327.4

        \[\leadsto \left(\color{blue}{\log 0.75} \cdot s\right) \cdot 3 \]
    5. Applied rewrites7.4%

      \[\leadsto \color{blue}{\left(\log 0.75 \cdot s\right) \cdot 3} \]
    6. Taylor expanded in u around 0

      \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right) + 3 \cdot s\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \color{blue}{\left(3 \cdot s + \frac{3}{2} \cdot \left(s \cdot u\right)\right)} \]
      2. distribute-lft-inN/A

        \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(u \cdot \left(3 \cdot s\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right)\right)} \]
      3. *-commutativeN/A

        \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \left(u \cdot \left(3 \cdot s\right) + \color{blue}{\left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u}\right) \]
      4. associate-+r+N/A

        \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(3 \cdot s\right)\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u} \]
      5. *-commutativeN/A

        \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(3 \cdot s\right) \cdot u}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      6. associate-*r*N/A

        \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{3 \cdot \left(s \cdot u\right)}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      7. +-commutativeN/A

        \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot u\right) + 3 \cdot \left(s \cdot \log \frac{3}{4}\right)\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      8. distribute-lft-outN/A

        \[\leadsto \color{blue}{3 \cdot \left(s \cdot u + s \cdot \log \frac{3}{4}\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      9. *-commutativeN/A

        \[\leadsto \color{blue}{\left(s \cdot u + s \cdot \log \frac{3}{4}\right) \cdot 3} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      10. distribute-lft-outN/A

        \[\leadsto \color{blue}{\left(s \cdot \left(u + \log \frac{3}{4}\right)\right)} \cdot 3 + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      11. associate-*l*N/A

        \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
      12. *-commutativeN/A

        \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(\left(s \cdot u\right) \cdot \frac{3}{2}\right)} \cdot u \]
      13. associate-*l*N/A

        \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(s \cdot u\right) \cdot \left(\frac{3}{2} \cdot u\right)} \]
      14. associate-*l*N/A

        \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{s \cdot \left(u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
      15. distribute-lft-outN/A

        \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
      16. lower-*.f32N/A

        \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
      17. lower-fma.f32N/A

        \[\leadsto s \cdot \color{blue}{\mathsf{fma}\left(u + \log \frac{3}{4}, 3, u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
    8. Applied rewrites14.9%

      \[\leadsto \color{blue}{s \cdot \mathsf{fma}\left(\log 0.75 + u, 3, \left(u \cdot u\right) \cdot 1.5\right)} \]
    9. Taylor expanded in u around inf

      \[\leadsto \frac{3}{2} \cdot \color{blue}{\left(s \cdot {u}^{2}\right)} \]
    10. Step-by-step derivation
      1. Applied rewrites26.6%

        \[\leadsto \left(\left(u \cdot s\right) \cdot u\right) \cdot \color{blue}{1.5} \]
      2. Taylor expanded in u around inf

        \[\leadsto {u}^{2} \cdot \color{blue}{\left(\frac{3}{2} \cdot s + 3 \cdot \frac{s}{u}\right)} \]
      3. Step-by-step derivation
        1. Applied rewrites29.9%

          \[\leadsto \left(s \cdot \left(\frac{3}{u} + 1.5\right)\right) \cdot \color{blue}{\left(u \cdot u\right)} \]
        2. Final simplification29.9%

          \[\leadsto \left(u \cdot u\right) \cdot \left(\left(\frac{3}{u} + 1.5\right) \cdot s\right) \]
        3. Add Preprocessing

        Alternative 4: 29.9% accurate, 12.6× speedup?

        \[\begin{array}{l} \\ \left(3 \cdot u\right) \cdot s \end{array} \]
        (FPCore (s u) :precision binary32 (* (* 3.0 u) s))
        float code(float s, float u) {
        	return (3.0f * u) * s;
        }
        
        real(4) function code(s, u)
            real(4), intent (in) :: s
            real(4), intent (in) :: u
            code = (3.0e0 * u) * s
        end function
        
        function code(s, u)
        	return Float32(Float32(Float32(3.0) * u) * s)
        end
        
        function tmp = code(s, u)
        	tmp = (single(3.0) * u) * s;
        end
        
        \begin{array}{l}
        
        \\
        \left(3 \cdot u\right) \cdot s
        \end{array}
        
        Derivation
        1. Initial program 95.9%

          \[\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in u around 0

          \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
          2. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(s \cdot \log \frac{3}{4}\right) \cdot 3} \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
          4. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(\log \frac{3}{4} \cdot s\right)} \cdot 3 \]
          5. lower-log.f327.4

            \[\leadsto \left(\color{blue}{\log 0.75} \cdot s\right) \cdot 3 \]
        5. Applied rewrites7.4%

          \[\leadsto \color{blue}{\left(\log 0.75 \cdot s\right) \cdot 3} \]
        6. Taylor expanded in u around 0

          \[\leadsto \color{blue}{3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right) + 3 \cdot s\right)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \color{blue}{\left(3 \cdot s + \frac{3}{2} \cdot \left(s \cdot u\right)\right)} \]
          2. distribute-lft-inN/A

            \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(u \cdot \left(3 \cdot s\right) + u \cdot \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right)\right)} \]
          3. *-commutativeN/A

            \[\leadsto 3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \left(u \cdot \left(3 \cdot s\right) + \color{blue}{\left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u}\right) \]
          4. associate-+r+N/A

            \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + u \cdot \left(3 \cdot s\right)\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u} \]
          5. *-commutativeN/A

            \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{\left(3 \cdot s\right) \cdot u}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          6. associate-*r*N/A

            \[\leadsto \left(3 \cdot \left(s \cdot \log \frac{3}{4}\right) + \color{blue}{3 \cdot \left(s \cdot u\right)}\right) + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          7. +-commutativeN/A

            \[\leadsto \color{blue}{\left(3 \cdot \left(s \cdot u\right) + 3 \cdot \left(s \cdot \log \frac{3}{4}\right)\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          8. distribute-lft-outN/A

            \[\leadsto \color{blue}{3 \cdot \left(s \cdot u + s \cdot \log \frac{3}{4}\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          9. *-commutativeN/A

            \[\leadsto \color{blue}{\left(s \cdot u + s \cdot \log \frac{3}{4}\right) \cdot 3} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          10. distribute-lft-outN/A

            \[\leadsto \color{blue}{\left(s \cdot \left(u + \log \frac{3}{4}\right)\right)} \cdot 3 + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          11. associate-*l*N/A

            \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} + \left(\frac{3}{2} \cdot \left(s \cdot u\right)\right) \cdot u \]
          12. *-commutativeN/A

            \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(\left(s \cdot u\right) \cdot \frac{3}{2}\right)} \cdot u \]
          13. associate-*l*N/A

            \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{\left(s \cdot u\right) \cdot \left(\frac{3}{2} \cdot u\right)} \]
          14. associate-*l*N/A

            \[\leadsto s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right) + \color{blue}{s \cdot \left(u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
          15. distribute-lft-outN/A

            \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
          16. lower-*.f32N/A

            \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3 + u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
          17. lower-fma.f32N/A

            \[\leadsto s \cdot \color{blue}{\mathsf{fma}\left(u + \log \frac{3}{4}, 3, u \cdot \left(\frac{3}{2} \cdot u\right)\right)} \]
        8. Applied rewrites14.9%

          \[\leadsto \color{blue}{s \cdot \mathsf{fma}\left(\log 0.75 + u, 3, \left(u \cdot u\right) \cdot 1.5\right)} \]
        9. Taylor expanded in u around 0

          \[\leadsto \color{blue}{3 \cdot \left(s \cdot u\right) + 3 \cdot \left(s \cdot \log \frac{3}{4}\right)} \]
        10. Step-by-step derivation
          1. distribute-lft-outN/A

            \[\leadsto \color{blue}{3 \cdot \left(s \cdot u + s \cdot \log \frac{3}{4}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(s \cdot u + s \cdot \log \frac{3}{4}\right) \cdot 3} \]
          3. distribute-lft-outN/A

            \[\leadsto \color{blue}{\left(s \cdot \left(u + \log \frac{3}{4}\right)\right)} \cdot 3 \]
          4. associate-*r*N/A

            \[\leadsto \color{blue}{s \cdot \left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} \]
          5. *-commutativeN/A

            \[\leadsto s \cdot \color{blue}{\left(3 \cdot \left(u + \log \frac{3}{4}\right)\right)} \]
          6. *-commutativeN/A

            \[\leadsto \color{blue}{\left(3 \cdot \left(u + \log \frac{3}{4}\right)\right) \cdot s} \]
          7. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(3 \cdot \left(u + \log \frac{3}{4}\right)\right) \cdot s} \]
          8. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} \cdot s \]
          9. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(\left(u + \log \frac{3}{4}\right) \cdot 3\right)} \cdot s \]
          10. +-commutativeN/A

            \[\leadsto \left(\color{blue}{\left(\log \frac{3}{4} + u\right)} \cdot 3\right) \cdot s \]
          11. lower-+.f32N/A

            \[\leadsto \left(\color{blue}{\left(\log \frac{3}{4} + u\right)} \cdot 3\right) \cdot s \]
          12. lower-log.f3226.0

            \[\leadsto \left(\left(\color{blue}{\log 0.75} + u\right) \cdot 3\right) \cdot s \]
        11. Applied rewrites26.0%

          \[\leadsto \color{blue}{\left(\left(\log 0.75 + u\right) \cdot 3\right) \cdot s} \]
        12. Taylor expanded in u around inf

          \[\leadsto \left(3 \cdot u\right) \cdot s \]
        13. Step-by-step derivation
          1. Applied rewrites29.8%

            \[\leadsto \left(3 \cdot u\right) \cdot s \]
          2. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2024268 
          (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))))))