Disney BSSRDF, sample scattering profile, upper

Percentage Accurate: 95.8% → 98.2%
Time: 10.6s
Alternatives: 16
Speedup: 1.0×

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 16 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.8% 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: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(s \cdot \mathsf{log1p}\left(\frac{0.25 - u}{0.75}\right)\right) \cdot -3 \end{array} \]
(FPCore (s u) :precision binary32 (* (* s (log1p (/ (- 0.25 u) 0.75))) -3.0))
float code(float s, float u) {
	return (s * log1pf(((0.25f - u) / 0.75f))) * -3.0f;
}
function code(s, u)
	return Float32(Float32(s * log1p(Float32(Float32(Float32(0.25) - u) / Float32(0.75)))) * Float32(-3.0))
end
\begin{array}{l}

\\
\left(s \cdot \mathsf{log1p}\left(\frac{0.25 - u}{0.75}\right)\right) \cdot -3
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot \log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \color{blue}{-3}\right) \]
  6. Applied egg-rr96.4%

    \[\leadsto \color{blue}{\left(s \cdot \mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right)\right) \cdot -3} \]
  7. Step-by-step derivation
    1. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\left(\frac{1}{3} + \frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), -3\right) \]
    2. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\left(\frac{1}{3} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right)\right), -3\right) \]
    3. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\left(\frac{1}{3} - \frac{u}{\frac{3}{4}}\right)\right)\right), -3\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} - \frac{u}{\frac{3}{4}}\right)\right)\right), -3\right) \]
    5. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4} - u}{\frac{3}{4}}\right)\right)\right), -3\right) \]
    6. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right)\right), -3\right) \]
    7. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, \mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right)\right), -3\right) \]
  8. Applied egg-rr98.2%

    \[\leadsto \left(s \cdot \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right)\right) \cdot -3 \]
  9. Add Preprocessing

Alternative 2: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{log1p}\left(\frac{0.25 - u}{0.75}\right) \cdot \left(s \cdot -3\right) \end{array} \]
(FPCore (s u) :precision binary32 (* (log1p (/ (- 0.25 u) 0.75)) (* s -3.0)))
float code(float s, float u) {
	return log1pf(((0.25f - u) / 0.75f)) * (s * -3.0f);
}
function code(s, u)
	return Float32(log1p(Float32(Float32(Float32(0.25) - u) / Float32(0.75))) * Float32(s * Float32(-3.0)))
end
\begin{array}{l}

\\
\mathsf{log1p}\left(\frac{0.25 - u}{0.75}\right) \cdot \left(s \cdot -3\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Add Preprocessing

Alternative 3: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(s \cdot -3\right) \cdot \mathsf{log1p}\left(\left(0.25 - u\right) \cdot 1.3333333333333333\right) \end{array} \]
(FPCore (s u)
 :precision binary32
 (* (* s -3.0) (log1p (* (- 0.25 u) 1.3333333333333333))))
float code(float s, float u) {
	return (s * -3.0f) * log1pf(((0.25f - u) * 1.3333333333333333f));
}
function code(s, u)
	return Float32(Float32(s * Float32(-3.0)) * log1p(Float32(Float32(Float32(0.25) - u) * Float32(1.3333333333333333))))
end
\begin{array}{l}

