Beckmann Distribution sample, tan2theta, alphax == alphay

Percentage Accurate: 55.8% → 99.0%
Time: 8.7s
Alternatives: 17
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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(4) function code(alpha, u0)
use fmin_fmax_functions
    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 17 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.8% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(4) function code(alpha, u0)
use fmin_fmax_functions
    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: 99.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 99.0% accurate, 1.0× speedup?

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

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

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

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

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

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

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

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

Alternative 3: 93.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(0.5 \cdot \alpha, \alpha, \left(\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0\right), u0, \alpha \cdot \alpha\right) \cdot u0 \end{array} \]
(FPCore (alpha u0)
 :precision binary32
 (*
  (fma
   (fma
    (* 0.5 alpha)
    alpha
    (* (* (* (fma 0.25 u0 0.3333333333333333) alpha) alpha) u0))
   u0
   (* alpha alpha))
  u0))
float code(float alpha, float u0) {
	return fmaf(fmaf((0.5f * alpha), alpha, (((fmaf(0.25f, u0, 0.3333333333333333f) * alpha) * alpha) * u0)), u0, (alpha * alpha)) * u0;
}
function code(alpha, u0)
	return Float32(fma(fma(Float32(Float32(0.5) * alpha), alpha, Float32(Float32(Float32(fma(Float32(0.25), u0, Float32(0.3333333333333333)) * alpha) * alpha) * u0)), u0, Float32(alpha * alpha)) * u0)
end
\begin{array}{l}

