Beckmann Distribution sample, tan2theta, alphax == alphay

Percentage Accurate: 55.5% → 96.6%
Time: 7.8s
Alternatives: 11
Speedup: 10.5×

Specification

?
\[\left(0.0001 \leq \alpha \land \alpha \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\]
\[\begin{array}{l} \\ \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* (* (- alpha) alpha) (log (- 1.0 u0))))
float code(float alpha, float u0) {
	return (-alpha * alpha) * logf((1.0f - u0));
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    code = (-alpha * alpha) * log((1.0e0 - u0))
end function
function code(alpha, u0)
	return Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)))
end
function tmp = code(alpha, u0)
	tmp = (-alpha * alpha) * log((single(1.0) - u0));
end
\begin{array}{l}

\\
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\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 11 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: 55.5% accurate, 1.0× speedup?

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

\\
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
\end{array}

Alternative 1: 96.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\log \left(1 - u0\right) \cdot \left(\left(\frac{-1}{\left(\left({\alpha}^{-2} \cdot \alpha\right) \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right)\\ \end{array} \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (let* ((t_0 (* (* alpha alpha) u0)))
   (if (<= u0 0.002739999908953905)
     (+ (* (* 0.5 u0) t_0) t_0)
     (*
      (log (- 1.0 u0))
      (*
       (*
        (/
         -1.0
         (* (* (* (pow alpha -2.0) alpha) (pow alpha 1.5)) (pow alpha 1.5)))
        (pow alpha 3.0))
       alpha)))))
float code(float alpha, float u0) {
	float t_0 = (alpha * alpha) * u0;
	float tmp;
	if (u0 <= 0.002739999908953905f) {
		tmp = ((0.5f * u0) * t_0) + t_0;
	} else {
		tmp = logf((1.0f - u0)) * (((-1.0f / (((powf(alpha, -2.0f) * alpha) * powf(alpha, 1.5f)) * powf(alpha, 1.5f))) * powf(alpha, 3.0f)) * alpha);
	}
	return tmp;
}
real(4) function code(alpha, u0)
    real(4), intent (in) :: alpha
    real(4), intent (in) :: u0
    real(4) :: t_0
    real(4) :: tmp
    t_0 = (alpha * alpha) * u0
    if (u0 <= 0.002739999908953905e0) then
        tmp = ((0.5e0 * u0) * t_0) + t_0
    else
        tmp = log((1.0e0 - u0)) * ((((-1.0e0) / ((((alpha ** (-2.0e0)) * alpha) * (alpha ** 1.5e0)) * (alpha ** 1.5e0))) * (alpha ** 3.0e0)) * alpha)
    end if
    code = tmp
end function
function code(alpha, u0)
	t_0 = Float32(Float32(alpha * alpha) * u0)
	tmp = Float32(0.0)
	if (u0 <= Float32(0.002739999908953905))
		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
	else
		tmp = Float32(log(Float32(Float32(1.0) - u0)) * Float32(Float32(Float32(Float32(-1.0) / Float32(Float32(Float32((alpha ^ Float32(-2.0)) * alpha) * (alpha ^ Float32(1.5))) * (alpha ^ Float32(1.5)))) * (alpha ^ Float32(3.0))) * alpha));
	end
	return tmp
end
function tmp_2 = code(alpha, u0)
	t_0 = (alpha * alpha) * u0;
	tmp = single(0.0);
	if (u0 <= single(0.002739999908953905))
		tmp = ((single(0.5) * u0) * t_0) + t_0;
	else
		tmp = log((single(1.0) - u0)) * (((single(-1.0) / ((((alpha ^ single(-2.0)) * alpha) * (alpha ^ single(1.5))) * (alpha ^ single(1.5)))) * (alpha ^ single(3.0))) * alpha);
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
\mathbf{if}\;u0 \leq 0.002739999908953905:\\
\;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\

\mathbf{else}:\\
\;\;\;\;\log \left(1 - u0\right) \cdot \left(\left(\frac{-1}{\left(\left({\alpha}^{-2} \cdot \alpha\right) \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u0 < 0.00273999991

    1. Initial program 43.5%

      \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-lft-identityN/A

        \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
      2. flip-+N/A

        \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
      3. neg-sub0N/A

        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
      4. lift-*.f32N/A

        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
      5. lift-neg.f32N/A

        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
      6. distribute-lft-neg-outN/A

        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
      7. remove-double-negN/A

        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
      8. lower-/.f32N/A

        \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
      9. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
      10. lower--.f32N/A

        \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
      11. lower-*.f32N/A

        \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
      12. lower-*.f3243.5

        \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
    4. Applied rewrites43.5%

      \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
    5. Taylor expanded in u0 around 0

      \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
    6. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
      2. *-commutativeN/A

        \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
      4. distribute-lft1-inN/A

        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
      5. lower-*.f32N/A

        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
      6. *-commutativeN/A

        \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
      7. lower-fma.f32N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
      9. lower-*.f32N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
      10. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
      11. lower-*.f3228.4

        \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
    7. Applied rewrites27.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites98.1%

        \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

      if 0.00273999991 < u0

      1. Initial program 91.9%

        \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-neg.f32N/A

          \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        2. neg-sub0N/A

          \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        3. flip3--N/A

          \[\leadsto \left(\color{blue}{\frac{{0}^{3} - {\alpha}^{3}}{0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        4. frac-2negN/A

          \[\leadsto \left(\color{blue}{\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        5. metadata-evalN/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\color{blue}{0} + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        6. +-lft-identityN/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        7. mul0-lftN/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\alpha \cdot \alpha + \color{blue}{0}\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        8. +-rgt-identityN/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        9. distribute-lft-neg-outN/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        10. lift-neg.f32N/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right)} \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        11. lift-*.f32N/A

          \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        12. div-invN/A

          \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        13. metadata-evalN/A

          \[\leadsto \left(\left(\left(\mathsf{neg}\left(\left(\color{blue}{0} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        14. sub0-negN/A

          \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left({\alpha}^{3}\right)\right)}\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        15. remove-double-negN/A

          \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        16. lower-*.f32N/A

          \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        17. lower-pow.f32N/A

          \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        18. lower-/.f3292.0

          \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
      4. Applied rewrites92.0%

        \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
      5. Applied rewrites92.3%

        \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{1}{\color{blue}{{\alpha}^{1.5} \cdot \left({\alpha}^{1.5} \cdot \left(\left(-{\alpha}^{-2}\right) \cdot \alpha\right)\right)}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
    9. Recombined 2 regimes into one program.
    10. Final simplification96.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\log \left(1 - u0\right) \cdot \left(\left(\frac{-1}{\left(\left({\alpha}^{-2} \cdot \alpha\right) \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 2: 96.6% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\left(\frac{1}{\alpha} \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \end{array} \]
    (FPCore (alpha u0)
     :precision binary32
     (let* ((t_0 (* (* alpha alpha) u0)))
       (if (<= u0 0.002739999908953905)
         (+ (* (* 0.5 u0) t_0) t_0)
         (*
          (*
           (*
            (/ -1.0 (* (* (/ 1.0 alpha) (pow alpha 1.5)) (pow alpha 1.5)))
            (pow alpha 3.0))
           alpha)
          (log (- 1.0 u0))))))
    float code(float alpha, float u0) {
    	float t_0 = (alpha * alpha) * u0;
    	float tmp;
    	if (u0 <= 0.002739999908953905f) {
    		tmp = ((0.5f * u0) * t_0) + t_0;
    	} else {
    		tmp = (((-1.0f / (((1.0f / alpha) * powf(alpha, 1.5f)) * powf(alpha, 1.5f))) * powf(alpha, 3.0f)) * alpha) * logf((1.0f - u0));
    	}
    	return tmp;
    }
    
    real(4) function code(alpha, u0)
        real(4), intent (in) :: alpha
        real(4), intent (in) :: u0
        real(4) :: t_0
        real(4) :: tmp
        t_0 = (alpha * alpha) * u0
        if (u0 <= 0.002739999908953905e0) then
            tmp = ((0.5e0 * u0) * t_0) + t_0
        else
            tmp = ((((-1.0e0) / (((1.0e0 / alpha) * (alpha ** 1.5e0)) * (alpha ** 1.5e0))) * (alpha ** 3.0e0)) * alpha) * log((1.0e0 - u0))
        end if
        code = tmp
    end function
    
    function code(alpha, u0)
    	t_0 = Float32(Float32(alpha * alpha) * u0)
    	tmp = Float32(0.0)
    	if (u0 <= Float32(0.002739999908953905))
    		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
    	else
    		tmp = Float32(Float32(Float32(Float32(Float32(-1.0) / Float32(Float32(Float32(Float32(1.0) / alpha) * (alpha ^ Float32(1.5))) * (alpha ^ Float32(1.5)))) * (alpha ^ Float32(3.0))) * alpha) * log(Float32(Float32(1.0) - u0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(alpha, u0)
    	t_0 = (alpha * alpha) * u0;
    	tmp = single(0.0);
    	if (u0 <= single(0.002739999908953905))
    		tmp = ((single(0.5) * u0) * t_0) + t_0;
    	else
    		tmp = (((single(-1.0) / (((single(1.0) / alpha) * (alpha ^ single(1.5))) * (alpha ^ single(1.5)))) * (alpha ^ single(3.0))) * alpha) * log((single(1.0) - u0));
    	end
    	tmp_2 = tmp;
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
    \mathbf{if}\;u0 \leq 0.002739999908953905:\\
    \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\frac{-1}{\left(\frac{1}{\alpha} \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if u0 < 0.00273999991

      1. Initial program 43.5%

        \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. +-lft-identityN/A

          \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
        2. flip-+N/A

          \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
        3. neg-sub0N/A

          \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
        4. lift-*.f32N/A

          \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
        5. lift-neg.f32N/A

          \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
        6. distribute-lft-neg-outN/A

          \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
        7. remove-double-negN/A

          \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
        8. lower-/.f32N/A

          \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
        9. metadata-evalN/A

          \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
        10. lower--.f32N/A

          \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
        11. lower-*.f32N/A

          \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
        12. lower-*.f3243.5

          \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
      4. Applied rewrites43.5%

        \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
      5. Taylor expanded in u0 around 0

        \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
      6. Step-by-step derivation
        1. distribute-lft-inN/A

          \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
        2. *-commutativeN/A

          \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
        3. associate-*r*N/A

          \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
        4. distribute-lft1-inN/A

          \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
        5. lower-*.f32N/A

          \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
        6. *-commutativeN/A

          \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
        7. lower-fma.f32N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
        9. lower-*.f32N/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
        10. unpow2N/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
        11. lower-*.f3228.4

          \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
      7. Applied rewrites27.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
      8. Step-by-step derivation
        1. Applied rewrites98.1%

          \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

        if 0.00273999991 < u0

        1. Initial program 91.9%

          \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-neg.f32N/A

            \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          2. neg-sub0N/A

            \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          3. flip3--N/A

            \[\leadsto \left(\color{blue}{\frac{{0}^{3} - {\alpha}^{3}}{0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          4. frac-2negN/A

            \[\leadsto \left(\color{blue}{\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          5. metadata-evalN/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\color{blue}{0} + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          6. +-lft-identityN/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          7. mul0-lftN/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\alpha \cdot \alpha + \color{blue}{0}\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          8. +-rgt-identityN/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          9. distribute-lft-neg-outN/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          10. lift-neg.f32N/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right)} \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          11. lift-*.f32N/A

            \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          12. div-invN/A

            \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          13. metadata-evalN/A

            \[\leadsto \left(\left(\left(\mathsf{neg}\left(\left(\color{blue}{0} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          14. sub0-negN/A

            \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left({\alpha}^{3}\right)\right)}\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          15. remove-double-negN/A

            \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          16. lower-*.f32N/A

            \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          17. lower-pow.f32N/A

            \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          18. lower-/.f3292.0

            \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        4. Applied rewrites92.0%

          \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        5. Applied rewrites91.9%

          \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{1}{\color{blue}{\frac{0 \cdot \left(\alpha \cdot \alpha\right) - \left(\alpha \cdot \alpha\right) \cdot \left({\alpha}^{3} \cdot \alpha\right)}{{\alpha}^{3} \cdot \alpha}}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        6. Applied rewrites92.2%

          \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{1}{\color{blue}{{\alpha}^{1.5} \cdot \left({\alpha}^{1.5} \cdot \left(-\frac{1}{\alpha}\right)\right)}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
      9. Recombined 2 regimes into one program.
      10. Final simplification96.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\left(\frac{1}{\alpha} \cdot {\alpha}^{1.5}\right) \cdot {\alpha}^{1.5}} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 3: 96.7% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\alpha}{{\alpha}^{3} \cdot \alpha} \cdot \alpha} \cdot \log \left(1 - u0\right)\\ \end{array} \end{array} \]
      (FPCore (alpha u0)
       :precision binary32
       (let* ((t_0 (* (* alpha alpha) u0)))
         (if (<= u0 0.002739999908953905)
           (+ (* (* 0.5 u0) t_0) t_0)
           (*
            (/ -1.0 (* (/ alpha (* (pow alpha 3.0) alpha)) alpha))
            (log (- 1.0 u0))))))
      float code(float alpha, float u0) {
      	float t_0 = (alpha * alpha) * u0;
      	float tmp;
      	if (u0 <= 0.002739999908953905f) {
      		tmp = ((0.5f * u0) * t_0) + t_0;
      	} else {
      		tmp = (-1.0f / ((alpha / (powf(alpha, 3.0f) * alpha)) * alpha)) * logf((1.0f - u0));
      	}
      	return tmp;
      }
      
      real(4) function code(alpha, u0)
          real(4), intent (in) :: alpha
          real(4), intent (in) :: u0
          real(4) :: t_0
          real(4) :: tmp
          t_0 = (alpha * alpha) * u0
          if (u0 <= 0.002739999908953905e0) then
              tmp = ((0.5e0 * u0) * t_0) + t_0
          else
              tmp = ((-1.0e0) / ((alpha / ((alpha ** 3.0e0) * alpha)) * alpha)) * log((1.0e0 - u0))
          end if
          code = tmp
      end function
      
      function code(alpha, u0)
      	t_0 = Float32(Float32(alpha * alpha) * u0)
      	tmp = Float32(0.0)
      	if (u0 <= Float32(0.002739999908953905))
      		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
      	else
      		tmp = Float32(Float32(Float32(-1.0) / Float32(Float32(alpha / Float32((alpha ^ Float32(3.0)) * alpha)) * alpha)) * log(Float32(Float32(1.0) - u0)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(alpha, u0)
      	t_0 = (alpha * alpha) * u0;
      	tmp = single(0.0);
      	if (u0 <= single(0.002739999908953905))
      		tmp = ((single(0.5) * u0) * t_0) + t_0;
      	else
      		tmp = (single(-1.0) / ((alpha / ((alpha ^ single(3.0)) * alpha)) * alpha)) * log((single(1.0) - u0));
      	end
      	tmp_2 = tmp;
      end
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
      \mathbf{if}\;u0 \leq 0.002739999908953905:\\
      \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-1}{\frac{\alpha}{{\alpha}^{3} \cdot \alpha} \cdot \alpha} \cdot \log \left(1 - u0\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if u0 < 0.00273999991

        1. Initial program 43.5%

          \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. +-lft-identityN/A

            \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
          2. flip-+N/A

            \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
          3. neg-sub0N/A

            \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
          4. lift-*.f32N/A

            \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
          5. lift-neg.f32N/A

            \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
          6. distribute-lft-neg-outN/A

            \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
          7. remove-double-negN/A

            \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
          8. lower-/.f32N/A

            \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
          9. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
          10. lower--.f32N/A

            \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
          11. lower-*.f32N/A

            \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
          12. lower-*.f3243.5

            \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
        4. Applied rewrites43.5%

          \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
        5. Taylor expanded in u0 around 0

          \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
        6. Step-by-step derivation
          1. distribute-lft-inN/A

            \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
          2. *-commutativeN/A

            \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
          3. associate-*r*N/A

            \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
          4. distribute-lft1-inN/A

            \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
          5. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
          6. *-commutativeN/A

            \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
          7. lower-fma.f32N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
          9. lower-*.f32N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
          10. unpow2N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
          11. lower-*.f3228.4

            \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
        7. Applied rewrites27.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
        8. Step-by-step derivation
          1. Applied rewrites98.1%

            \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

          if 0.00273999991 < u0

          1. Initial program 91.9%

            \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f32N/A

              \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
            2. lift-neg.f32N/A

              \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            3. neg-sub0N/A

              \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            4. flip--N/A

              \[\leadsto \left(\color{blue}{\frac{0 \cdot 0 - \alpha \cdot \alpha}{0 + \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            5. metadata-evalN/A

              \[\leadsto \left(\frac{\color{blue}{0} - \alpha \cdot \alpha}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            6. neg-sub0N/A

              \[\leadsto \left(\frac{\color{blue}{\mathsf{neg}\left(\alpha \cdot \alpha\right)}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            7. distribute-lft-neg-outN/A

              \[\leadsto \left(\frac{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            8. lift-neg.f32N/A

              \[\leadsto \left(\frac{\color{blue}{\left(-\alpha\right)} \cdot \alpha}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            9. lift-*.f32N/A

              \[\leadsto \left(\frac{\color{blue}{\left(-\alpha\right) \cdot \alpha}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            10. +-lft-identityN/A

              \[\leadsto \left(\frac{\left(-\alpha\right) \cdot \alpha}{\color{blue}{\alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            11. associate-*l/N/A

              \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
            12. lower-/.f32N/A

              \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
            13. lower-*.f3291.9

              \[\leadsto \frac{\color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}}{\alpha} \cdot \log \left(1 - u0\right) \]
          4. Applied rewrites91.9%

            \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
          5. Step-by-step derivation
            1. lift-/.f32N/A

              \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
            2. clear-numN/A

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

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\alpha}{\alpha}}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            6. *-inversesN/A

              \[\leadsto \frac{1}{\frac{\color{blue}{1}}{\left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            7. lift-/.f32N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            8. lower-/.f3291.8

              \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            9. lift-/.f32N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            10. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            11. lift-neg.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            12. distribute-lft-neg-outN/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{neg}\left(\alpha \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            13. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)}} \cdot \log \left(1 - u0\right) \]
            14. distribute-frac-neg2N/A

              \[\leadsto \frac{1}{\color{blue}{\mathsf{neg}\left(\frac{1}{\alpha \cdot \alpha}\right)}} \cdot \log \left(1 - u0\right) \]
            15. lower-neg.f32N/A

              \[\leadsto \frac{1}{\color{blue}{-\frac{1}{\alpha \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            16. lift-*.f32N/A

              \[\leadsto \frac{1}{-\frac{1}{\color{blue}{\alpha \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            17. pow2N/A

              \[\leadsto \frac{1}{-\frac{1}{\color{blue}{{\alpha}^{2}}}} \cdot \log \left(1 - u0\right) \]
            18. pow-flipN/A

              \[\leadsto \frac{1}{-\color{blue}{{\alpha}^{\left(\mathsf{neg}\left(2\right)\right)}}} \cdot \log \left(1 - u0\right) \]
            19. lower-pow.f32N/A

              \[\leadsto \frac{1}{-\color{blue}{{\alpha}^{\left(\mathsf{neg}\left(2\right)\right)}}} \cdot \log \left(1 - u0\right) \]
            20. metadata-eval91.9

              \[\leadsto \frac{1}{-{\alpha}^{\color{blue}{-2}}} \cdot \log \left(1 - u0\right) \]
          6. Applied rewrites91.9%

            \[\leadsto \color{blue}{\frac{1}{-{\alpha}^{-2}}} \cdot \log \left(1 - u0\right) \]
          7. Step-by-step derivation
            1. lift-neg.f32N/A

              \[\leadsto \frac{1}{\color{blue}{\mathsf{neg}\left({\alpha}^{-2}\right)}} \cdot \log \left(1 - u0\right) \]
            2. lift-pow.f32N/A

              \[\leadsto \frac{1}{\mathsf{neg}\left(\color{blue}{{\alpha}^{-2}}\right)} \cdot \log \left(1 - u0\right) \]
            3. metadata-evalN/A

              \[\leadsto \frac{1}{\mathsf{neg}\left({\alpha}^{\color{blue}{\left(\mathsf{neg}\left(2\right)\right)}}\right)} \cdot \log \left(1 - u0\right) \]
            4. pow-flipN/A

              \[\leadsto \frac{1}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\alpha}^{2}}}\right)} \cdot \log \left(1 - u0\right) \]
            5. pow2N/A

              \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{1}{\color{blue}{\alpha \cdot \alpha}}\right)} \cdot \log \left(1 - u0\right) \]
            6. lift-*.f32N/A

              \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{1}{\color{blue}{\alpha \cdot \alpha}}\right)} \cdot \log \left(1 - u0\right) \]
            7. distribute-frac-neg2N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{neg}\left(\alpha \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            8. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)}} \cdot \log \left(1 - u0\right) \]
            9. distribute-lft-neg-outN/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            10. lift-neg.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-\alpha\right)} \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            11. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-\alpha\right) \cdot \alpha}}} \cdot \log \left(1 - u0\right) \]
            12. *-inversesN/A

              \[\leadsto \frac{1}{\frac{\color{blue}{\frac{\alpha \cdot \alpha}{\alpha \cdot \alpha}}}{\left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            13. associate-/r*N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{\alpha \cdot \alpha}{\left(\alpha \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            14. remove-double-negN/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)\right)\right)} \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            15. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)\right)\right)\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            16. distribute-lft-neg-outN/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}\right)\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            17. lift-neg.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\left(\mathsf{neg}\left(\color{blue}{\left(-\alpha\right)} \cdot \alpha\right)\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            18. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\left(\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            19. +-lft-identityN/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\color{blue}{0 + \left(\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            20. cancel-sign-sub-invN/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            21. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            22. lift-neg.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{0 - \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            23. lift-*.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{0 - \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)}}} \cdot \log \left(1 - u0\right) \]
            24. lift-neg.f32N/A

              \[\leadsto \frac{1}{\frac{\alpha \cdot \alpha}{0 - \left(\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
          8. Applied rewrites92.1%

            \[\leadsto \frac{1}{\color{blue}{\alpha \cdot \frac{\alpha}{{\alpha}^{3} \cdot \left(-\alpha\right)}}} \cdot \log \left(1 - u0\right) \]
        9. Recombined 2 regimes into one program.
        10. Final simplification96.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\alpha}{{\alpha}^{3} \cdot \alpha} \cdot \alpha} \cdot \log \left(1 - u0\right)\\ \end{array} \]
        11. Add Preprocessing

        Alternative 4: 96.7% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\alpha \cdot \alpha} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \end{array} \]
        (FPCore (alpha u0)
         :precision binary32
         (let* ((t_0 (* (* alpha alpha) u0)))
           (if (<= u0 0.002739999908953905)
             (+ (* (* 0.5 u0) t_0) t_0)
             (*
              (* (* (/ -1.0 (* alpha alpha)) (pow alpha 3.0)) alpha)
              (log (- 1.0 u0))))))
        float code(float alpha, float u0) {
        	float t_0 = (alpha * alpha) * u0;
        	float tmp;
        	if (u0 <= 0.002739999908953905f) {
        		tmp = ((0.5f * u0) * t_0) + t_0;
        	} else {
        		tmp = (((-1.0f / (alpha * alpha)) * powf(alpha, 3.0f)) * alpha) * logf((1.0f - u0));
        	}
        	return tmp;
        }
        
        real(4) function code(alpha, u0)
            real(4), intent (in) :: alpha
            real(4), intent (in) :: u0
            real(4) :: t_0
            real(4) :: tmp
            t_0 = (alpha * alpha) * u0
            if (u0 <= 0.002739999908953905e0) then
                tmp = ((0.5e0 * u0) * t_0) + t_0
            else
                tmp = ((((-1.0e0) / (alpha * alpha)) * (alpha ** 3.0e0)) * alpha) * log((1.0e0 - u0))
            end if
            code = tmp
        end function
        
        function code(alpha, u0)
        	t_0 = Float32(Float32(alpha * alpha) * u0)
        	tmp = Float32(0.0)
        	if (u0 <= Float32(0.002739999908953905))
        		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
        	else
        		tmp = Float32(Float32(Float32(Float32(Float32(-1.0) / Float32(alpha * alpha)) * (alpha ^ Float32(3.0))) * alpha) * log(Float32(Float32(1.0) - u0)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(alpha, u0)
        	t_0 = (alpha * alpha) * u0;
        	tmp = single(0.0);
        	if (u0 <= single(0.002739999908953905))
        		tmp = ((single(0.5) * u0) * t_0) + t_0;
        	else
        		tmp = (((single(-1.0) / (alpha * alpha)) * (alpha ^ single(3.0))) * alpha) * log((single(1.0) - u0));
        	end
        	tmp_2 = tmp;
        end
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
        \mathbf{if}\;u0 \leq 0.002739999908953905:\\
        \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(\frac{-1}{\alpha \cdot \alpha} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if u0 < 0.00273999991

          1. Initial program 43.5%

            \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. +-lft-identityN/A

              \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
            2. flip-+N/A

              \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            3. neg-sub0N/A

              \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
            4. lift-*.f32N/A

              \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
            5. lift-neg.f32N/A

              \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
            6. distribute-lft-neg-outN/A

              \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
            7. remove-double-negN/A

              \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            8. lower-/.f32N/A

              \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            9. metadata-evalN/A

              \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
            10. lower--.f32N/A

              \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
            11. lower-*.f32N/A

              \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
            12. lower-*.f3243.5

              \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
          4. Applied rewrites43.5%

            \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
          5. Taylor expanded in u0 around 0

            \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
          6. Step-by-step derivation
            1. distribute-lft-inN/A

              \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
            2. *-commutativeN/A

              \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
            3. associate-*r*N/A

              \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
            4. distribute-lft1-inN/A

              \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
            5. lower-*.f32N/A

              \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
            6. *-commutativeN/A

              \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
            7. lower-fma.f32N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
            8. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
            9. lower-*.f32N/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
            10. unpow2N/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
            11. lower-*.f3228.4

              \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
          7. Applied rewrites27.9%

            \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
          8. Step-by-step derivation
            1. Applied rewrites98.1%

              \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

            if 0.00273999991 < u0

            1. Initial program 91.9%

              \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-neg.f32N/A

                \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              2. neg-sub0N/A

                \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              3. flip3--N/A

                \[\leadsto \left(\color{blue}{\frac{{0}^{3} - {\alpha}^{3}}{0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              4. frac-2negN/A

                \[\leadsto \left(\color{blue}{\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              5. metadata-evalN/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\color{blue}{0} + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              6. +-lft-identityN/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              7. mul0-lftN/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\alpha \cdot \alpha + \color{blue}{0}\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              8. +-rgt-identityN/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              9. distribute-lft-neg-outN/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              10. lift-neg.f32N/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right)} \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              11. lift-*.f32N/A

                \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              12. div-invN/A

                \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              13. metadata-evalN/A

                \[\leadsto \left(\left(\left(\mathsf{neg}\left(\left(\color{blue}{0} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              14. sub0-negN/A

                \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left({\alpha}^{3}\right)\right)}\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              15. remove-double-negN/A

                \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              16. lower-*.f32N/A

                \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              17. lower-pow.f32N/A

                \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              18. lower-/.f3292.0

                \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            4. Applied rewrites92.0%

              \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            5. Step-by-step derivation
              1. lift-/.f32N/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              2. frac-2negN/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              3. metadata-evalN/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              4. lift-*.f32N/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              5. lift-neg.f32N/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              6. distribute-lft-neg-outN/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              7. lift-*.f32N/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{-1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)\right)\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              8. remove-double-negN/A

                \[\leadsto \left(\left({\alpha}^{3} \cdot \frac{-1}{\color{blue}{\alpha \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              9. lower-/.f3292.0

                \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{-1}{\alpha \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            6. Applied rewrites92.0%

              \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{-1}{\alpha \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
          9. Recombined 2 regimes into one program.
          10. Final simplification96.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\alpha \cdot \alpha} \cdot {\alpha}^{3}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \]
          11. Add Preprocessing

          Alternative 5: 96.7% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{{\left(-\alpha\right)}^{3}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \end{array} \]
          (FPCore (alpha u0)
           :precision binary32
           (let* ((t_0 (* (* alpha alpha) u0)))
             (if (<= u0 0.002739999908953905)
               (+ (* (* 0.5 u0) t_0) t_0)
               (* (* (/ (pow (- alpha) 3.0) (* alpha alpha)) alpha) (log (- 1.0 u0))))))
          float code(float alpha, float u0) {
          	float t_0 = (alpha * alpha) * u0;
          	float tmp;
          	if (u0 <= 0.002739999908953905f) {
          		tmp = ((0.5f * u0) * t_0) + t_0;
          	} else {
          		tmp = ((powf(-alpha, 3.0f) / (alpha * alpha)) * alpha) * logf((1.0f - u0));
          	}
          	return tmp;
          }
          
          real(4) function code(alpha, u0)
              real(4), intent (in) :: alpha
              real(4), intent (in) :: u0
              real(4) :: t_0
              real(4) :: tmp
              t_0 = (alpha * alpha) * u0
              if (u0 <= 0.002739999908953905e0) then
                  tmp = ((0.5e0 * u0) * t_0) + t_0
              else
                  tmp = (((-alpha ** 3.0e0) / (alpha * alpha)) * alpha) * log((1.0e0 - u0))
              end if
              code = tmp
          end function
          
          function code(alpha, u0)
          	t_0 = Float32(Float32(alpha * alpha) * u0)
          	tmp = Float32(0.0)
          	if (u0 <= Float32(0.002739999908953905))
          		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
          	else
          		tmp = Float32(Float32(Float32((Float32(-alpha) ^ Float32(3.0)) / Float32(alpha * alpha)) * alpha) * log(Float32(Float32(1.0) - u0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(alpha, u0)
          	t_0 = (alpha * alpha) * u0;
          	tmp = single(0.0);
          	if (u0 <= single(0.002739999908953905))
          		tmp = ((single(0.5) * u0) * t_0) + t_0;
          	else
          		tmp = (((-alpha ^ single(3.0)) / (alpha * alpha)) * alpha) * log((single(1.0) - u0));
          	end
          	tmp_2 = tmp;
          end
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
          \mathbf{if}\;u0 \leq 0.002739999908953905:\\
          \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\frac{{\left(-\alpha\right)}^{3}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if u0 < 0.00273999991

            1. Initial program 43.5%

              \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. +-lft-identityN/A

                \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
              2. flip-+N/A

                \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
              3. neg-sub0N/A

                \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
              4. lift-*.f32N/A

                \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
              5. lift-neg.f32N/A

                \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
              6. distribute-lft-neg-outN/A

                \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
              7. remove-double-negN/A

                \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
              8. lower-/.f32N/A

                \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
              9. metadata-evalN/A

                \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
              10. lower--.f32N/A

                \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
              11. lower-*.f32N/A

                \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
              12. lower-*.f3243.5

                \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            4. Applied rewrites43.5%

              \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
            5. Taylor expanded in u0 around 0

              \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
            6. Step-by-step derivation
              1. distribute-lft-inN/A

                \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
              2. *-commutativeN/A

                \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
              3. associate-*r*N/A

                \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
              4. distribute-lft1-inN/A

                \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
              5. lower-*.f32N/A

                \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
              6. *-commutativeN/A

                \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
              7. lower-fma.f32N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
              9. lower-*.f32N/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
              10. unpow2N/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
              11. lower-*.f3228.4

                \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
            7. Applied rewrites27.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
            8. Step-by-step derivation
              1. Applied rewrites98.1%

                \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

              if 0.00273999991 < u0

              1. Initial program 91.9%

                \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-neg.f32N/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                2. neg-sub0N/A

                  \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                3. flip3--N/A

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

                  \[\leadsto \left(\frac{{0}^{3} - {\alpha}^{3}}{\color{blue}{0} + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                5. +-lft-identityN/A

                  \[\leadsto \left(\frac{{0}^{3} - {\alpha}^{3}}{\color{blue}{\alpha \cdot \alpha + 0 \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                6. mul0-lftN/A

                  \[\leadsto \left(\frac{{0}^{3} - {\alpha}^{3}}{\alpha \cdot \alpha + \color{blue}{0}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                7. +-rgt-identityN/A

                  \[\leadsto \left(\frac{{0}^{3} - {\alpha}^{3}}{\color{blue}{\alpha \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                8. lower-/.f32N/A

                  \[\leadsto \left(\color{blue}{\frac{{0}^{3} - {\alpha}^{3}}{\alpha \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                9. metadata-evalN/A

                  \[\leadsto \left(\frac{\color{blue}{0} - {\alpha}^{3}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                10. sub0-negN/A

                  \[\leadsto \left(\frac{\color{blue}{\mathsf{neg}\left({\alpha}^{3}\right)}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                11. cube-negN/A

                  \[\leadsto \left(\frac{\color{blue}{{\left(\mathsf{neg}\left(\alpha\right)\right)}^{3}}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                12. lift-neg.f32N/A

                  \[\leadsto \left(\frac{{\color{blue}{\left(-\alpha\right)}}^{3}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                13. lower-pow.f32N/A

                  \[\leadsto \left(\frac{\color{blue}{{\left(-\alpha\right)}^{3}}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                14. lower-*.f3291.9

                  \[\leadsto \left(\frac{{\left(-\alpha\right)}^{3}}{\color{blue}{\alpha \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              4. Applied rewrites91.9%

                \[\leadsto \left(\color{blue}{\frac{{\left(-\alpha\right)}^{3}}{\alpha \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
            9. Recombined 2 regimes into one program.
            10. Final simplification96.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{{\left(-\alpha\right)}^{3}}{\alpha \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \]
            11. Add Preprocessing

            Alternative 6: 96.7% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\alpha} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \end{array} \]
            (FPCore (alpha u0)
             :precision binary32
             (let* ((t_0 (* (* alpha alpha) u0)))
               (if (<= u0 0.002739999908953905)
                 (+ (* (* 0.5 u0) t_0) t_0)
                 (* (* (* (/ -1.0 alpha) (* alpha alpha)) alpha) (log (- 1.0 u0))))))
            float code(float alpha, float u0) {
            	float t_0 = (alpha * alpha) * u0;
            	float tmp;
            	if (u0 <= 0.002739999908953905f) {
            		tmp = ((0.5f * u0) * t_0) + t_0;
            	} else {
            		tmp = (((-1.0f / alpha) * (alpha * alpha)) * alpha) * logf((1.0f - u0));
            	}
            	return tmp;
            }
            
            real(4) function code(alpha, u0)
                real(4), intent (in) :: alpha
                real(4), intent (in) :: u0
                real(4) :: t_0
                real(4) :: tmp
                t_0 = (alpha * alpha) * u0
                if (u0 <= 0.002739999908953905e0) then
                    tmp = ((0.5e0 * u0) * t_0) + t_0
                else
                    tmp = ((((-1.0e0) / alpha) * (alpha * alpha)) * alpha) * log((1.0e0 - u0))
                end if
                code = tmp
            end function
            
            function code(alpha, u0)
            	t_0 = Float32(Float32(alpha * alpha) * u0)
            	tmp = Float32(0.0)
            	if (u0 <= Float32(0.002739999908953905))
            		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
            	else
            		tmp = Float32(Float32(Float32(Float32(Float32(-1.0) / alpha) * Float32(alpha * alpha)) * alpha) * log(Float32(Float32(1.0) - u0)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(alpha, u0)
            	t_0 = (alpha * alpha) * u0;
            	tmp = single(0.0);
            	if (u0 <= single(0.002739999908953905))
            		tmp = ((single(0.5) * u0) * t_0) + t_0;
            	else
            		tmp = (((single(-1.0) / alpha) * (alpha * alpha)) * alpha) * log((single(1.0) - u0));
            	end
            	tmp_2 = tmp;
            end
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
            \mathbf{if}\;u0 \leq 0.002739999908953905:\\
            \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\left(\frac{-1}{\alpha} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if u0 < 0.00273999991

              1. Initial program 43.5%

                \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. +-lft-identityN/A

                  \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                2. flip-+N/A

                  \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                3. neg-sub0N/A

                  \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
                4. lift-*.f32N/A

                  \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
                5. lift-neg.f32N/A

                  \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                6. distribute-lft-neg-outN/A

                  \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
                7. remove-double-negN/A

                  \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                8. lower-/.f32N/A

                  \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                9. metadata-evalN/A

                  \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                10. lower--.f32N/A

                  \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                11. lower-*.f32N/A

                  \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                12. lower-*.f3243.5

                  \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
              4. Applied rewrites43.5%

                \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
              5. Taylor expanded in u0 around 0

                \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
              6. Step-by-step derivation
                1. distribute-lft-inN/A

                  \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
                2. *-commutativeN/A

                  \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
                3. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
                4. distribute-lft1-inN/A

                  \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                5. lower-*.f32N/A

                  \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                6. *-commutativeN/A

                  \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
                7. lower-fma.f32N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                9. lower-*.f32N/A

                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                10. unpow2N/A

                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                11. lower-*.f3228.4

                  \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
              7. Applied rewrites27.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
              8. Step-by-step derivation
                1. Applied rewrites98.1%

                  \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]

                if 0.00273999991 < u0

                1. Initial program 91.9%

                  \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-neg.f32N/A

                    \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  2. neg-sub0N/A

                    \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  3. flip3--N/A

                    \[\leadsto \left(\color{blue}{\frac{{0}^{3} - {\alpha}^{3}}{0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  4. frac-2negN/A

                    \[\leadsto \left(\color{blue}{\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(0 \cdot 0 + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\color{blue}{0} + \left(\alpha \cdot \alpha + 0 \cdot \alpha\right)\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  6. +-lft-identityN/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(\alpha \cdot \alpha + 0 \cdot \alpha\right)}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  7. mul0-lftN/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\left(\alpha \cdot \alpha + \color{blue}{0}\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  8. +-rgt-identityN/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  9. distribute-lft-neg-outN/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  10. lift-neg.f32N/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right)} \cdot \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  11. lift-*.f32N/A

                    \[\leadsto \left(\frac{\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)}{\color{blue}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  12. div-invN/A

                    \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left({0}^{3} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  13. metadata-evalN/A

                    \[\leadsto \left(\left(\left(\mathsf{neg}\left(\left(\color{blue}{0} - {\alpha}^{3}\right)\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  14. sub0-negN/A

                    \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left({\alpha}^{3}\right)\right)}\right)\right) \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  15. remove-double-negN/A

                    \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  16. lower-*.f32N/A

                    \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  17. lower-pow.f32N/A

                    \[\leadsto \left(\left(\color{blue}{{\alpha}^{3}} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  18. lower-/.f3292.0

                    \[\leadsto \left(\left({\alpha}^{3} \cdot \color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                4. Applied rewrites92.0%

                  \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                5. Step-by-step derivation
                  1. lift-*.f32N/A

                    \[\leadsto \left(\color{blue}{\left({\alpha}^{3} \cdot \frac{1}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\color{blue}{\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot {\alpha}^{3}\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  3. lift-pow.f32N/A

                    \[\leadsto \left(\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \color{blue}{{\alpha}^{3}}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  4. cube-multN/A

                    \[\leadsto \left(\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \color{blue}{\left(\alpha \cdot \left(\alpha \cdot \alpha\right)\right)}\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  5. lift-*.f32N/A

                    \[\leadsto \left(\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \left(\alpha \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \left(\color{blue}{\left(\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  7. lower-*.f32N/A

                    \[\leadsto \left(\color{blue}{\left(\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  8. lower-*.f3291.9

                    \[\leadsto \left(\left(\color{blue}{\left(\frac{1}{\left(-\alpha\right) \cdot \alpha} \cdot \alpha\right)} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  9. lift-/.f32N/A

                    \[\leadsto \left(\left(\left(\color{blue}{\frac{1}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  10. lift-*.f32N/A

                    \[\leadsto \left(\left(\left(\frac{1}{\color{blue}{\left(-\alpha\right) \cdot \alpha}} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  11. lift-neg.f32N/A

                    \[\leadsto \left(\left(\left(\frac{1}{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  12. distribute-lft-neg-outN/A

                    \[\leadsto \left(\left(\left(\frac{1}{\color{blue}{\mathsf{neg}\left(\alpha \cdot \alpha\right)}} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  13. lift-*.f32N/A

                    \[\leadsto \left(\left(\left(\frac{1}{\mathsf{neg}\left(\color{blue}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  14. distribute-frac-neg2N/A

                    \[\leadsto \left(\left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{\alpha \cdot \alpha}\right)\right)} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  15. lower-neg.f32N/A

                    \[\leadsto \left(\left(\left(\color{blue}{\left(-\frac{1}{\alpha \cdot \alpha}\right)} \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  16. lift-*.f32N/A

                    \[\leadsto \left(\left(\left(\left(-\frac{1}{\color{blue}{\alpha \cdot \alpha}}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  17. pow2N/A

                    \[\leadsto \left(\left(\left(\left(-\frac{1}{\color{blue}{{\alpha}^{2}}}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  18. pow-flipN/A

                    \[\leadsto \left(\left(\left(\left(-\color{blue}{{\alpha}^{\left(\mathsf{neg}\left(2\right)\right)}}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  19. lower-pow.f32N/A

                    \[\leadsto \left(\left(\left(\left(-\color{blue}{{\alpha}^{\left(\mathsf{neg}\left(2\right)\right)}}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  20. metadata-eval91.9

                    \[\leadsto \left(\left(\left(\left(-{\alpha}^{\color{blue}{-2}}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                6. Applied rewrites91.9%

                  \[\leadsto \left(\color{blue}{\left(\left(\left(-{\alpha}^{-2}\right) \cdot \alpha\right) \cdot \left(\alpha \cdot \alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                7. Taylor expanded in alpha around 0

                  \[\leadsto \left(\left(\color{blue}{\frac{-1}{\alpha}} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                8. Step-by-step derivation
                  1. lower-/.f3291.9

                    \[\leadsto \left(\left(\color{blue}{\frac{-1}{\alpha}} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                9. Applied rewrites91.9%

                  \[\leadsto \left(\left(\color{blue}{\frac{-1}{\alpha}} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
              9. Recombined 2 regimes into one program.
              10. Final simplification96.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;u0 \leq 0.002739999908953905:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{-1}{\alpha} \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \end{array} \]
              11. Add Preprocessing

              Alternative 7: 96.7% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\ \;\;\;\;\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha} \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \end{array} \end{array} \]
              (FPCore (alpha u0)
               :precision binary32
               (let* ((t_0 (* (* alpha alpha) u0)))
                 (if (<= (- 1.0 u0) 0.9972599744796753)
                   (* (/ (* (* (- alpha) alpha) alpha) alpha) (log (- 1.0 u0)))
                   (+ (* (* 0.5 u0) t_0) t_0))))
              float code(float alpha, float u0) {
              	float t_0 = (alpha * alpha) * u0;
              	float tmp;
              	if ((1.0f - u0) <= 0.9972599744796753f) {
              		tmp = (((-alpha * alpha) * alpha) / alpha) * logf((1.0f - u0));
              	} else {
              		tmp = ((0.5f * u0) * t_0) + t_0;
              	}
              	return tmp;
              }
              
              real(4) function code(alpha, u0)
                  real(4), intent (in) :: alpha
                  real(4), intent (in) :: u0
                  real(4) :: t_0
                  real(4) :: tmp
                  t_0 = (alpha * alpha) * u0
                  if ((1.0e0 - u0) <= 0.9972599744796753e0) then
                      tmp = (((-alpha * alpha) * alpha) / alpha) * log((1.0e0 - u0))
                  else
                      tmp = ((0.5e0 * u0) * t_0) + t_0
                  end if
                  code = tmp
              end function
              
              function code(alpha, u0)
              	t_0 = Float32(Float32(alpha * alpha) * u0)
              	tmp = Float32(0.0)
              	if (Float32(Float32(1.0) - u0) <= Float32(0.9972599744796753))
              		tmp = Float32(Float32(Float32(Float32(Float32(-alpha) * alpha) * alpha) / alpha) * log(Float32(Float32(1.0) - u0)));
              	else
              		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
              	end
              	return tmp
              end
              
              function tmp_2 = code(alpha, u0)
              	t_0 = (alpha * alpha) * u0;
              	tmp = single(0.0);
              	if ((single(1.0) - u0) <= single(0.9972599744796753))
              		tmp = (((-alpha * alpha) * alpha) / alpha) * log((single(1.0) - u0));
              	else
              		tmp = ((single(0.5) * u0) * t_0) + t_0;
              	end
              	tmp_2 = tmp;
              end
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
              \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\
              \;\;\;\;\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha} \cdot \log \left(1 - u0\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (-.f32 #s(literal 1 binary32) u0) < 0.997259974

                1. Initial program 91.9%

                  \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f32N/A

                    \[\leadsto \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                  2. lift-neg.f32N/A

                    \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  3. neg-sub0N/A

                    \[\leadsto \left(\color{blue}{\left(0 - \alpha\right)} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  4. flip--N/A

                    \[\leadsto \left(\color{blue}{\frac{0 \cdot 0 - \alpha \cdot \alpha}{0 + \alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \left(\frac{\color{blue}{0} - \alpha \cdot \alpha}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  6. neg-sub0N/A

                    \[\leadsto \left(\frac{\color{blue}{\mathsf{neg}\left(\alpha \cdot \alpha\right)}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  7. distribute-lft-neg-outN/A

                    \[\leadsto \left(\frac{\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right) \cdot \alpha}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  8. lift-neg.f32N/A

                    \[\leadsto \left(\frac{\color{blue}{\left(-\alpha\right)} \cdot \alpha}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  9. lift-*.f32N/A

                    \[\leadsto \left(\frac{\color{blue}{\left(-\alpha\right) \cdot \alpha}}{0 + \alpha} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  10. +-lft-identityN/A

                    \[\leadsto \left(\frac{\left(-\alpha\right) \cdot \alpha}{\color{blue}{\alpha}} \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  11. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
                  12. lower-/.f32N/A

                    \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]
                  13. lower-*.f3291.9

                    \[\leadsto \frac{\color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}}{\alpha} \cdot \log \left(1 - u0\right) \]
                4. Applied rewrites91.9%

                  \[\leadsto \color{blue}{\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha}} \cdot \log \left(1 - u0\right) \]

                if 0.997259974 < (-.f32 #s(literal 1 binary32) u0)

                1. Initial program 43.5%

                  \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. +-lft-identityN/A

                    \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                  2. flip-+N/A

                    \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  3. neg-sub0N/A

                    \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
                  4. lift-*.f32N/A

                    \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
                  5. lift-neg.f32N/A

                    \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                  6. distribute-lft-neg-outN/A

                    \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
                  7. remove-double-negN/A

                    \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  8. lower-/.f32N/A

                    \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                  10. lower--.f32N/A

                    \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                  11. lower-*.f32N/A

                    \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                  12. lower-*.f3243.5

                    \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                4. Applied rewrites43.5%

                  \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                5. Taylor expanded in u0 around 0

                  \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
                6. Step-by-step derivation
                  1. distribute-lft-inN/A

                    \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
                  2. *-commutativeN/A

                    \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
                  3. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
                  4. distribute-lft1-inN/A

                    \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                  5. lower-*.f32N/A

                    \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                  6. *-commutativeN/A

                    \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
                  7. lower-fma.f32N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                  9. lower-*.f32N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                  10. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                  11. lower-*.f3228.4

                    \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                7. Applied rewrites27.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
                8. Step-by-step derivation
                  1. Applied rewrites98.1%

                    \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]
                9. Recombined 2 regimes into one program.
                10. Final simplification96.6%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\ \;\;\;\;\frac{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \alpha}{\alpha} \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \end{array} \]
                11. Add Preprocessing

                Alternative 8: 96.7% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\ \end{array} \end{array} \]
                (FPCore (alpha u0)
                 :precision binary32
                 (let* ((t_0 (* (* alpha alpha) u0)))
                   (if (<= (- 1.0 u0) 0.9972599744796753)
                     (* (* (- alpha) alpha) (log (- 1.0 u0)))
                     (+ (* (* 0.5 u0) t_0) t_0))))
                float code(float alpha, float u0) {
                	float t_0 = (alpha * alpha) * u0;
                	float tmp;
                	if ((1.0f - u0) <= 0.9972599744796753f) {
                		tmp = (-alpha * alpha) * logf((1.0f - u0));
                	} else {
                		tmp = ((0.5f * u0) * t_0) + t_0;
                	}
                	return tmp;
                }
                
                real(4) function code(alpha, u0)
                    real(4), intent (in) :: alpha
                    real(4), intent (in) :: u0
                    real(4) :: t_0
                    real(4) :: tmp
                    t_0 = (alpha * alpha) * u0
                    if ((1.0e0 - u0) <= 0.9972599744796753e0) then
                        tmp = (-alpha * alpha) * log((1.0e0 - u0))
                    else
                        tmp = ((0.5e0 * u0) * t_0) + t_0
                    end if
                    code = tmp
                end function
                
                function code(alpha, u0)
                	t_0 = Float32(Float32(alpha * alpha) * u0)
                	tmp = Float32(0.0)
                	if (Float32(Float32(1.0) - u0) <= Float32(0.9972599744796753))
                		tmp = Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)));
                	else
                		tmp = Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0);
                	end
                	return tmp
                end
                
                function tmp_2 = code(alpha, u0)
                	t_0 = (alpha * alpha) * u0;
                	tmp = single(0.0);
                	if ((single(1.0) - u0) <= single(0.9972599744796753))
                		tmp = (-alpha * alpha) * log((single(1.0) - u0));
                	else
                		tmp = ((single(0.5) * u0) * t_0) + t_0;
                	end
                	tmp_2 = tmp;
                end
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
                \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\
                \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(0.5 \cdot u0\right) \cdot t\_0 + t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (-.f32 #s(literal 1 binary32) u0) < 0.997259974

                  1. Initial program 91.9%

                    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  2. Add Preprocessing

                  if 0.997259974 < (-.f32 #s(literal 1 binary32) u0)

                  1. Initial program 43.5%

                    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. +-lft-identityN/A

                      \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                    2. flip-+N/A

                      \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    3. neg-sub0N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
                    4. lift-*.f32N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
                    5. lift-neg.f32N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                    6. distribute-lft-neg-outN/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
                    7. remove-double-negN/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    8. lower-/.f32N/A

                      \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    10. lower--.f32N/A

                      \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    11. lower-*.f32N/A

                      \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    12. lower-*.f3243.5

                      \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  4. Applied rewrites43.5%

                    \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  5. Taylor expanded in u0 around 0

                    \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
                  6. Step-by-step derivation
                    1. distribute-lft-inN/A

                      \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
                    2. *-commutativeN/A

                      \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
                    3. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
                    4. distribute-lft1-inN/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                    5. lower-*.f32N/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                    6. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
                    7. lower-fma.f32N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                    9. lower-*.f32N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                    10. unpow2N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                    11. lower-*.f3228.4

                      \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                  7. Applied rewrites27.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
                  8. Step-by-step derivation
                    1. Applied rewrites98.1%

                      \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]
                  9. Recombined 2 regimes into one program.
                  10. Final simplification96.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9972599744796753:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0\\ \end{array} \]
                  11. Add Preprocessing

                  Alternative 9: 87.5% accurate, 3.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\ \left(0.5 \cdot u0\right) \cdot t\_0 + t\_0 \end{array} \end{array} \]
                  (FPCore (alpha u0)
                   :precision binary32
                   (let* ((t_0 (* (* alpha alpha) u0))) (+ (* (* 0.5 u0) t_0) t_0)))
                  float code(float alpha, float u0) {
                  	float t_0 = (alpha * alpha) * u0;
                  	return ((0.5f * u0) * t_0) + t_0;
                  }
                  
                  real(4) function code(alpha, u0)
                      real(4), intent (in) :: alpha
                      real(4), intent (in) :: u0
                      real(4) :: t_0
                      t_0 = (alpha * alpha) * u0
                      code = ((0.5e0 * u0) * t_0) + t_0
                  end function
                  
                  function code(alpha, u0)
                  	t_0 = Float32(Float32(alpha * alpha) * u0)
                  	return Float32(Float32(Float32(Float32(0.5) * u0) * t_0) + t_0)
                  end
                  
                  function tmp = code(alpha, u0)
                  	t_0 = (alpha * alpha) * u0;
                  	tmp = ((single(0.5) * u0) * t_0) + t_0;
                  end
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \left(\alpha \cdot \alpha\right) \cdot u0\\
                  \left(0.5 \cdot u0\right) \cdot t\_0 + t\_0
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Initial program 55.1%

                    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. +-lft-identityN/A

                      \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                    2. flip-+N/A

                      \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    3. neg-sub0N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
                    4. lift-*.f32N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
                    5. lift-neg.f32N/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                    6. distribute-lft-neg-outN/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
                    7. remove-double-negN/A

                      \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    8. lower-/.f32N/A

                      \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    10. lower--.f32N/A

                      \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    11. lower-*.f32N/A

                      \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                    12. lower-*.f3255.1

                      \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  4. Applied rewrites55.1%

                    \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                  5. Taylor expanded in u0 around 0

                    \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
                  6. Step-by-step derivation
                    1. distribute-lft-inN/A

                      \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
                    2. *-commutativeN/A

                      \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
                    3. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
                    4. distribute-lft1-inN/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                    5. lower-*.f32N/A

                      \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                    6. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
                    7. lower-fma.f32N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                    9. lower-*.f32N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                    10. unpow2N/A

                      \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                    11. lower-*.f3228.0

                      \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                  7. Applied rewrites27.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
                  8. Step-by-step derivation
                    1. Applied rewrites89.1%

                      \[\leadsto \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot \left(0.5 \cdot u0\right) + \color{blue}{\left(u0 \cdot \left(\alpha \cdot \alpha\right)\right) \cdot 1} \]
                    2. Final simplification89.1%

                      \[\leadsto \left(0.5 \cdot u0\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) + \left(\alpha \cdot \alpha\right) \cdot u0 \]
                    3. Add Preprocessing

                    Alternative 10: 87.3% accurate, 4.8× speedup?

                    \[\begin{array}{l} \\ \left(0.5 \cdot u0 + 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \end{array} \]
                    (FPCore (alpha u0)
                     :precision binary32
                     (* (+ (* 0.5 u0) 1.0) (* (* alpha alpha) u0)))
                    float code(float alpha, float u0) {
                    	return ((0.5f * u0) + 1.0f) * ((alpha * alpha) * u0);
                    }
                    
                    real(4) function code(alpha, u0)
                        real(4), intent (in) :: alpha
                        real(4), intent (in) :: u0
                        code = ((0.5e0 * u0) + 1.0e0) * ((alpha * alpha) * u0)
                    end function
                    
                    function code(alpha, u0)
                    	return Float32(Float32(Float32(Float32(0.5) * u0) + Float32(1.0)) * Float32(Float32(alpha * alpha) * u0))
                    end
                    
                    function tmp = code(alpha, u0)
                    	tmp = ((single(0.5) * u0) + single(1.0)) * ((alpha * alpha) * u0);
                    end
                    
                    \begin{array}{l}
                    
                    \\
                    \left(0.5 \cdot u0 + 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right)
                    \end{array}
                    
                    Derivation
                    1. Initial program 55.1%

                      \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. +-lft-identityN/A

                        \[\leadsto \color{blue}{\left(0 + \left(-\alpha\right) \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                      2. flip-+N/A

                        \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{0 - \left(-\alpha\right) \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                      3. neg-sub0N/A

                        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\mathsf{neg}\left(\left(-\alpha\right) \cdot \alpha\right)}} \cdot \log \left(1 - u0\right) \]
                      4. lift-*.f32N/A

                        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(-\alpha\right) \cdot \alpha}\right)} \cdot \log \left(1 - u0\right) \]
                      5. lift-neg.f32N/A

                        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha\right)\right)} \cdot \alpha\right)} \cdot \log \left(1 - u0\right) \]
                      6. distribute-lft-neg-outN/A

                        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\alpha \cdot \alpha\right)\right)}\right)} \cdot \log \left(1 - u0\right) \]
                      7. remove-double-negN/A

                        \[\leadsto \frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                      8. lower-/.f32N/A

                        \[\leadsto \color{blue}{\frac{0 \cdot 0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \frac{\color{blue}{0} - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                      10. lower--.f32N/A

                        \[\leadsto \frac{\color{blue}{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                      11. lower-*.f32N/A

                        \[\leadsto \frac{0 - \color{blue}{\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}}{\alpha \cdot \alpha} \cdot \log \left(1 - u0\right) \]
                      12. lower-*.f3255.1

                        \[\leadsto \frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\color{blue}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    4. Applied rewrites55.1%

                      \[\leadsto \color{blue}{\frac{0 - \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \left(\left(-\alpha\right) \cdot \alpha\right)}{\alpha \cdot \alpha}} \cdot \log \left(1 - u0\right) \]
                    5. Taylor expanded in u0 around 0

                      \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + {\alpha}^{2}\right)} \]
                    6. Step-by-step derivation
                      1. distribute-lft-inN/A

                        \[\leadsto \color{blue}{u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + u0 \cdot {\alpha}^{2}} \]
                      2. *-commutativeN/A

                        \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right)\right) + \color{blue}{{\alpha}^{2} \cdot u0} \]
                      3. associate-*r*N/A

                        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2}\right) \cdot \left({\alpha}^{2} \cdot u0\right)} + {\alpha}^{2} \cdot u0 \]
                      4. distribute-lft1-inN/A

                        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                      5. lower-*.f32N/A

                        \[\leadsto \color{blue}{\left(u0 \cdot \frac{1}{2} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right)} \]
                      6. *-commutativeN/A

                        \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot u0} + 1\right) \cdot \left({\alpha}^{2} \cdot u0\right) \]
                      7. lower-fma.f32N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, u0, 1\right)} \cdot \left({\alpha}^{2} \cdot u0\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                      9. lower-*.f32N/A

                        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \color{blue}{\left(u0 \cdot {\alpha}^{2}\right)} \]
                      10. unpow2N/A

                        \[\leadsto \mathsf{fma}\left(\frac{1}{2}, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                      11. lower-*.f3228.0

                        \[\leadsto \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)}\right) \]
                    7. Applied rewrites27.9%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(u0 \cdot \left(\alpha \cdot \alpha\right)\right)} \]
                    8. Step-by-step derivation
                      1. Applied rewrites88.9%

                        \[\leadsto \left(0.5 \cdot u0 + 1\right) \cdot \left(\color{blue}{u0} \cdot \left(\alpha \cdot \alpha\right)\right) \]
                      2. Final simplification88.9%

                        \[\leadsto \left(0.5 \cdot u0 + 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \]
                      3. Add Preprocessing

                      Alternative 11: 74.9% accurate, 10.5× speedup?

                      \[\begin{array}{l} \\ \left(\alpha \cdot \alpha\right) \cdot u0 \end{array} \]
                      (FPCore (alpha u0) :precision binary32 (* (* alpha alpha) u0))
                      float code(float alpha, float u0) {
                      	return (alpha * alpha) * u0;
                      }
                      
                      real(4) function code(alpha, u0)
                          real(4), intent (in) :: alpha
                          real(4), intent (in) :: u0
                          code = (alpha * alpha) * u0
                      end function
                      
                      function code(alpha, u0)
                      	return Float32(Float32(alpha * alpha) * u0)
                      end
                      
                      function tmp = code(alpha, u0)
                      	tmp = (alpha * alpha) * u0;
                      end
                      
                      \begin{array}{l}
                      
                      \\
                      \left(\alpha \cdot \alpha\right) \cdot u0
                      \end{array}
                      
                      Derivation
                      1. Initial program 55.1%

                        \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in u0 around 0

                        \[\leadsto \color{blue}{{\alpha}^{2} \cdot u0} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{u0 \cdot {\alpha}^{2}} \]
                        2. lower-*.f32N/A

                          \[\leadsto \color{blue}{u0 \cdot {\alpha}^{2}} \]
                        3. unpow2N/A

                          \[\leadsto u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)} \]
                        4. lower-*.f3275.9

                          \[\leadsto u0 \cdot \color{blue}{\left(\alpha \cdot \alpha\right)} \]
                      5. Applied rewrites75.9%

                        \[\leadsto \color{blue}{u0 \cdot \left(\alpha \cdot \alpha\right)} \]
                      6. Final simplification75.9%

                        \[\leadsto \left(\alpha \cdot \alpha\right) \cdot u0 \]
                      7. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2024241 
                      (FPCore (alpha u0)
                        :name "Beckmann Distribution sample, tan2theta, alphax == alphay"
                        :precision binary32
                        :pre (and (and (<= 0.0001 alpha) (<= alpha 1.0)) (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                        (* (* (- alpha) alpha) (log (- 1.0 u0))))