\\
\left(s \cdot -3\right) \cdot \mathsf{log1p}\left(\left(0.25 - u\right) \cdot 1.3333333333333333\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. div-invN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right) \cdot \frac{1}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{4} - u\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    18. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    19. metadata-eval97.9%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{*.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{4}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr97.9%

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

    \[\leadsto \left(s \cdot -3\right) \cdot \mathsf{log1p}\left(\left(0.25 - u\right) \cdot 1.3333333333333333\right) \]
  8. Add Preprocessing

Alternative 4: 94.7% accurate, 1.0× speedup?

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

\\
\left(s \cdot -3\right) \cdot \log \left(1.3333333333333333 + \frac{u}{-0.75}\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(1 + \left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. associate-+r+N/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(\left(1 + \frac{u}{\frac{-3}{4}}\right) + \frac{1}{3}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(\left(1 + \frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right) + \frac{1}{3}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(\left(1 + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right) + \frac{1}{3}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(\left(1 - \frac{u}{\frac{3}{4}}\right) + \frac{1}{3}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(1 - \left(\frac{u}{\frac{3}{4}} - \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(1 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(\color{blue}{s}, -3\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(1 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(1 - \left(\frac{u}{\frac{3}{4}} - \frac{1}{3}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\left(1 - \frac{u}{\frac{3}{4}}\right) + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\left(1 + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right) + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\left(1 + \frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right) + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\left(1 + \frac{u}{\frac{-3}{4}}\right) + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\left(\frac{u}{\frac{-3}{4}} + 1\right) + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. associate-+l+N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(1 + \frac{1}{3}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{4}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    19. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    20. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{u}{\frac{-3}{4}}\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    21. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\mathsf{+.f32}\left(\mathsf{/.f32}\left(u, \frac{-3}{4}\right), \left(\frac{1}{\frac{3}{4}}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    22. metadata-eval94.9%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log.f32}\left(\mathsf{+.f32}\left(\mathsf{/.f32}\left(u, \frac{-3}{4}\right), \frac{4}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr94.9%

    \[\leadsto \color{blue}{\log \left(\frac{u}{-0.75} + 1.3333333333333333\right)} \cdot \left(s \cdot -3\right) \]
  7. Final simplification94.9%

    \[\leadsto \left(s \cdot -3\right) \cdot \log \left(1.3333333333333333 + \frac{u}{-0.75}\right) \]
  8. Add Preprocessing

Alternative 5: 37.7% accurate, 5.4× speedup?

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

\\
\left(s \cdot -3\right) \cdot \left(u \cdot \left(\left(u \cdot u\right) \cdot \left(u \cdot \left(-0.7901234567901234 - \frac{0.7901234567901234 + \frac{0.8888888888888888}{u}}{u}\right)\right)\right)\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

    \[\leadsto \mathsf{*.f32}\left(\color{blue}{\left(u \cdot \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) - \frac{4}{3}\right)\right)}, \mathsf{*.f32}\left(s, -3\right)\right) \]
  11. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) - \frac{4}{3}\right)\right), \mathsf{*.f32}\left(\color{blue}{s}, -3\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) + \left(\mathsf{neg}\left(\frac{4}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) + \frac{-4}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(\frac{-4}{3} + u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) + \left(\mathsf{neg}\left(\frac{8}{9}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) + \frac{-8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(\frac{-8}{9} + u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u + \left(\mathsf{neg}\left(\frac{64}{81}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u + \frac{-64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} + \frac{-64}{81} \cdot u\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \left(\frac{-64}{81} \cdot u\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \left(u \cdot \frac{-64}{81}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. *-lowering-*.f3227.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \mathsf{*.f32}\left(u, \frac{-64}{81}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  12. Simplified27.3%

    \[\leadsto \color{blue}{\left(u \cdot \left(-1.3333333333333333 + u \cdot \left(-0.8888888888888888 + u \cdot \left(-0.7901234567901234 + u \cdot -0.7901234567901234\right)\right)\right)\right)} \cdot \left(s \cdot -3\right) \]
  13. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \color{blue}{\left({u}^{3} \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)}\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  14. Step-by-step derivation
    1. unpow3N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(\left(\left(u \cdot u\right) \cdot u\right) \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(\left({u}^{2} \cdot u\right) \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left({u}^{2} \cdot \left(u \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\left({u}^{2}\right), \left(u \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\left(u \cdot u\right), \left(u \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \left(u \cdot \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} - \frac{64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} + \left(\mathsf{neg}\left(\frac{64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(-1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u} + \frac{-64}{81}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(\frac{-64}{81} + -1 \cdot \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(\frac{-64}{81} + \left(\mathsf{neg}\left(\frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. unsub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \left(\frac{-64}{81} - \frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. --lowering--.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \left(\frac{\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}}{u}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \mathsf{/.f32}\left(\left(\frac{64}{81} + \frac{8}{9} \cdot \frac{1}{u}\right), u\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{64}{81}, \left(\frac{8}{9} \cdot \frac{1}{u}\right)\right), u\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. associate-*r/N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{64}{81}, \left(\frac{\frac{8}{9} \cdot 1}{u}\right)\right), u\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{64}{81}, \left(\frac{\frac{8}{9}}{u}\right)\right), u\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    18. /-lowering-/.f3237.8%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\frac{-64}{81}, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{64}{81}, \mathsf{/.f32}\left(\frac{8}{9}, u\right)\right), u\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  15. Simplified37.8%

    \[\leadsto \left(u \cdot \color{blue}{\left(\left(u \cdot u\right) \cdot \left(u \cdot \left(-0.7901234567901234 - \frac{0.7901234567901234 + \frac{0.8888888888888888}{u}}{u}\right)\right)\right)}\right) \cdot \left(s \cdot -3\right) \]
  16. Final simplification37.8%

    \[\leadsto \left(s \cdot -3\right) \cdot \left(u \cdot \left(\left(u \cdot u\right) \cdot \left(u \cdot \left(-0.7901234567901234 - \frac{0.7901234567901234 + \frac{0.8888888888888888}{u}}{u}\right)\right)\right)\right) \]
  17. Add Preprocessing

Alternative 6: 30.0% accurate, 7.5× speedup?

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

\\
\left(s \cdot -3\right) \cdot \left(u \cdot \left(-1.3333333333333333 + -0.7901234567901234 \cdot \left(u \cdot \left(u \cdot u\right)\right)\right)\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

    \[\leadsto \mathsf{*.f32}\left(\color{blue}{\left(u \cdot \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) - \frac{4}{3}\right)\right)}, \mathsf{*.f32}\left(s, -3\right)\right) \]
  11. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) - \frac{4}{3}\right)\right), \mathsf{*.f32}\left(\color{blue}{s}, -3\right)\right) \]
    2. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) + \left(\mathsf{neg}\left(\frac{4}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right) + \frac{-4}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(\frac{-4}{3} + u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \left(u \cdot \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) - \frac{8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) + \left(\mathsf{neg}\left(\frac{8}{9}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right) + \frac{-8}{9}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \left(\frac{-8}{9} + u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \left(u \cdot \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u - \frac{64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u + \left(\mathsf{neg}\left(\frac{64}{81}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} \cdot u + \frac{-64}{81}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \left(\frac{-64}{81} + \frac{-64}{81} \cdot u\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \left(\frac{-64}{81} \cdot u\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \left(u \cdot \frac{-64}{81}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. *-lowering-*.f3227.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-8}{9}, \mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-64}{81}, \mathsf{*.f32}\left(u, \frac{-64}{81}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  12. Simplified27.3%

    \[\leadsto \color{blue}{\left(u \cdot \left(-1.3333333333333333 + u \cdot \left(-0.8888888888888888 + u \cdot \left(-0.7901234567901234 + u \cdot -0.7901234567901234\right)\right)\right)\right)} \cdot \left(s \cdot -3\right) \]
  13. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \color{blue}{\left(\frac{-64}{81} \cdot {u}^{3}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  14. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \left({u}^{3} \cdot \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\left({u}^{3}\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. cube-multN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\left(u \cdot \left(u \cdot u\right)\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\left(u \cdot {u}^{2}\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left({u}^{2}\right)\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot u\right)\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. *-lowering-*.f3230.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{+.f32}\left(\frac{-4}{3}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \frac{-64}{81}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  15. Simplified30.2%

    \[\leadsto \left(u \cdot \left(-1.3333333333333333 + \color{blue}{\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.7901234567901234}\right)\right) \cdot \left(s \cdot -3\right) \]
  16. Final simplification30.2%

    \[\leadsto \left(s \cdot -3\right) \cdot \left(u \cdot \left(-1.3333333333333333 + -0.7901234567901234 \cdot \left(u \cdot \left(u \cdot u\right)\right)\right)\right) \]
  17. Add Preprocessing

Alternative 7: 29.5% accurate, 12.6× speedup?

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

\\
\frac{1}{\frac{\frac{0.75}{u}}{s \cdot 3}}
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot u}{\frac{-3}{4}} \]
    6. frac-2negN/A

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot \left(\mathsf{neg}\left(u\right)\right)}{\frac{3}{4}} \]
    9. neg-mul-1N/A

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

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

      \[\leadsto \left(\left(s \cdot -3\right) \cdot -1\right) \cdot \color{blue}{\frac{u}{\frac{3}{4}}} \]
    12. clear-numN/A

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot -1}{\color{blue}{\frac{\frac{3}{4}}{u}}} \]
    14. clear-numN/A

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

      \[\leadsto \mathsf{/.f32}\left(1, \color{blue}{\left(\frac{\frac{\frac{3}{4}}{u}}{\left(s \cdot -3\right) \cdot -1}\right)}\right) \]
    16. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{\frac{3}{4}}{u}\right), \color{blue}{\left(\left(s \cdot -3\right) \cdot -1\right)}\right)\right) \]
    17. /-lowering-/.f32N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{3}{4}, u\right), \left(s \cdot 3\right)\right)\right) \]
    20. *-lowering-*.f3229.8%

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{3}{4}, u\right), \mathsf{*.f32}\left(s, \color{blue}{3}\right)\right)\right) \]
  14. Applied egg-rr29.8%

    \[\leadsto \color{blue}{\frac{1}{\frac{\frac{0.75}{u}}{s \cdot 3}}} \]
  15. Add Preprocessing

Alternative 8: 29.5% accurate, 16.1× speedup?

\[\begin{array}{l} \\ \frac{1}{\frac{\frac{0.25}{u}}{s}} \end{array} \]
(FPCore (s u) :precision binary32 (/ 1.0 (/ (/ 0.25 u) s)))
float code(float s, float u) {
	return 1.0f / ((0.25f / u) / s);
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = 1.0e0 / ((0.25e0 / u) / s)
end function
function code(s, u)
	return Float32(Float32(1.0) / Float32(Float32(Float32(0.25) / u) / s))
end
function tmp = code(s, u)
	tmp = single(1.0) / ((single(0.25) / u) / s);
end
\begin{array}{l}

\\
\frac{1}{\frac{\frac{0.25}{u}}{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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto s \cdot \color{blue}{\left(u \cdot 4\right)} \]
    2. metadata-evalN/A

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

      \[\leadsto s \cdot \frac{u}{\color{blue}{\frac{1}{4}}} \]
    4. clear-numN/A

      \[\leadsto s \cdot \frac{1}{\color{blue}{\frac{\frac{1}{4}}{u}}} \]
    5. un-div-invN/A

      \[\leadsto \frac{s}{\color{blue}{\frac{\frac{1}{4}}{u}}} \]
    6. clear-numN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\frac{1}{4}}{u}}{s}}} \]
    7. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(1, \color{blue}{\left(\frac{\frac{\frac{1}{4}}{u}}{s}\right)}\right) \]
    8. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{\frac{1}{4}}{u}\right), \color{blue}{s}\right)\right) \]
    9. /-lowering-/.f3229.8%

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, u\right), s\right)\right) \]
  14. Applied egg-rr29.8%

    \[\leadsto \color{blue}{\frac{1}{\frac{\frac{0.25}{u}}{s}}} \]
  15. Add Preprocessing

Alternative 9: 29.5% accurate, 16.1× speedup?

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

\\
\frac{1}{\frac{0.25}{s \cdot u}}
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

      \[\leadsto \frac{s \cdot u}{\color{blue}{\frac{1}{4}}} \]
    3. clear-numN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{4}}{s \cdot u}}} \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(1, \color{blue}{\left(\frac{\frac{1}{4}}{s \cdot u}\right)}\right) \]
    5. /-lowering-/.f32N/A

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

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\frac{1}{4}, \left(u \cdot \color{blue}{s}\right)\right)\right) \]
    7. *-lowering-*.f3229.8%

      \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(u, \color{blue}{s}\right)\right)\right) \]
  14. Applied egg-rr29.8%

    \[\leadsto \color{blue}{\frac{1}{\frac{0.25}{u \cdot s}}} \]
  15. Final simplification29.8%

    \[\leadsto \frac{1}{\frac{0.25}{s \cdot u}} \]
  16. Add Preprocessing

Alternative 10: 29.5% accurate, 16.1× speedup?

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

\\
\frac{s}{-0.75} \cdot \left(u \cdot -3\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

      \[\leadsto \frac{u}{\frac{-3}{4}} \cdot \color{blue}{\left(s \cdot -3\right)} \]
    6. clear-numN/A

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

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

      \[\leadsto \frac{s \cdot -3}{\frac{\color{blue}{\frac{-3}{4}}}{u}} \]
    9. div-invN/A

      \[\leadsto \frac{s \cdot -3}{\frac{-3}{4} \cdot \color{blue}{\frac{1}{u}}} \]
    10. times-fracN/A

      \[\leadsto \frac{s}{\frac{-3}{4}} \cdot \color{blue}{\frac{-3}{\frac{1}{u}}} \]
    11. un-div-invN/A

      \[\leadsto \frac{s}{\frac{-3}{4}} \cdot \left(-3 \cdot \color{blue}{\frac{1}{\frac{1}{u}}}\right) \]
    12. remove-double-divN/A

      \[\leadsto \frac{s}{\frac{-3}{4}} \cdot \left(-3 \cdot u\right) \]
    13. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\frac{s}{\frac{-3}{4}}\right), \color{blue}{\left(-3 \cdot u\right)}\right) \]
    14. /-lowering-/.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(s, \frac{-3}{4}\right), \left(u \cdot \color{blue}{-3}\right)\right) \]
    16. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(s, \frac{-3}{4}\right), \mathsf{*.f32}\left(u, \color{blue}{-3}\right)\right) \]
  14. Applied egg-rr29.7%

    \[\leadsto \color{blue}{\frac{s}{-0.75} \cdot \left(u \cdot -3\right)} \]
  15. Add Preprocessing

