?

Average Error: 14.2 → 0.5
Time: 1.0min
Precision: binary32
Cost: 20388

?

\[\left(0.0001 \leq \alpha \land \alpha \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\]
\[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
\[\begin{array}{l} t_0 := \log \left(1 - u0\right)\\ \mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\ \;\;\;\;\alpha \cdot \left(\frac{t_0 \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{t_0 \cdot \alpha}{-2} - \alpha \cdot \left(\log \left({\left(1 - u0\right)}^{-2}\right) - \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)\right)}{2}\\ \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (* (* (- alpha) alpha) (log (- 1.0 u0))))
(FPCore (alpha u0)
 :precision binary32
 (let* ((t_0 (log (- 1.0 u0))))
   (if (<= (- 1.0 u0) 0.9599999785423279)
     (*
      alpha
      (-
       (/ (* t_0 (* alpha -3.0)) 4.0)
       (/
        (-
         (/ (* t_0 alpha) -2.0)
         (* alpha (- (log (pow (- 1.0 u0) -2.0)) (log (pow (- 1.0 u0) -0.5)))))
        4.0)))
     (/
      (*
       alpha
       (*
        alpha
        (+
         (* (pow u0 4.0) 0.5)
         (-
          (pow u0 2.0)
          (- (- u0) (+ u0 (* (pow u0 3.0) 0.6666666666666666)))))))
      2.0))))
float code(float alpha, float u0) {
	return (-alpha * alpha) * logf((1.0f - u0));
}
float code(float alpha, float u0) {
	float t_0 = logf((1.0f - u0));
	float tmp;
	if ((1.0f - u0) <= 0.9599999785423279f) {
		tmp = alpha * (((t_0 * (alpha * -3.0f)) / 4.0f) - ((((t_0 * alpha) / -2.0f) - (alpha * (logf(powf((1.0f - u0), -2.0f)) - logf(powf((1.0f - u0), -0.5f))))) / 4.0f));
	} else {
		tmp = (alpha * (alpha * ((powf(u0, 4.0f) * 0.5f) + (powf(u0, 2.0f) - (-u0 - (u0 + (powf(u0, 3.0f) * 0.6666666666666666f))))))) / 2.0f;
	}
	return tmp;
}
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
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 = log((1.0e0 - u0))
    if ((1.0e0 - u0) <= 0.9599999785423279e0) then
        tmp = alpha * (((t_0 * (alpha * (-3.0e0))) / 4.0e0) - ((((t_0 * alpha) / (-2.0e0)) - (alpha * (log(((1.0e0 - u0) ** (-2.0e0))) - log(((1.0e0 - u0) ** (-0.5e0)))))) / 4.0e0))
    else
        tmp = (alpha * (alpha * (((u0 ** 4.0e0) * 0.5e0) + ((u0 ** 2.0e0) - (-u0 - (u0 + ((u0 ** 3.0e0) * 0.6666666666666666e0))))))) / 2.0e0
    end if
    code = tmp
end function
function code(alpha, u0)
	return Float32(Float32(Float32(-alpha) * alpha) * log(Float32(Float32(1.0) - u0)))
end
function code(alpha, u0)
	t_0 = log(Float32(Float32(1.0) - u0))
	tmp = Float32(0.0)
	if (Float32(Float32(1.0) - u0) <= Float32(0.9599999785423279))
		tmp = Float32(alpha * Float32(Float32(Float32(t_0 * Float32(alpha * Float32(-3.0))) / Float32(4.0)) - Float32(Float32(Float32(Float32(t_0 * alpha) / Float32(-2.0)) - Float32(alpha * Float32(log((Float32(Float32(1.0) - u0) ^ Float32(-2.0))) - log((Float32(Float32(1.0) - u0) ^ Float32(-0.5)))))) / Float32(4.0))));
	else
		tmp = Float32(Float32(alpha * Float32(alpha * Float32(Float32((u0 ^ Float32(4.0)) * Float32(0.5)) + Float32((u0 ^ Float32(2.0)) - Float32(Float32(-u0) - Float32(u0 + Float32((u0 ^ Float32(3.0)) * Float32(0.6666666666666666)))))))) / Float32(2.0));
	end
	return tmp
end
function tmp = code(alpha, u0)
	tmp = (-alpha * alpha) * log((single(1.0) - u0));
end
function tmp_2 = code(alpha, u0)
	t_0 = log((single(1.0) - u0));
	tmp = single(0.0);
	if ((single(1.0) - u0) <= single(0.9599999785423279))
		tmp = alpha * (((t_0 * (alpha * single(-3.0))) / single(4.0)) - ((((t_0 * alpha) / single(-2.0)) - (alpha * (log(((single(1.0) - u0) ^ single(-2.0))) - log(((single(1.0) - u0) ^ single(-0.5)))))) / single(4.0)));
	else
		tmp = (alpha * (alpha * (((u0 ^ single(4.0)) * single(0.5)) + ((u0 ^ single(2.0)) - (-u0 - (u0 + ((u0 ^ single(3.0)) * single(0.6666666666666666)))))))) / single(2.0);
	end
	tmp_2 = tmp;
end
\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)
\begin{array}{l}
t_0 := \log \left(1 - u0\right)\\
\mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\
\;\;\;\;\alpha \cdot \left(\frac{t_0 \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{t_0 \cdot \alpha}{-2} - \alpha \cdot \left(\log \left({\left(1 - u0\right)}^{-2}\right) - \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}{4}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)\right)}{2}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if (-.f32 1 u0) < 0.959999979

    1. Initial program 1.1

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

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

      [Start]1.1

      \[ \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]

      rational_best-simplify-1 [=>]1.1

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

      rational_best-simplify-50 [=>]1.1

      \[ \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \log \left(1 - u0\right)\right)} \]
    3. Applied egg-rr1.1

      \[\leadsto \alpha \cdot \color{blue}{\left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\log \left(1 - u0\right) \cdot \alpha}{4}\right)} \]
    4. Applied egg-rr1.2

      \[\leadsto \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\color{blue}{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \left(\log \left(1 - u0\right) \cdot \alpha\right) \cdot -1.5}}{4}\right) \]
    5. Applied egg-rr1.2

      \[\leadsto \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \color{blue}{\left(\alpha \cdot \log \left({\left(1 - u0\right)}^{-2}\right) - \alpha \cdot \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}}{4}\right) \]
    6. Simplified1.2

      \[\leadsto \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \color{blue}{\alpha \cdot \left(\log \left({\left(1 - u0\right)}^{-2}\right) - \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}}{4}\right) \]
      Proof

      [Start]1.2

      \[ \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \left(\alpha \cdot \log \left({\left(1 - u0\right)}^{-2}\right) - \alpha \cdot \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}{4}\right) \]

      rational_best-simplify-1 [=>]1.2

      \[ \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \left(\color{blue}{\log \left({\left(1 - u0\right)}^{-2}\right) \cdot \alpha} - \alpha \cdot \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}{4}\right) \]

      rational_best-simplify-62 [=>]1.2

      \[ \alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \color{blue}{\alpha \cdot \left(\log \left({\left(1 - u0\right)}^{-2}\right) - \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}}{4}\right) \]

    if 0.959999979 < (-.f32 1 u0)

    1. Initial program 16.4

      \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
    2. Simplified16.4

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

      [Start]16.4

      \[ \left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]

      rational_best-simplify-1 [=>]16.4

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

      rational_best-simplify-50 [=>]16.4

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

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(-1 \cdot u0 + \left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right)}\right) \]
    4. Simplified0.4

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(\left(-0.5 \cdot {u0}^{2} - u0\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)}\right) \]
      Proof

      [Start]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(-1 \cdot u0 + \left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right)\right) \]

      rational_best-simplify-47 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(\left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right) + \left(-0.5 \cdot {u0}^{2} + -1 \cdot u0\right)\right)}\right) \]

      rational_best-simplify-3 [<=]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right) + \color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)}\right)\right) \]

      rational_best-simplify-3 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)}\right) \]

      rational_best-simplify-59 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - \left(--1 \cdot u0\right)\right)} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]

      rational_best-simplify-14 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} - \color{blue}{\left(0 - -1 \cdot u0\right)}\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]

      metadata-eval [<=]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} - \left(\color{blue}{\frac{0}{-1}} - -1 \cdot u0\right)\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]

      rational_best-simplify-37 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} - \color{blue}{\frac{u0}{\frac{-1}{-1}}}\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]

      metadata-eval [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} - \frac{u0}{\color{blue}{1}}\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]

      rational_best-simplify-8 [=>]0.4

      \[ \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-0.5 \cdot {u0}^{2} - \color{blue}{u0}\right) + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right)\right) \]
    5. Taylor expanded in alpha around 0 0.4

      \[\leadsto \alpha \cdot \color{blue}{\left(-1 \cdot \left(\alpha \cdot \left(\left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right) - u0\right)\right)\right)} \]
    6. Simplified0.4

      \[\leadsto \alpha \cdot \color{blue}{\left(\alpha \cdot \left(\left(u0 - -0.5 \cdot {u0}^{2}\right) + \left({u0}^{3} \cdot 0.3333333333333333 + {u0}^{4} \cdot 0.25\right)\right)\right)} \]
      Proof

      [Start]0.4

      \[ \alpha \cdot \left(-1 \cdot \left(\alpha \cdot \left(\left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right) - u0\right)\right)\right) \]

      rational_best-simplify-50 [=>]0.4

      \[ \alpha \cdot \color{blue}{\left(\left(\left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right) - u0\right) \cdot \left(\alpha \cdot -1\right)\right)} \]

      rational_best-simplify-11 [<=]0.4

      \[ \alpha \cdot \left(\left(\left(-0.5 \cdot {u0}^{2} + \left(-0.3333333333333333 \cdot {u0}^{3} + -0.25 \cdot {u0}^{4}\right)\right) - u0\right) \cdot \color{blue}{\left(-\alpha\right)}\right) \]
    7. Applied egg-rr0.4

      \[\leadsto \color{blue}{\frac{\alpha \cdot \left(\alpha \cdot \left(\left({u0}^{4} \cdot 0.5 + {u0}^{3} \cdot 0.6666666666666666\right) + \left(u0 + \left(u0 - \left(-{u0}^{2}\right)\right)\right)\right)\right)}{2}} \]
    8. Simplified0.4

      \[\leadsto \color{blue}{\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left(\left(u0 - \left(-{u0}^{2}\right)\right) + \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)}{2}} \]
      Proof

      [Start]0.4

      \[ \frac{\alpha \cdot \left(\alpha \cdot \left(\left({u0}^{4} \cdot 0.5 + {u0}^{3} \cdot 0.6666666666666666\right) + \left(u0 + \left(u0 - \left(-{u0}^{2}\right)\right)\right)\right)\right)}{2} \]

      rational_best-simplify-3 [=>]0.4

      \[ \frac{\alpha \cdot \left(\alpha \cdot \color{blue}{\left(\left(u0 + \left(u0 - \left(-{u0}^{2}\right)\right)\right) + \left({u0}^{4} \cdot 0.5 + {u0}^{3} \cdot 0.6666666666666666\right)\right)}\right)}{2} \]

      rational_best-simplify-3 [=>]0.4

      \[ \frac{\alpha \cdot \left(\alpha \cdot \left(\left(u0 + \left(u0 - \left(-{u0}^{2}\right)\right)\right) + \color{blue}{\left({u0}^{3} \cdot 0.6666666666666666 + {u0}^{4} \cdot 0.5\right)}\right)\right)}{2} \]

      rational_best-simplify-47 [=>]0.4

      \[ \frac{\alpha \cdot \left(\alpha \cdot \color{blue}{\left({u0}^{4} \cdot 0.5 + \left({u0}^{3} \cdot 0.6666666666666666 + \left(u0 + \left(u0 - \left(-{u0}^{2}\right)\right)\right)\right)\right)}\right)}{2} \]

      rational_best-simplify-47 [=>]0.4

      \[ \frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \color{blue}{\left(\left(u0 - \left(-{u0}^{2}\right)\right) + \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)}\right)\right)}{2} \]
    9. Applied egg-rr0.4

      \[\leadsto \frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \color{blue}{\left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)}\right)\right)}{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\ \;\;\;\;\alpha \cdot \left(\frac{\log \left(1 - u0\right) \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\frac{\log \left(1 - u0\right) \cdot \alpha}{-2} - \alpha \cdot \left(\log \left({\left(1 - u0\right)}^{-2}\right) - \log \left({\left(1 - u0\right)}^{-0.5}\right)\right)}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)\right)}{2}\\ \end{array} \]

