Beckmann Distribution sample, tan2theta, alphax == alphay

Percentage Accurate: 56.2% → 98.9%
Time: 7.7s
Alternatives: 9
Speedup: 21.6×

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 9 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: 56.2% 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: 98.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ -\mathsf{log1p}\left(-u0\right) \cdot \left(\alpha \cdot \alpha\right) \end{array} \]
(FPCore (alpha u0) :precision binary32 (- (* (log1p (- u0)) (* alpha alpha))))
float code(float alpha, float u0) {
	return -(log1pf(-u0) * (alpha * alpha));
}
function code(alpha, u0)
	return Float32(-Float32(log1p(Float32(-u0)) * Float32(alpha * alpha)))
end
\begin{array}{l}

\\
-\mathsf{log1p}\left(-u0\right) \cdot \left(\alpha \cdot \alpha\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Final simplification99.0%

    \[\leadsto -\mathsf{log1p}\left(-u0\right) \cdot \left(\alpha \cdot \alpha\right) \]
  6. Add Preprocessing

Alternative 2: 93.4% accurate, 4.7× speedup?

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

\\
\alpha \cdot \left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot 0.5 + u0 \cdot \left(0.25 \cdot \left(\alpha \cdot u0\right) + \alpha \cdot 0.3333333333333333\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. log1p-undefine56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\log \left(1 + \left(-u0\right)\right)} \]
    2. flip-+53.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \left(-u0\right)}\right)} \]
    3. add-sqr-sqrt-0.0%

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

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}}\right) \]
    5. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \sqrt{\color{blue}{u0 \cdot u0}}}\right) \]
    6. sqrt-unprod5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{u0} \cdot \sqrt{u0}}}\right) \]
    7. add-sqr-sqrt5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{u0}}\right) \]
    8. unsub-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{1 + \left(-u0\right)}}\right) \]
    9. rem-exp-log5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{e^{\log \left(1 + \left(-u0\right)\right)}}}\right) \]
    10. log1p-undefine5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{e^{\color{blue}{\mathsf{log1p}\left(-u0\right)}}}\right) \]
    11. log-div5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right)} \]
    12. metadata-eval5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(\color{blue}{1} - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    13. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{u0 \cdot u0}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    14. pow25.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{{u0}^{2}}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    15. add-log-exp4.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(-u0\right)}\right) \]
    16. add-sqr-sqrt-0.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{-u0} \cdot \sqrt{-u0}}\right)\right) \]
    17. sqrt-unprod89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right)\right) \]
    18. sqr-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\sqrt{\color{blue}{u0 \cdot u0}}\right)\right) \]
    19. sqrt-unprod89.1%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{u0} \cdot \sqrt{u0}}\right)\right) \]
  6. Applied egg-rr89.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  7. Step-by-step derivation
    1. sub-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \color{blue}{\left(1 + \left(-{u0}^{2}\right)\right)} - \mathsf{log1p}\left(u0\right)\right) \]
    2. log1p-define98.8%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\color{blue}{\mathsf{log1p}\left(-{u0}^{2}\right)} - \mathsf{log1p}\left(u0\right)\right) \]
  8. Simplified98.8%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  9. Step-by-step derivation
    1. add-cube-cbrt97.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}}\right) \]
    2. pow397.5%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  10. Applied egg-rr97.5%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  11. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - {\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}\right)\right)} \]
    2. rem-cube-cbrt98.8%

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(u0\right)}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)\right)} \]
  13. Taylor expanded in u0 around 0 93.5%

    \[\leadsto \alpha \cdot \color{blue}{\left(u0 \cdot \left(\alpha + u0 \cdot \left(0.5 \cdot \alpha + u0 \cdot \left(0.25 \cdot \left(\alpha \cdot u0\right) + 0.3333333333333333 \cdot \alpha\right)\right)\right)\right)} \]
  14. Final simplification93.5%

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

Alternative 3: 93.2% accurate, 5.7× speedup?

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