Alternative 11: 29.5% accurate, 16.1× speedup?

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

\\
u \cdot \left(1.3333333333333333 \cdot \left(s \cdot 3\right)\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot u}{\frac{-3}{4}} \]
    6. frac-2negN/A

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot \left(\mathsf{neg}\left(u\right)\right)}{\frac{3}{4}} \]
    9. neg-mul-1N/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\left(s \cdot -3\right) \cdot -1\right) \cdot \frac{4}{3}\right), \color{blue}{u}\right) \]
    17. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\left(s \cdot -3\right) \cdot -1\right), \frac{4}{3}\right), u\right) \]
    18. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(s \cdot \left(-3 \cdot -1\right)\right), \frac{4}{3}\right), u\right) \]
    19. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(s \cdot 3\right), \frac{4}{3}\right), u\right) \]
    20. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(s, 3\right), \frac{4}{3}\right), u\right) \]
  14. Applied egg-rr29.7%

    \[\leadsto \color{blue}{\left(\left(s \cdot 3\right) \cdot 1.3333333333333333\right) \cdot u} \]
  15. Final simplification29.7%

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

Alternative 12: 29.5% accurate, 16.1× speedup?

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

\\
1.3333333333333333 \cdot \left(u \cdot \left(s \cdot 3\right)\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot u}{\frac{-3}{4}} \]
    6. frac-2negN/A

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

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

      \[\leadsto \frac{\left(s \cdot -3\right) \cdot \left(\mathsf{neg}\left(u\right)\right)}{\frac{3}{4}} \]
    9. div-invN/A

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

      \[\leadsto \left(\left(s \cdot -3\right) \cdot \left(\mathsf{neg}\left(u\right)\right)\right) \cdot \frac{4}{3} \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(s \cdot -3\right) \cdot \left(\mathsf{neg}\left(u\right)\right)\right), \color{blue}{\frac{4}{3}}\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(\mathsf{neg}\left(u\right)\right) \cdot \left(s \cdot -3\right)\right), \frac{4}{3}\right) \]
    13. neg-mul-1N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(-1 \cdot u\right) \cdot \left(s \cdot -3\right)\right), \frac{4}{3}\right) \]
    14. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\left(\left(u \cdot -1\right) \cdot \left(s \cdot -3\right)\right), \frac{4}{3}\right) \]
    15. associate-*l*N/A

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

      \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\left(s \cdot -3\right) \cdot -1\right)\right), \frac{4}{3}\right) \]
    17. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(\left(s \cdot -3\right) \cdot -1\right)\right), \frac{4}{3}\right) \]
    18. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(s \cdot \left(-3 \cdot -1\right)\right)\right), \frac{4}{3}\right) \]
    19. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(s \cdot 3\right)\right), \frac{4}{3}\right) \]
    20. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(s, 3\right)\right), \frac{4}{3}\right) \]
  14. Applied egg-rr29.7%

    \[\leadsto \color{blue}{\left(u \cdot \left(s \cdot 3\right)\right) \cdot 1.3333333333333333} \]
  15. Final simplification29.7%

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