\\
\mathsf{fma}\left(\mathsf{fma}\left(0.5 \cdot \alpha, \alpha, \left(\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0\right), u0, \alpha \cdot \alpha\right) \cdot u0
\end{array}
Derivation
  1. Initial program 59.2%

    \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
  5. Applied rewrites90.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
  6. Taylor expanded in u0 around 0

    \[\leadsto \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0 \]
  7. Step-by-step derivation
    1. Applied rewrites91.1%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.5 \cdot \alpha, \alpha, \left(\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0\right), u0, \alpha \cdot \alpha\right) \cdot u0 \]
    2. Add Preprocessing

    Alternative 4: 93.3% accurate, 3.0× speedup?

    \[\begin{array}{l} \\ \left(\mathsf{fma}\left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \end{array} \]
    (FPCore (alpha u0)
     :precision binary32
     (*
      (*
       (fma
        (fma (* alpha (fma 0.25 u0 0.3333333333333333)) u0 (* 0.5 alpha))
        u0
        alpha)
       u0)
      alpha))
    float code(float alpha, float u0) {
    	return (fmaf(fmaf((alpha * fmaf(0.25f, u0, 0.3333333333333333f)), u0, (0.5f * alpha)), u0, alpha) * u0) * alpha;
    }
    
    function code(alpha, u0)
    	return Float32(Float32(fma(fma(Float32(alpha * fma(Float32(0.25), u0, Float32(0.3333333333333333))), u0, Float32(Float32(0.5) * alpha)), u0, alpha) * u0) * alpha)
    end
    
    \begin{array}{l}
    
    \\
    \left(\mathsf{fma}\left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha
    \end{array}
    
    Derivation
    1. Initial program 59.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

      \[\leadsto \left(u0 \cdot \left(\alpha + u0 \cdot \left(\frac{1}{2} \cdot \alpha + u0 \cdot \left(\frac{1}{4} \cdot \left(\alpha \cdot u0\right) + \frac{1}{3} \cdot \alpha\right)\right)\right)\right) \cdot \alpha \]
    7. Step-by-step derivation
      1. Applied rewrites91.1%

        \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \]
      2. Add Preprocessing

      Alternative 5: 93.3% accurate, 3.4× speedup?

      \[\begin{array}{l} \\ \left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(\mathsf{fma}\left(u0, 0.25, 0.3333333333333333\right), u0, 0.5\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \end{array} \]
      (FPCore (alpha u0)
       :precision binary32
       (*
        (* (fma (* alpha (fma (fma u0 0.25 0.3333333333333333) u0 0.5)) u0 alpha) u0)
        alpha))
      float code(float alpha, float u0) {
      	return (fmaf((alpha * fmaf(fmaf(u0, 0.25f, 0.3333333333333333f), u0, 0.5f)), u0, alpha) * u0) * alpha;
      }
      
      function code(alpha, u0)
      	return Float32(Float32(fma(Float32(alpha * fma(fma(u0, Float32(0.25), Float32(0.3333333333333333)), u0, Float32(0.5))), u0, alpha) * u0) * alpha)
      end
      
      \begin{array}{l}
      
      \\
      \left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(\mathsf{fma}\left(u0, 0.25, 0.3333333333333333\right), u0, 0.5\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha
      \end{array}
      
      Derivation
      1. Initial program 59.2%

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

        \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto \left(u0 \cdot \left(\alpha + u0 \cdot \left(\frac{1}{2} \cdot \alpha + u0 \cdot \left(\frac{1}{4} \cdot \left(\alpha \cdot u0\right) + \frac{1}{3} \cdot \alpha\right)\right)\right)\right) \cdot \alpha \]
      7. Step-by-step derivation
        1. Applied rewrites91.1%

          \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \]
        2. Step-by-step derivation
          1. Applied rewrites91.1%

            \[\leadsto \left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(\mathsf{fma}\left(u0, 0.25, 0.3333333333333333\right), u0, 0.5\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \]
          2. Add Preprocessing

          Alternative 6: 93.3% accurate, 3.4× speedup?

          \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0 \cdot u0, u0\right) \cdot \left(\alpha \cdot \alpha\right) \end{array} \]
          (FPCore (alpha u0)
           :precision binary32
           (*
            (fma (fma (fma 0.25 u0 0.3333333333333333) u0 0.5) (* u0 u0) u0)
            (* alpha alpha)))
          float code(float alpha, float u0) {
          	return fmaf(fmaf(fmaf(0.25f, u0, 0.3333333333333333f), u0, 0.5f), (u0 * u0), u0) * (alpha * alpha);
          }
          
          function code(alpha, u0)
          	return Float32(fma(fma(fma(Float32(0.25), u0, Float32(0.3333333333333333)), u0, Float32(0.5)), Float32(u0 * u0), u0) * Float32(alpha * alpha))
          end
          
          \begin{array}{l}
          
          \\
          \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0 \cdot u0, u0\right) \cdot \left(\alpha \cdot \alpha\right)
          \end{array}
          
          Derivation
          1. Initial program 59.2%

            \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

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

              \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
          5. Applied rewrites90.7%

            \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
          6. Taylor expanded in alpha around 0

            \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites90.7%

              \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), 1\right) \cdot \color{blue}{\left(\left(\alpha \cdot \alpha\right) \cdot u0\right)} \]
            2. Taylor expanded in alpha around 0

              \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites91.0%

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0 \cdot u0, u0\right) \cdot \color{blue}{\left(\alpha \cdot \alpha\right)} \]
              2. Add Preprocessing

              Alternative 7: 93.0% accurate, 3.4× speedup?

              \[\begin{array}{l} \\ \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \alpha\right) \end{array} \]
              (FPCore (alpha u0)
               :precision binary32
               (*
                (* (fma (fma (fma 0.25 u0 0.3333333333333333) u0 0.5) u0 1.0) alpha)
                (* u0 alpha)))
              float code(float alpha, float u0) {
              	return (fmaf(fmaf(fmaf(0.25f, u0, 0.3333333333333333f), u0, 0.5f), u0, 1.0f) * alpha) * (u0 * alpha);
              }
              
              function code(alpha, u0)
              	return Float32(Float32(fma(fma(fma(Float32(0.25), u0, Float32(0.3333333333333333)), u0, Float32(0.5)), u0, Float32(1.0)) * alpha) * Float32(u0 * alpha))
              end
              
              \begin{array}{l}
              
              \\
              \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \alpha\right)
              \end{array}
              
              Derivation
              1. Initial program 59.2%

                \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

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

                  \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
              5. Applied rewrites90.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
              6. Taylor expanded in alpha around 0

                \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
              7. Step-by-step derivation
                1. Applied rewrites90.7%

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

                    \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \color{blue}{\alpha}\right) \]
                  2. Add Preprocessing

                  Alternative 8: 93.1% accurate, 3.4× speedup?

                  \[\begin{array}{l} \\ \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0 \end{array} \]
                  (FPCore (alpha u0)
                   :precision binary32
                   (*
                    (*
                     (* (fma (fma (fma 0.25 u0 0.3333333333333333) u0 0.5) u0 1.0) alpha)
                     alpha)
                    u0))
                  float code(float alpha, float u0) {
                  	return ((fmaf(fmaf(fmaf(0.25f, u0, 0.3333333333333333f), u0, 0.5f), u0, 1.0f) * alpha) * alpha) * u0;
                  }
                  
                  function code(alpha, u0)
                  	return Float32(Float32(Float32(fma(fma(fma(Float32(0.25), u0, Float32(0.3333333333333333)), u0, Float32(0.5)), u0, Float32(1.0)) * alpha) * alpha) * u0)
                  end
                  
                  \begin{array}{l}
                  
                  \\
                  \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0
                  \end{array}
                  
                  Derivation
                  1. Initial program 59.2%

                    \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

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

                      \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
                  5. Applied rewrites90.7%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
                  6. Taylor expanded in alpha around 0

                    \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
                  7. Step-by-step derivation
                    1. Applied rewrites90.7%

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

                        \[\leadsto \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \alpha\right) \cdot u0 \]
                      2. Add Preprocessing

                      Alternative 9: 91.3% accurate, 3.5× speedup?

                      \[\begin{array}{l} \\ \mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, \alpha \cdot \alpha\right) \cdot u0 \end{array} \]
                      (FPCore (alpha u0)
                       :precision binary32
                       (*
                        (fma (* (* alpha alpha) (fma 0.3333333333333333 u0 0.5)) u0 (* alpha alpha))
                        u0))
                      float code(float alpha, float u0) {
                      	return fmaf(((alpha * alpha) * fmaf(0.3333333333333333f, u0, 0.5f)), u0, (alpha * alpha)) * u0;
                      }
                      
                      function code(alpha, u0)
                      	return Float32(fma(Float32(Float32(alpha * alpha) * fma(Float32(0.3333333333333333), u0, Float32(0.5))), u0, Float32(alpha * alpha)) * u0)
                      end
                      
                      \begin{array}{l}
                      
                      \\
                      \mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, \alpha \cdot \alpha\right) \cdot u0
                      \end{array}
                      
                      Derivation
                      1. Initial program 59.2%

                        \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right) + {\alpha}^{2}\right)} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

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

                          \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{3} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{2} \cdot {\alpha}^{2}\right) + {\alpha}^{2}\right) \cdot u0} \]
                      5. Applied rewrites89.0%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, \alpha \cdot \alpha\right) \cdot u0} \]
                      6. Add Preprocessing

                      Alternative 10: 91.3% accurate, 3.5× speedup?

                      \[\begin{array}{l} \\ \left(\mathsf{fma}\left(\mathsf{fma}\left(u0 \cdot \alpha, 0.3333333333333333, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \end{array} \]
                      (FPCore (alpha u0)
                       :precision binary32
                       (*
                        (* (fma (fma (* u0 alpha) 0.3333333333333333 (* 0.5 alpha)) u0 alpha) u0)
                        alpha))
                      float code(float alpha, float u0) {
                      	return (fmaf(fmaf((u0 * alpha), 0.3333333333333333f, (0.5f * alpha)), u0, alpha) * u0) * alpha;
                      }
                      
                      function code(alpha, u0)
                      	return Float32(Float32(fma(fma(Float32(u0 * alpha), Float32(0.3333333333333333), Float32(Float32(0.5) * alpha)), u0, alpha) * u0) * alpha)
                      end
                      
                      \begin{array}{l}
                      
                      \\
                      \left(\mathsf{fma}\left(\mathsf{fma}\left(u0 \cdot \alpha, 0.3333333333333333, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha
                      \end{array}
                      
                      Derivation
                      1. Initial program 59.2%

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

                        \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

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

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

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

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

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

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

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

                        \[\leadsto \left(u0 \cdot \left(\alpha + u0 \cdot \left(\frac{1}{3} \cdot \left(\alpha \cdot u0\right) + \frac{1}{2} \cdot \alpha\right)\right)\right) \cdot \alpha \]
                      7. Step-by-step derivation
                        1. Applied rewrites89.0%

                          \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(u0 \cdot \alpha, 0.3333333333333333, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \]
                        2. Add Preprocessing

                        Alternative 11: 91.1% accurate, 4.1× speedup?

                        \[\begin{array}{l} \\ \mathsf{fma}\left(u0, \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), 1\right) \cdot \left(\left(u0 \cdot \alpha\right) \cdot \alpha\right) \end{array} \]
                        (FPCore (alpha u0)
                         :precision binary32
                         (* (fma u0 (fma 0.3333333333333333 u0 0.5) 1.0) (* (* u0 alpha) alpha)))
                        float code(float alpha, float u0) {
                        	return fmaf(u0, fmaf(0.3333333333333333f, u0, 0.5f), 1.0f) * ((u0 * alpha) * alpha);
                        }
                        
                        function code(alpha, u0)
                        	return Float32(fma(u0, fma(Float32(0.3333333333333333), u0, Float32(0.5)), Float32(1.0)) * Float32(Float32(u0 * alpha) * alpha))
                        end
                        
                        \begin{array}{l}
                        
                        \\
                        \mathsf{fma}\left(u0, \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), 1\right) \cdot \left(\left(u0 \cdot \alpha\right) \cdot \alpha\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 59.2%

                          \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

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

                            \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
                        5. Applied rewrites90.7%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
                        6. Taylor expanded in alpha around 0

                          \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites90.7%

                            \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), 1\right) \cdot \color{blue}{\left(\left(\alpha \cdot \alpha\right) \cdot u0\right)} \]
                          2. Taylor expanded in u0 around 0

                            \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(\frac{1}{3}, u0, \frac{1}{2}\right), 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites88.6%

                              \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites88.7%

                                \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), 1\right) \cdot \left(\left(u0 \cdot \alpha\right) \cdot \alpha\right) \]
                              2. Add Preprocessing

                              Alternative 12: 91.1% accurate, 4.1× speedup?

                              \[\begin{array}{l} \\ \alpha \cdot \left(\left(u0 \cdot \alpha\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, 1\right)\right) \end{array} \]
                              (FPCore (alpha u0)
                               :precision binary32
                               (* alpha (* (* u0 alpha) (fma (fma 0.3333333333333333 u0 0.5) u0 1.0))))
                              float code(float alpha, float u0) {
                              	return alpha * ((u0 * alpha) * fmaf(fmaf(0.3333333333333333f, u0, 0.5f), u0, 1.0f));
                              }
                              
                              function code(alpha, u0)
                              	return Float32(alpha * Float32(Float32(u0 * alpha) * fma(fma(Float32(0.3333333333333333), u0, Float32(0.5)), u0, Float32(1.0))))
                              end
                              
                              \begin{array}{l}
                              
                              \\
                              \alpha \cdot \left(\left(u0 \cdot \alpha\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, 1\right)\right)
                              \end{array}
                              
                              Derivation
                              1. Initial program 59.2%

                                \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

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

                                  \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
                              5. Applied rewrites90.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
                              6. Taylor expanded in alpha around 0

                                \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites90.7%

                                  \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), 1\right) \cdot \color{blue}{\left(\left(\alpha \cdot \alpha\right) \cdot u0\right)} \]
                                2. Taylor expanded in u0 around 0

                                  \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(\frac{1}{3}, u0, \frac{1}{2}\right), 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites88.6%

                                    \[\leadsto \mathsf{fma}\left(u0, \mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), 1\right) \cdot \left(\left(\alpha \cdot \alpha\right) \cdot u0\right) \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites88.7%

                                      \[\leadsto \alpha \cdot \left(\left(u0 \cdot \alpha\right) \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, u0, 0.5\right), u0, 1\right)}\right) \]
                                    2. Add Preprocessing

                                    Alternative 13: 87.3% accurate, 4.3× speedup?

                                    \[\begin{array}{l} \\ \mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot u0, 0.5, \alpha \cdot \alpha\right) \cdot u0 \end{array} \]
                                    (FPCore (alpha u0)
                                     :precision binary32
                                     (* (fma (* (* alpha alpha) u0) 0.5 (* alpha alpha)) u0))
                                    float code(float alpha, float u0) {
                                    	return fmaf(((alpha * alpha) * u0), 0.5f, (alpha * alpha)) * u0;
                                    }
                                    
                                    function code(alpha, u0)
                                    	return Float32(fma(Float32(Float32(alpha * alpha) * u0), Float32(0.5), Float32(alpha * alpha)) * u0)
                                    end
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot u0, 0.5, \alpha \cdot \alpha\right) \cdot u0
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 59.2%

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

                                      \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
                                    4. Step-by-step derivation
                                      1. mul-1-negN/A

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

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

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

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

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

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

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

                                      \[\leadsto \left(u0 \cdot \left(\alpha + u0 \cdot \left(\frac{1}{2} \cdot \alpha + u0 \cdot \left(\frac{1}{4} \cdot \left(\alpha \cdot u0\right) + \frac{1}{3} \cdot \alpha\right)\right)\right)\right) \cdot \alpha \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites91.1%

                                        \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\alpha \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5 \cdot \alpha\right), u0, \alpha\right) \cdot u0\right) \cdot \alpha \]
                                      2. 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)} \]
                                      3. Step-by-step derivation
                                        1. *-commutativeN/A

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

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

                                          \[\leadsto \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) + \color{blue}{\alpha \cdot \alpha}\right) \cdot u0 \]
                                        4. fp-cancel-sign-sub-invN/A

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

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

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

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

                                          \[\leadsto \left(\frac{1}{2} \cdot \left({\alpha}^{2} \cdot u0\right) - \color{blue}{{\alpha}^{2} \cdot -1}\right) \cdot u0 \]
                                        9. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot u0, 0.5, \color{blue}{\alpha \cdot \alpha}\right) \cdot u0 \]
                                      4. Applied rewrites84.5%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\alpha \cdot \alpha\right) \cdot u0, 0.5, \alpha \cdot \alpha\right) \cdot u0} \]
                                      5. Add Preprocessing

                                      Alternative 14: 87.2% accurate, 5.3× speedup?

                                      \[\begin{array}{l} \\ \left(\mathsf{fma}\left(u0 \cdot \alpha, 0.5, \alpha\right) \cdot u0\right) \cdot \alpha \end{array} \]
                                      (FPCore (alpha u0)
                                       :precision binary32
                                       (* (* (fma (* u0 alpha) 0.5 alpha) u0) alpha))
                                      float code(float alpha, float u0) {
                                      	return (fmaf((u0 * alpha), 0.5f, alpha) * u0) * alpha;
                                      }
                                      
                                      function code(alpha, u0)
                                      	return Float32(Float32(fma(Float32(u0 * alpha), Float32(0.5), alpha) * u0) * alpha)
                                      end
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \left(\mathsf{fma}\left(u0 \cdot \alpha, 0.5, \alpha\right) \cdot u0\right) \cdot \alpha
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 59.2%

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

                                        \[\leadsto \color{blue}{-1 \cdot \left({\alpha}^{2} \cdot \log \left(1 - u0\right)\right)} \]
                                      4. Step-by-step derivation
                                        1. mul-1-negN/A

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

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

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

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

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

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

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

                                        \[\leadsto \left(u0 \cdot \left(\alpha + \frac{1}{2} \cdot \left(\alpha \cdot u0\right)\right)\right) \cdot \alpha \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites84.5%

                                          \[\leadsto \left(\mathsf{fma}\left(u0 \cdot \alpha, 0.5, \alpha\right) \cdot u0\right) \cdot \alpha \]
                                        2. Add Preprocessing

                                        Alternative 15: 87.1% accurate, 5.3× speedup?

                                        \[\begin{array}{l} \\ \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \alpha\right) \end{array} \]
                                        (FPCore (alpha u0)
                                         :precision binary32
                                         (* (* (fma 0.5 u0 1.0) alpha) (* u0 alpha)))
                                        float code(float alpha, float u0) {
                                        	return (fmaf(0.5f, u0, 1.0f) * alpha) * (u0 * alpha);
                                        }
                                        
                                        function code(alpha, u0)
                                        	return Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * alpha) * Float32(u0 * alpha))
                                        end
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \alpha\right)
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 59.2%

                                          \[\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}{u0 \cdot \left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right)} \]
                                        4. Step-by-step derivation
                                          1. *-commutativeN/A

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

                                            \[\leadsto \color{blue}{\left(u0 \cdot \left(\frac{1}{2} \cdot {\alpha}^{2} + u0 \cdot \left(\frac{1}{4} \cdot \left({\alpha}^{2} \cdot u0\right) + \frac{1}{3} \cdot {\alpha}^{2}\right)\right) + {\alpha}^{2}\right) \cdot u0} \]
                                        5. Applied rewrites90.7%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(u0 \cdot u0, \left(\alpha \cdot \alpha\right) \cdot \mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), \mathsf{fma}\left(0.5, u0, 1\right) \cdot \left(\alpha \cdot \alpha\right)\right) \cdot u0} \]
                                        6. Taylor expanded in alpha around 0

                                          \[\leadsto {\alpha}^{2} \cdot \color{blue}{\left(u0 \cdot \left(1 + \left(\frac{1}{2} \cdot u0 + {u0}^{2} \cdot \left(\frac{1}{3} + \frac{1}{4} \cdot u0\right)\right)\right)\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites90.7%

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

                                              \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.25, u0, 0.3333333333333333\right), u0, 0.5\right), u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \color{blue}{\alpha}\right) \]
                                            2. Taylor expanded in u0 around 0

                                              \[\leadsto \left(\alpha + \frac{1}{2} \cdot \left(\alpha \cdot u0\right)\right) \cdot \left(u0 \cdot \alpha\right) \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites84.3%

                                                \[\leadsto \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot \alpha\right) \cdot \left(u0 \cdot \alpha\right) \]
                                              2. Add Preprocessing

                                              Alternative 16: 74.6% accurate, 10.5× speedup?

                                              \[\begin{array}{l} \\ \left(u0 \cdot \alpha\right) \cdot \alpha \end{array} \]
                                              (FPCore (alpha u0) :precision binary32 (* (* u0 alpha) alpha))
                                              float code(float alpha, float u0) {
                                              	return (u0 * alpha) * alpha;
                                              }
                                              
                                              module fmin_fmax_functions
                                                  implicit none
                                                  private
                                                  public fmax
                                                  public fmin
                                              
                                                  interface fmax
                                                      module procedure fmax88
                                                      module procedure fmax44
                                                      module procedure fmax84
                                                      module procedure fmax48
                                                  end interface
                                                  interface fmin
                                                      module procedure fmin88
                                                      module procedure fmin44
                                                      module procedure fmin84
                                                      module procedure fmin48
                                                  end interface
                                              contains
                                                  real(8) function fmax88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmax44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmin44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                  end function
                                              end module
                                              
                                              real(4) function code(alpha, u0)
                                              use fmin_fmax_functions
                                                  real(4), intent (in) :: alpha
                                                  real(4), intent (in) :: u0
                                                  code = (u0 * alpha) * alpha
                                              end function
                                              
                                              function code(alpha, u0)
                                              	return Float32(Float32(u0 * alpha) * alpha)
                                              end
                                              
                                              function tmp = code(alpha, u0)
                                              	tmp = (u0 * alpha) * alpha;
                                              end
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \left(u0 \cdot \alpha\right) \cdot \alpha
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 59.2%

                                                \[\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. lower-*.f32N/A

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

                                                  \[\leadsto \color{blue}{\left(\alpha \cdot \alpha\right)} \cdot u0 \]
                                                3. lower-*.f3271.6

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

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

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

                                                Alternative 17: 74.6% 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;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(4) function code(alpha, u0)
                                                use fmin_fmax_functions
                                                    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 59.2%

                                                  \[\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. lower-*.f32N/A

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

                                                    \[\leadsto \color{blue}{\left(\alpha \cdot \alpha\right)} \cdot u0 \]
                                                  3. lower-*.f3271.6

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

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

                                                Reproduce

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