\\
\left(\alpha \cdot \alpha\right) \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in u0 around 0 93.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)} \]
  6. Final simplification93.3%

    \[\leadsto \left(\alpha \cdot \alpha\right) \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)\right) \]
  7. Add Preprocessing

Alternative 4: 93.1% accurate, 5.7× speedup?

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

\\
\alpha \cdot \left(\alpha \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. log1p-undefine56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\log \left(1 + \left(-u0\right)\right)} \]
    2. flip-+53.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \left(-u0\right)}\right)} \]
    3. add-sqr-sqrt-0.0%

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

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}}\right) \]
    5. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \sqrt{\color{blue}{u0 \cdot u0}}}\right) \]
    6. sqrt-unprod5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{u0} \cdot \sqrt{u0}}}\right) \]
    7. add-sqr-sqrt5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{u0}}\right) \]
    8. unsub-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{1 + \left(-u0\right)}}\right) \]
    9. rem-exp-log5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{e^{\log \left(1 + \left(-u0\right)\right)}}}\right) \]
    10. log1p-undefine5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{e^{\color{blue}{\mathsf{log1p}\left(-u0\right)}}}\right) \]
    11. log-div5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right)} \]
    12. metadata-eval5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(\color{blue}{1} - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    13. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{u0 \cdot u0}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    14. pow25.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{{u0}^{2}}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    15. add-log-exp4.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(-u0\right)}\right) \]
    16. add-sqr-sqrt-0.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{-u0} \cdot \sqrt{-u0}}\right)\right) \]
    17. sqrt-unprod89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right)\right) \]
    18. sqr-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\sqrt{\color{blue}{u0 \cdot u0}}\right)\right) \]
    19. sqrt-unprod89.1%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{u0} \cdot \sqrt{u0}}\right)\right) \]
  6. Applied egg-rr89.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  7. Step-by-step derivation
    1. sub-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \color{blue}{\left(1 + \left(-{u0}^{2}\right)\right)} - \mathsf{log1p}\left(u0\right)\right) \]
    2. log1p-define98.8%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\color{blue}{\mathsf{log1p}\left(-{u0}^{2}\right)} - \mathsf{log1p}\left(u0\right)\right) \]
  8. Simplified98.8%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  9. Step-by-step derivation
    1. add-cube-cbrt97.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}}\right) \]
    2. pow397.5%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  10. Applied egg-rr97.5%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  11. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - {\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}\right)\right)} \]
    2. rem-cube-cbrt98.8%

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(u0\right)}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)\right)} \]
  13. Taylor expanded in u0 around 0 93.2%

    \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)\right)}\right) \]
  14. Final simplification93.2%

    \[\leadsto \alpha \cdot \left(\alpha \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)\right)\right) \]
  15. Add Preprocessing

Alternative 5: 91.4% accurate, 6.4× speedup?

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

