Disney BSSRDF, sample scattering profile, upper

Percentage Accurate: 95.9% → 96.7%
Time: 7.2s
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.7% accurate, 1.1× speedup?

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

\\
\left(-3 \cdot \log \left(\frac{u - 0.25}{-0.75} + 1\right)\right) \cdot s
\end{array}
Derivation
  1. Initial program 95.8%

    \[\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 rewrites33.0%

    \[\leadsto \color{blue}{\left(-3 \cdot \mathsf{log1p}\left(-1.3333333333333333 \cdot \left(u - 0.25\right)\right)\right) \cdot s} \]
  5. Step-by-step derivation
    1. lift-log1p.f32N/A

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

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

      \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\frac{-4}{3} \cdot \left(u - \frac{1}{4}\right) + 1\right)}\right) \cdot s \]
    4. lower-log.f3296.2

      \[\leadsto \left(-3 \cdot \color{blue}{\log \left(-1.3333333333333333 \cdot \left(u - 0.25\right) + 1\right)}\right) \cdot s \]
    5. lift-+.f32N/A

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(u - \frac{1}{4}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    11. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \color{blue}{\frac{1}{\frac{3}{4}}}\right)\right)\right)\right) \cdot s \]
    12. div-invN/A

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\frac{\color{blue}{u - \frac{1}{4}}}{\frac{3}{4}}\right)\right)\right)\right) \cdot s \]
    14. sub-negN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 - \color{blue}{\left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right)}\right)\right) \cdot s \]
    20. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 - \left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right) \cdot s \]
    21. metadata-evalN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1.3333333333333333 - \color{blue}{1.3333333333333333 \cdot u}\right)\right) \cdot s \]
  6. Applied rewrites95.9%

    \[\leadsto \left(-3 \cdot \color{blue}{\log \left(1.3333333333333333 - 1.3333333333333333 \cdot u\right)}\right) \cdot s \]
  7. Step-by-step derivation
    1. lift--.f32N/A

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

      \[\leadsto \left(-3 \cdot \log \left(\frac{4}{3} - \color{blue}{\frac{4}{3} \cdot u}\right)\right) \cdot s \]
    3. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(\left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{4}{3}\right)\right)} \cdot u\right) + \frac{1}{3}\right)\right) \cdot s \]
    12. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right) + 1\right)}\right) \cdot s \]
  8. Applied rewrites96.2%

    \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\left(u - 0.25\right) \cdot -1.3333333333333333 + 1\right)}\right) \cdot s \]
  9. Step-by-step derivation
    1. lift--.f32N/A

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(\color{blue}{\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \frac{4}{3}\right)\right)} + 1\right)\right) \cdot s \]
    5. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \color{blue}{\frac{1}{\frac{3}{4}}}\right)\right) + 1\right)\right) \cdot s \]
    6. div-invN/A

      \[\leadsto \left(-3 \cdot \log \left(\left(\mathsf{neg}\left(\color{blue}{\frac{u - \frac{1}{4}}{\frac{3}{4}}}\right)\right) + 1\right)\right) \cdot s \]
    7. distribute-neg-frac2N/A

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

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

      \[\leadsto \left(-3 \cdot \log \left(\frac{\color{blue}{u - \frac{1}{4}}}{\mathsf{neg}\left(\frac{3}{4}\right)} + 1\right)\right) \cdot s \]
    10. metadata-eval96.5

      \[\leadsto \left(-3 \cdot \log \left(\frac{u - 0.25}{\color{blue}{-0.75}} + 1\right)\right) \cdot s \]
  10. Applied rewrites96.5%

    \[\leadsto \left(-3 \cdot \log \left(\color{blue}{\frac{u - 0.25}{-0.75}} + 1\right)\right) \cdot s \]
  11. Add Preprocessing