Alternative 13: 29.5% accurate, 16.1× speedup?

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

\\
\left(s \cdot -3\right) \cdot \left(u \cdot -1.3333333333333333\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \frac{-4}{3}\right), \mathsf{*.f32}\left(\color{blue}{s}, -3\right)\right) \]
    2. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-4}{3}\right), \mathsf{*.f32}\left(\color{blue}{s}, -3\right)\right) \]
  12. Simplified29.7%

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

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

Alternative 14: 29.5% accurate, 16.1× speedup?

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

\\
\left(u \cdot -3\right) \cdot \left(s \cdot -1.3333333333333333\right)
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. metadata-evalN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(u \cdot -3\right), \left(\color{blue}{s} \cdot \frac{-4}{3}\right)\right) \]
    11. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, -3\right), \left(\color{blue}{s} \cdot \frac{-4}{3}\right)\right) \]
    12. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, -3\right), \mathsf{*.f32}\left(s, \color{blue}{\frac{-4}{3}}\right)\right) \]
  14. Applied egg-rr29.7%

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

Alternative 15: 29.5% accurate, 22.6× speedup?

\[\begin{array}{l} \\ \frac{s}{\frac{0.25}{u}} \end{array} \]
(FPCore (s u) :precision binary32 (/ s (/ 0.25 u)))
float code(float s, float u) {
	return s / (0.25f / u);
}
real(4) function code(s, u)
    real(4), intent (in) :: s
    real(4), intent (in) :: u
    code = s / (0.25e0 / u)