\\
\alpha \cdot \left(u0 \cdot \left(\alpha + u0 \cdot \left(\alpha \cdot 0.5 + \left(\alpha \cdot u0\right) \cdot 0.3333333333333333\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. log1p-undefine56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\log \left(1 + \left(-u0\right)\right)} \]
    2. flip-+53.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \left(-u0\right)}\right)} \]
    3. add-sqr-sqrt-0.0%

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

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}}\right) \]
    5. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \sqrt{\color{blue}{u0 \cdot u0}}}\right) \]
    6. sqrt-unprod5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{u0} \cdot \sqrt{u0}}}\right) \]
    7. add-sqr-sqrt5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{u0}}\right) \]
    8. unsub-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{1 + \left(-u0\right)}}\right) \]
    9. rem-exp-log5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{e^{\log \left(1 + \left(-u0\right)\right)}}}\right) \]
    10. log1p-undefine5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{e^{\color{blue}{\mathsf{log1p}\left(-u0\right)}}}\right) \]
    11. log-div5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right)} \]
    12. metadata-eval5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(\color{blue}{1} - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    13. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{u0 \cdot u0}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    14. pow25.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{{u0}^{2}}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    15. add-log-exp4.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(-u0\right)}\right) \]
    16. add-sqr-sqrt-0.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{-u0} \cdot \sqrt{-u0}}\right)\right) \]
    17. sqrt-unprod89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right)\right) \]
    18. sqr-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\sqrt{\color{blue}{u0 \cdot u0}}\right)\right) \]
    19. sqrt-unprod89.1%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{u0} \cdot \sqrt{u0}}\right)\right) \]
  6. Applied egg-rr89.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  7. Step-by-step derivation
    1. sub-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \color{blue}{\left(1 + \left(-{u0}^{2}\right)\right)} - \mathsf{log1p}\left(u0\right)\right) \]
    2. log1p-define98.8%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\color{blue}{\mathsf{log1p}\left(-{u0}^{2}\right)} - \mathsf{log1p}\left(u0\right)\right) \]
  8. Simplified98.8%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  9. Step-by-step derivation
    1. add-cube-cbrt97.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}}\right) \]
    2. pow397.5%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  10. Applied egg-rr97.5%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  11. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - {\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}\right)\right)} \]
    2. rem-cube-cbrt98.8%

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(u0\right)}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)\right)} \]
  13. Taylor expanded in u0 around 0 91.4%

    \[\leadsto \alpha \cdot \color{blue}{\left(u0 \cdot \left(\alpha + u0 \cdot \left(0.3333333333333333 \cdot \left(\alpha \cdot u0\right) + 0.5 \cdot \alpha\right)\right)\right)} \]
  14. Final simplification91.4%

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

Alternative 6: 91.2% accurate, 7.2× speedup?

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

\\
\left(\alpha \cdot \alpha\right) \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot -0.3333333333333333\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in u0 around 0 91.2%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(-0.3333333333333333 \cdot u0 - 0.5\right) - 1\right)\right)} \]
  6. Final simplification91.2%

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

Alternative 7: 91.2% accurate, 7.2× speedup?

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

\\
\alpha \cdot \left(\alpha \cdot \left(u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot -0.3333333333333333\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. log1p-undefine56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\log \left(1 + \left(-u0\right)\right)} \]
    2. flip-+53.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \left(-u0\right)}\right)} \]
    3. add-sqr-sqrt-0.0%

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

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}}\right) \]
    5. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \sqrt{\color{blue}{u0 \cdot u0}}}\right) \]
    6. sqrt-unprod5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{u0} \cdot \sqrt{u0}}}\right) \]
    7. add-sqr-sqrt5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{u0}}\right) \]
    8. unsub-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{1 + \left(-u0\right)}}\right) \]
    9. rem-exp-log5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{e^{\log \left(1 + \left(-u0\right)\right)}}}\right) \]
    10. log1p-undefine5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{e^{\color{blue}{\mathsf{log1p}\left(-u0\right)}}}\right) \]
    11. log-div5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right)} \]
    12. metadata-eval5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(\color{blue}{1} - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    13. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{u0 \cdot u0}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    14. pow25.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{{u0}^{2}}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    15. add-log-exp4.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(-u0\right)}\right) \]
    16. add-sqr-sqrt-0.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{-u0} \cdot \sqrt{-u0}}\right)\right) \]
    17. sqrt-unprod89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right)\right) \]
    18. sqr-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\sqrt{\color{blue}{u0 \cdot u0}}\right)\right) \]
    19. sqrt-unprod89.1%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{u0} \cdot \sqrt{u0}}\right)\right) \]
  6. Applied egg-rr89.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  7. Step-by-step derivation
    1. sub-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \color{blue}{\left(1 + \left(-{u0}^{2}\right)\right)} - \mathsf{log1p}\left(u0\right)\right) \]
    2. log1p-define98.8%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\color{blue}{\mathsf{log1p}\left(-{u0}^{2}\right)} - \mathsf{log1p}\left(u0\right)\right) \]
  8. Simplified98.8%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  9. Step-by-step derivation
    1. add-cube-cbrt97.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}}\right) \]
    2. pow397.5%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  10. Applied egg-rr97.5%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  11. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - {\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}\right)\right)} \]
    2. rem-cube-cbrt98.8%

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(u0\right)}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)\right)} \]
  13. Taylor expanded in u0 around 0 91.2%

    \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \color{blue}{\left(u0 \cdot \left(u0 \cdot \left(-0.3333333333333333 \cdot u0 - 0.5\right) - 1\right)\right)}\right) \]
  14. Final simplification91.2%

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