Alternative 2: 96.5% accurate, 1.1× speedup?

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

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

    \[\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 rewrites32.9%

    \[\leadsto \color{blue}{\left(-3 \cdot \mathsf{log1p}\left(-1.3333333333333333 \cdot \left(u - 0.25\right)\right)\right) \cdot s} \]
  5. Step-by-step derivation
    1. lift-log1p.f32N/A

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

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

      \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\frac{-4}{3} \cdot \left(u - \frac{1}{4}\right) + 1\right)}\right) \cdot s \]
    4. lower-log.f3296.2

      \[\leadsto \left(-3 \cdot \color{blue}{\log \left(-1.3333333333333333 \cdot \left(u - 0.25\right) + 1\right)}\right) \cdot s \]
    5. lift-+.f32N/A

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(u - \frac{1}{4}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    11. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \color{blue}{\frac{1}{\frac{3}{4}}}\right)\right)\right)\right) \cdot s \]
    12. div-invN/A

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\frac{\color{blue}{u - \frac{1}{4}}}{\frac{3}{4}}\right)\right)\right)\right) \cdot s \]
    14. sub-negN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 - \color{blue}{\left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right)}\right)\right) \cdot s \]
    20. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 - \left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right) \cdot s \]
    21. metadata-evalN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1.3333333333333333 - \color{blue}{1.3333333333333333 \cdot u}\right)\right) \cdot s \]
  6. Applied rewrites95.9%

    \[\leadsto \left(-3 \cdot \color{blue}{\log \left(1.3333333333333333 - 1.3333333333333333 \cdot u\right)}\right) \cdot s \]
  7. Step-by-step derivation
    1. lift--.f32N/A

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

      \[\leadsto \left(-3 \cdot \log \left(\frac{4}{3} - \color{blue}{\frac{4}{3} \cdot u}\right)\right) \cdot s \]
    3. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(\left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{4}{3}\right)\right)} \cdot u\right) + \frac{1}{3}\right)\right) \cdot s \]
    12. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right) + 1\right)}\right) \cdot s \]
  8. Applied rewrites96.2%

    \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\left(u - 0.25\right) \cdot -1.3333333333333333 + 1\right)}\right) \cdot s \]
  9. Add Preprocessing

Alternative 3: 96.2% accurate, 1.2× speedup?

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

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

    \[\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.3%

    \[\leadsto \color{blue}{\left(-3 \cdot \mathsf{log1p}\left(-1.3333333333333333 \cdot \left(u - 0.25\right)\right)\right) \cdot s} \]
  5. Step-by-step derivation
    1. lift-log1p.f32N/A

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

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

      \[\leadsto \left(-3 \cdot \log \color{blue}{\left(\frac{-4}{3} \cdot \left(u - \frac{1}{4}\right) + 1\right)}\right) \cdot s \]
    4. lower-log.f3296.2

      \[\leadsto \left(-3 \cdot \color{blue}{\log \left(-1.3333333333333333 \cdot \left(u - 0.25\right) + 1\right)}\right) \cdot s \]
    5. lift-+.f32N/A

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(u - \frac{1}{4}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \frac{4}{3}\right)\right)}\right)\right) \cdot s \]
    11. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right) \cdot \color{blue}{\frac{1}{\frac{3}{4}}}\right)\right)\right)\right) \cdot s \]
    12. div-invN/A

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

      \[\leadsto \left(-3 \cdot \log \left(1 + \left(\mathsf{neg}\left(\frac{\color{blue}{u - \frac{1}{4}}}{\frac{3}{4}}\right)\right)\right)\right) \cdot s \]
    14. sub-negN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1 - \color{blue}{\left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right)}\right)\right) \cdot s \]
    20. metadata-evalN/A

      \[\leadsto \left(-3 \cdot \log \left(1 - \left(\frac{4}{3} \cdot u + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right) \cdot s \]
    21. metadata-evalN/A

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

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

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

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

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

      \[\leadsto \left(-3 \cdot \log \left(1.3333333333333333 - \color{blue}{1.3333333333333333 \cdot u}\right)\right) \cdot s \]
  6. Applied rewrites95.9%

    \[\leadsto \left(-3 \cdot \color{blue}{\log \left(1.3333333333333333 - 1.3333333333333333 \cdot u\right)}\right) \cdot s \]
  7. 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.8%

    \[\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 rewrites33.5%

    \[\leadsto \color{blue}{\left(-3 \cdot \mathsf{log1p}\left(-1.3333333333333333 \cdot \left(u - 0.25\right)\right)\right) \cdot s} \]
  5. Taylor expanded in u around 0

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\log \frac{4}{3}}, -3, 3 \cdot u\right) \cdot s \]
    4. lower-*.f328.1

      \[\leadsto \mathsf{fma}\left(\log 1.3333333333333333, -3, \color{blue}{3 \cdot u}\right) \cdot s \]
  7. Applied rewrites8.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log 1.3333333333333333, -3, 3 \cdot u\right)} \cdot s \]
  8. Taylor expanded in u around inf

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

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

    Reproduce

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