end function
function code(s, u)
	return Float32(s / Float32(Float32(0.25) / u))
end
function tmp = code(s, u)
	tmp = s / (single(0.25) / u);
end
\begin{array}{l}

\\
\frac{s}{\frac{0.25}{u}}
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

    \[\leadsto \color{blue}{\left(s \cdot u\right) \cdot 4} \]
  13. Step-by-step derivation
    1. associate-*l*N/A

      \[\leadsto s \cdot \color{blue}{\left(u \cdot 4\right)} \]
    2. metadata-evalN/A

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

      \[\leadsto s \cdot \frac{u}{\color{blue}{\frac{1}{4}}} \]
    4. clear-numN/A

      \[\leadsto s \cdot \frac{1}{\color{blue}{\frac{\frac{1}{4}}{u}}} \]
    5. un-div-invN/A

      \[\leadsto \frac{s}{\color{blue}{\frac{\frac{1}{4}}{u}}} \]
    6. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(s, \color{blue}{\left(\frac{\frac{1}{4}}{u}\right)}\right) \]
    7. /-lowering-/.f3229.7%

      \[\leadsto \mathsf{/.f32}\left(s, \mathsf{/.f32}\left(\frac{1}{4}, \color{blue}{u}\right)\right) \]
  14. Applied egg-rr29.7%

    \[\leadsto \color{blue}{\frac{s}{\frac{0.25}{u}}} \]
  15. Add Preprocessing