Alternative 8: 87.2% accurate, 9.8× speedup?

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

\\
\alpha \cdot \left(u0 \cdot \left(\alpha + 0.5 \cdot \left(\alpha \cdot u0\right)\right)\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. log1p-undefine56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\log \left(1 + \left(-u0\right)\right)} \]
    2. flip-+53.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \left(-u0\right)}\right)} \]
    3. add-sqr-sqrt-0.0%

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

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}}\right) \]
    5. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \sqrt{\color{blue}{u0 \cdot u0}}}\right) \]
    6. sqrt-unprod5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{\sqrt{u0} \cdot \sqrt{u0}}}\right) \]
    7. add-sqr-sqrt5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{1 - \color{blue}{u0}}\right) \]
    8. unsub-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{1 + \left(-u0\right)}}\right) \]
    9. rem-exp-log5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{\color{blue}{e^{\log \left(1 + \left(-u0\right)\right)}}}\right) \]
    10. log1p-undefine5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \left(\frac{1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)}{e^{\color{blue}{\mathsf{log1p}\left(-u0\right)}}}\right) \]
    11. log-div5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 \cdot 1 - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right)} \]
    12. metadata-eval5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(\color{blue}{1} - \left(-u0\right) \cdot \left(-u0\right)\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    13. sqr-neg5.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{u0 \cdot u0}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    14. pow25.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - \color{blue}{{u0}^{2}}\right) - \log \left(e^{\mathsf{log1p}\left(-u0\right)}\right)\right) \]
    15. add-log-exp4.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(-u0\right)}\right) \]
    16. add-sqr-sqrt-0.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{-u0} \cdot \sqrt{-u0}}\right)\right) \]
    17. sqrt-unprod89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right)\right) \]
    18. sqr-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\sqrt{\color{blue}{u0 \cdot u0}}\right)\right) \]
    19. sqrt-unprod89.1%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(\color{blue}{\sqrt{u0} \cdot \sqrt{u0}}\right)\right) \]
  6. Applied egg-rr89.3%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\log \left(1 - {u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  7. Step-by-step derivation
    1. sub-neg89.3%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\log \color{blue}{\left(1 + \left(-{u0}^{2}\right)\right)} - \mathsf{log1p}\left(u0\right)\right) \]
    2. log1p-define98.8%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\color{blue}{\mathsf{log1p}\left(-{u0}^{2}\right)} - \mathsf{log1p}\left(u0\right)\right) \]
  8. Simplified98.8%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)} \]
  9. Step-by-step derivation
    1. add-cube-cbrt97.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)} \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}\right) \cdot \sqrt[3]{\mathsf{log1p}\left(u0\right)}}\right) \]
    2. pow397.5%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  10. Applied egg-rr97.5%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{{\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}}\right) \]
  11. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - {\left(\sqrt[3]{\mathsf{log1p}\left(u0\right)}\right)}^{3}\right)\right)} \]
    2. rem-cube-cbrt98.8%

      \[\leadsto \alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \color{blue}{\mathsf{log1p}\left(u0\right)}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(\mathsf{log1p}\left(-{u0}^{2}\right) - \mathsf{log1p}\left(u0\right)\right)\right)} \]
  13. Taylor expanded in u0 around 0 86.9%

    \[\leadsto \alpha \cdot \color{blue}{\left(u0 \cdot \left(\alpha + 0.5 \cdot \left(\alpha \cdot u0\right)\right)\right)} \]
  14. Add Preprocessing