Alternatives

Alternative 1
Error0.5
Cost13828
\[\begin{array}{l} t_0 := \log \left(1 - u0\right)\\ \mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\ \;\;\;\;\alpha \cdot \left(\frac{t_0 \cdot \left(\alpha \cdot -3\right)}{4} - \frac{\alpha \cdot \log \left({\left(1 - u0\right)}^{-0.5}\right) - \alpha \cdot \left(-1.5 \cdot t_0\right)}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)\right)}{2}\\ \end{array} \]
Alternative 2
Error0.5
Cost10468
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha \cdot \left(\alpha \cdot \left({u0}^{4} \cdot 0.5 + \left({u0}^{2} - \left(\left(-u0\right) - \left(u0 + {u0}^{3} \cdot 0.6666666666666666\right)\right)\right)\right)\right)}{2}\\ \end{array} \]
Alternative 3
Error0.5
Cost10372
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9599999785423279:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(\alpha \cdot \left(\left(u0 - -0.5 \cdot {u0}^{2}\right) + \left({u0}^{3} \cdot 0.3333333333333333 + {u0}^{4} \cdot 0.25\right)\right)\right)\\ \end{array} \]
Alternative 4
Error0.6
Cost7076
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9850000143051147:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\left(-u0\right) + \left(-0.5 \cdot {u0}^{2} + -0.3333333333333333 \cdot {u0}^{3}\right)\right)\right)\\ \end{array} \]
Alternative 5
Error0.6
Cost7012
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9850000143051147:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(\alpha \cdot \left(\left(u0 - -0.5 \cdot {u0}^{2}\right) - -0.3333333333333333 \cdot {u0}^{3}\right)\right)\\ \end{array} \]
Alternative 6
Error1.1
Cost3652
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9965000152587891:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(\alpha \cdot \left(u0 + {u0}^{2} \cdot 0.5\right)\right)\\ \end{array} \]
Alternative 7
Error3.3
Cost3588
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9998499751091003:\\ \;\;\;\;\alpha \cdot \left(\left(-\alpha\right) \cdot \log \left(1 - u0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(u0 \cdot \alpha\right)\\ \end{array} \]
Alternative 8
Error3.3
Cost3588
\[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9998499751091003:\\ \;\;\;\;\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right)\\ \mathbf{else}:\\ \;\;\;\;\alpha \cdot \left(u0 \cdot \alpha\right)\\ \end{array} \]
Alternative 9
Error8.0
Cost160
\[\alpha \cdot \left(u0 \cdot \alpha\right) \]

Error

Reproduce?

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