Alternative 16: 29.5% accurate, 22.6× speedup?

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

\\
\left(s \cdot u\right) \cdot 4
\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. Step-by-step derivation
    1. log-recN/A

      \[\leadsto \left(3 \cdot s\right) \cdot \left(\mathsf{neg}\left(\log \left(1 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right) \]
    2. neg-mul-1N/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{log1p}\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    8. log1p-lowering-log1p.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\mathsf{neg}\left(\frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\color{blue}{\left(3 \cdot s\right)} \cdot -1\right)\right) \]
    9. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \frac{u - \frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    10. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(0 - \left(\frac{u}{\frac{3}{4}} - \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    11. associate--r-N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(0 - \frac{u}{\frac{3}{4}}\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    12. neg-sub0N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right) + \frac{\frac{1}{4}}{\frac{3}{4}}\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    13. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\frac{1}{4}}{\frac{3}{4}} + \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(\color{blue}{3} \cdot s\right) \cdot -1\right)\right) \]
    14. +-lowering-+.f32N/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\mathsf{neg}\left(\frac{u}{\frac{3}{4}}\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    16. distribute-neg-frac2N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \left(\frac{u}{\mathsf{neg}\left(\frac{3}{4}\right)}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    17. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \left(\mathsf{neg}\left(\frac{3}{4}\right)\right)\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    18. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(3 \cdot s\right) \cdot -1\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(\left(s \cdot 3\right) \cdot -1\right)\right) \]
    20. associate-*l*N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \left(s \cdot \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    21. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, \color{blue}{\left(3 \cdot -1\right)}\right)\right) \]
    22. metadata-eval96.5%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{+.f32}\left(\frac{1}{3}, \mathsf{/.f32}\left(u, \frac{-3}{4}\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  3. Simplified96.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(0.3333333333333333 + \frac{u}{-0.75}\right) \cdot \left(s \cdot -3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \frac{1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{-1}{3}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u}{\frac{-3}{4}} - \frac{\frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    7. div-subN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{u - \frac{1}{4}}{\frac{-3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    8. frac-2negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\mathsf{neg}\left(\frac{-3}{4}\right)}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\left(\frac{\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)}{\frac{3}{4}}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    10. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u - \frac{1}{4}\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    11. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(u + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    12. +-commutativeN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) + u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    13. distribute-neg-inN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} + \left(\mathsf{neg}\left(u\right)\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    16. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{4} - u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    17. --lowering--.f3298.2%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{\_.f32}\left(\frac{1}{4}, u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  6. Applied egg-rr98.2%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\frac{0.25 - u}{0.75}}\right) \cdot \left(s \cdot -3\right) \]
  7. Taylor expanded in u around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left(-1 \cdot u\right)}, \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  8. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\left(\mathsf{neg}\left(u\right)\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
    2. neg-lowering-neg.f3219.3%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{log1p.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(u\right), \frac{3}{4}\right)\right), \mathsf{*.f32}\left(s, -3\right)\right) \]
  9. Simplified19.3%

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\left(s \cdot u\right), \color{blue}{4}\right) \]
    3. *-lowering-*.f3229.7%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(s, u\right), 4\right) \]
  12. Simplified29.7%

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

Reproduce

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