Alternative 9: 74.3% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \alpha \cdot \left(\alpha \cdot u0\right) \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(alpha * Float32(alpha * u0))
end
function tmp = code(alpha, u0)
	tmp = alpha * (alpha * u0);
end
\begin{array}{l}

\\
\alpha \cdot \left(\alpha \cdot u0\right)
\end{array}
Derivation
  1. Initial program 56.4%

    \[\left(\left(-\alpha\right) \cdot \alpha\right) \cdot \log \left(1 - u0\right) \]
  2. Step-by-step derivation
    1. *-commutative56.4%

      \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right)} \cdot \log \left(1 - u0\right) \]
    2. sub-neg56.4%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \log \color{blue}{\left(1 + \left(-u0\right)\right)} \]
    3. log1p-define99.0%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\mathsf{log1p}\left(-u0\right)} \]
  3. Simplified99.0%

    \[\leadsto \color{blue}{\left(\alpha \cdot \left(-\alpha\right)\right) \cdot \mathsf{log1p}\left(-u0\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in u0 around 0 74.2%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(-1 \cdot u0\right)} \]
  6. Step-by-step derivation
    1. mul-1-neg74.2%

      \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(-u0\right)} \]
  7. Simplified74.2%

    \[\leadsto \left(\alpha \cdot \left(-\alpha\right)\right) \cdot \color{blue}{\left(-u0\right)} \]
  8. Step-by-step derivation
    1. associate-*l*74.3%

      \[\leadsto \color{blue}{\alpha \cdot \left(\left(-\alpha\right) \cdot \left(-u0\right)\right)} \]
    2. add-sqr-sqrt-0.0%

      \[\leadsto \alpha \cdot \left(\color{blue}{\left(\sqrt{-\alpha} \cdot \sqrt{-\alpha}\right)} \cdot \left(-u0\right)\right) \]
    3. sqrt-unprod4.4%

      \[\leadsto \alpha \cdot \left(\color{blue}{\sqrt{\left(-\alpha\right) \cdot \left(-\alpha\right)}} \cdot \left(-u0\right)\right) \]
    4. sqr-neg4.4%

      \[\leadsto \alpha \cdot \left(\sqrt{\color{blue}{\alpha \cdot \alpha}} \cdot \left(-u0\right)\right) \]
    5. sqrt-prod4.4%

      \[\leadsto \alpha \cdot \left(\color{blue}{\left(\sqrt{\alpha} \cdot \sqrt{\alpha}\right)} \cdot \left(-u0\right)\right) \]
    6. add-sqr-sqrt4.4%

      \[\leadsto \alpha \cdot \left(\color{blue}{\alpha} \cdot \left(-u0\right)\right) \]
    7. add-sqr-sqrt-0.0%

      \[\leadsto \alpha \cdot \left(\alpha \cdot \color{blue}{\left(\sqrt{-u0} \cdot \sqrt{-u0}\right)}\right) \]
    8. sqrt-unprod74.3%

      \[\leadsto \alpha \cdot \left(\alpha \cdot \color{blue}{\sqrt{\left(-u0\right) \cdot \left(-u0\right)}}\right) \]
    9. sqr-neg74.3%

      \[\leadsto \alpha \cdot \left(\alpha \cdot \sqrt{\color{blue}{u0 \cdot u0}}\right) \]
    10. sqrt-prod74.0%

      \[\leadsto \alpha \cdot \left(\alpha \cdot \color{blue}{\left(\sqrt{u0} \cdot \sqrt{u0}\right)}\right) \]
    11. add-sqr-sqrt74.3%

      \[\leadsto \alpha \cdot \left(\alpha \cdot \color{blue}{u0}\right) \]
  9. Applied egg-rr74.3%

    \[\leadsto \color{blue}{\alpha \cdot \left(\alpha \cdot u0\right)} \]
  10. Add Preprocessing

Reproduce

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