Beckmann Distribution sample, tan2theta, alphax != alphay, u1 <= 0.5

Percentage Accurate: 60.4% → 98.6%
Time: 10.3s
Alternatives: 30
Speedup: 1.4×

Specification

?
\[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
\[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
  :precision binary32
  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
     (<= 0.0 sin2phi))
  (/
 (- (log (- 1.0 u0)))
 (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return -logf((1.0f - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
    real(4), intent (in) :: alphax
    real(4), intent (in) :: alphay
    real(4), intent (in) :: u0
    real(4), intent (in) :: cos2phi
    real(4), intent (in) :: sin2phi
    code = -log((1.0e0 - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(-log(Float32(Float32(1.0) - u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = -log((single(1.0) - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
end
\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}

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 30 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: 60.4% accurate, 1.0× speedup?

\[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
\[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
  :precision binary32
  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
     (<= 0.0 sin2phi))
  (/
 (- (log (- 1.0 u0)))
 (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return -logf((1.0f - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
    real(4), intent (in) :: alphax
    real(4), intent (in) :: alphay
    real(4), intent (in) :: u0
    real(4), intent (in) :: cos2phi
    real(4), intent (in) :: sin2phi
    code = -log((1.0e0 - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(-log(Float32(Float32(1.0) - u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = -log((single(1.0) - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
end
\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}

Alternative 1: 98.6% accurate, 0.9× speedup?

\[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
\[\frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
  :precision binary32
  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
     (<= 0.0 sin2phi))
  (/
 (* alphay (- (log1p (- u0))))
 (fma cos2phi (/ alphay (* alphax alphax)) (/ sin2phi alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return (alphay * -log1pf(-u0)) / fmaf(cos2phi, (alphay / (alphax * alphax)), (sin2phi / alphay));
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(alphay * Float32(-log1p(Float32(-u0)))) / fma(cos2phi, Float32(alphay / Float32(alphax * alphax)), Float32(sin2phi / alphay)))
end
\frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)}
Derivation
  1. Initial program 60.4%

    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  2. Step-by-step derivation
    1. Applied rewrites60.8%

      \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
    2. Step-by-step derivation
      1. Applied rewrites60.8%

        \[\leadsto \frac{alphay \cdot \left(-\log \left(1 - u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
      2. Step-by-step derivation
        1. Applied rewrites98.6%

          \[\leadsto \frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
        2. Step-by-step derivation
          1. Applied rewrites98.6%

            \[\leadsto \frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
          2. Add Preprocessing

          Alternative 2: 98.6% accurate, 0.9× speedup?

          \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
          \[\frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
          (FPCore (alphax alphay u0 cos2phi sin2phi)
            :precision binary32
            :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                              (and (<= 0.0001 alphay) (<= alphay 1.0)))
                         (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                    (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
               (<= 0.0 sin2phi))
            (/
           (* alphay (- (log1p (- u0))))
           (fma alphay (/ cos2phi (* alphax alphax)) (/ sin2phi alphay))))
          float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
          	return (alphay * -log1pf(-u0)) / fmaf(alphay, (cos2phi / (alphax * alphax)), (sin2phi / alphay));
          }
          
          function code(alphax, alphay, u0, cos2phi, sin2phi)
          	return Float32(Float32(alphay * Float32(-log1p(Float32(-u0)))) / fma(alphay, Float32(cos2phi / Float32(alphax * alphax)), Float32(sin2phi / alphay)))
          end
          
          \frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)}
          
          Derivation
          1. Initial program 60.4%

            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
          2. Step-by-step derivation
            1. Applied rewrites60.8%

              \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
            2. Step-by-step derivation
              1. Applied rewrites60.8%

                \[\leadsto \frac{alphay \cdot \left(-\log \left(1 - u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
              2. Step-by-step derivation
                1. Applied rewrites98.6%

                  \[\leadsto \frac{alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
                2. Add Preprocessing

                Alternative 3: 98.2% accurate, 0.9× speedup?

                \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                \[\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]
                (FPCore (alphax alphay u0 cos2phi sin2phi)
                  :precision binary32
                  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
                               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                     (<= 0.0 sin2phi))
                  (/
                 (- (log1p (- u0)))
                 (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
                float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                	return -log1pf(-u0) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
                }
                
                function code(alphax, alphay, u0, cos2phi, sin2phi)
                	return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay)))
                end
                
                \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
                
                Derivation
                1. Initial program 60.4%

                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                2. Step-by-step derivation
                  1. Applied rewrites98.2%

                    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites98.2%

                      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]
                    2. Add Preprocessing

                    Alternative 4: 98.2% accurate, 0.9× speedup?

                    \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                    \[\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                    (FPCore (alphax alphay u0 cos2phi sin2phi)
                      :precision binary32
                      :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                        (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                   (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                              (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                         (<= 0.0 sin2phi))
                      (/
                     (- (log1p (- u0)))
                     (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
                    float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                    	return -log1pf(-u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
                    }
                    
                    function code(alphax, alphay, u0, cos2phi, sin2phi)
                    	return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))))
                    end
                    
                    \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
                    
                    Derivation
                    1. Initial program 60.4%

                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                    2. Step-by-step derivation
                      1. Applied rewrites98.2%

                        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                      2. Add Preprocessing

                      Alternative 5: 96.6% accurate, 0.8× speedup?

                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                      \[\begin{array}{l} t_0 := \frac{cos2phi}{alphax \cdot alphax}\\ \mathbf{if}\;1 - u0 \leq 0.9975000023841858:\\ \;\;\;\;\frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, t\_0, \frac{sin2phi}{alphay}\right)} \cdot alphay\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{t\_0 + \frac{\frac{sin2phi}{alphay}}{alphay}}\\ \end{array} \]
                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                        :precision binary32
                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                           (<= 0.0 sin2phi))
                        (let* ((t_0 (/ cos2phi (* alphax alphax))))
                        (if (<= (- 1.0 u0) 0.9975000023841858)
                          (*
                           (/ (- (log (- 1.0 u0))) (fma alphay t_0 (/ sin2phi alphay)))
                           alphay)
                          (/ (fma u0 (* 0.5 u0) u0) (+ t_0 (/ (/ sin2phi alphay) alphay))))))
                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                      	float t_0 = cos2phi / (alphax * alphax);
                      	float tmp;
                      	if ((1.0f - u0) <= 0.9975000023841858f) {
                      		tmp = (-logf((1.0f - u0)) / fmaf(alphay, t_0, (sin2phi / alphay))) * alphay;
                      	} else {
                      		tmp = fmaf(u0, (0.5f * u0), u0) / (t_0 + ((sin2phi / alphay) / alphay));
                      	}
                      	return tmp;
                      }
                      
                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                      	t_0 = Float32(cos2phi / Float32(alphax * alphax))
                      	tmp = Float32(0.0)
                      	if (Float32(Float32(1.0) - u0) <= Float32(0.9975000023841858))
                      		tmp = Float32(Float32(Float32(-log(Float32(Float32(1.0) - u0))) / fma(alphay, t_0, Float32(sin2phi / alphay))) * alphay);
                      	else
                      		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(t_0 + Float32(Float32(sin2phi / alphay) / alphay)));
                      	end
                      	return tmp
                      end
                      
                      \begin{array}{l}
                      t_0 := \frac{cos2phi}{alphax \cdot alphax}\\
                      \mathbf{if}\;1 - u0 \leq 0.9975000023841858:\\
                      \;\;\;\;\frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, t\_0, \frac{sin2phi}{alphay}\right)} \cdot alphay\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{t\_0 + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (-.f32 #s(literal 1 binary32) u0) < 0.997500002

                        1. Initial program 60.4%

                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                        2. Step-by-step derivation
                          1. Applied rewrites60.8%

                            \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                          2. Step-by-step derivation
                            1. Applied rewrites60.8%

                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]

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

                            1. Initial program 60.4%

                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                            2. Taylor expanded in u0 around 0

                              \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                            3. Step-by-step derivation
                              1. Applied rewrites87.0%

                                \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites87.1%

                                  \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites87.1%

                                    \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]
                                3. Recombined 2 regimes into one program.
                                4. Add Preprocessing

                                Alternative 6: 96.6% accurate, 0.7× speedup?

                                \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                \[\begin{array}{l} t_0 := -\log \left(1 - u0\right)\\ \mathbf{if}\;t\_0 \leq 0.0024999999441206455:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{alphay}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)}\\ \end{array} \]
                                (FPCore (alphax alphay u0 cos2phi sin2phi)
                                  :precision binary32
                                  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                     (<= 0.0 sin2phi))
                                  (let* ((t_0 (- (log (- 1.0 u0)))))
                                  (if (<= t_0 0.0024999999441206455)
                                    (/
                                     (fma u0 (* 0.5 u0) u0)
                                     (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay)))
                                    (*
                                     t_0
                                     (/
                                      alphay
                                      (fma
                                       cos2phi
                                       (/ alphay (* alphax alphax))
                                       (/ sin2phi alphay)))))))
                                float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                	float t_0 = -logf((1.0f - u0));
                                	float tmp;
                                	if (t_0 <= 0.0024999999441206455f) {
                                		tmp = fmaf(u0, (0.5f * u0), u0) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
                                	} else {
                                		tmp = t_0 * (alphay / fmaf(cos2phi, (alphay / (alphax * alphax)), (sin2phi / alphay)));
                                	}
                                	return tmp;
                                }
                                
                                function code(alphax, alphay, u0, cos2phi, sin2phi)
                                	t_0 = Float32(-log(Float32(Float32(1.0) - u0)))
                                	tmp = Float32(0.0)
                                	if (t_0 <= Float32(0.0024999999441206455))
                                		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay)));
                                	else
                                		tmp = Float32(t_0 * Float32(alphay / fma(cos2phi, Float32(alphay / Float32(alphax * alphax)), Float32(sin2phi / alphay))));
                                	end
                                	return tmp
                                end
                                
                                \begin{array}{l}
                                t_0 := -\log \left(1 - u0\right)\\
                                \mathbf{if}\;t\_0 \leq 0.0024999999441206455:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0 \cdot \frac{alphay}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)}\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if (neg.f32 (log.f32 (-.f32 #s(literal 1 binary32) u0))) < 0.00249999994

                                  1. Initial program 60.4%

                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                  2. Taylor expanded in u0 around 0

                                    \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites87.0%

                                      \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites87.1%

                                        \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites87.1%

                                          \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]

                                        if 0.00249999994 < (neg.f32 (log.f32 (-.f32 #s(literal 1 binary32) u0)))

                                        1. Initial program 60.4%

                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites60.8%

                                            \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites60.8%

                                              \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(cos2phi, \frac{alphay}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \]
                                          3. Recombined 2 regimes into one program.
                                          4. Add Preprocessing

                                          Alternative 7: 96.2% accurate, 0.7× speedup?

                                          \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                          \[\begin{array}{l} t_0 := -\log \left(1 - u0\right)\\ \mathbf{if}\;t\_0 \leq 0.0024999999441206455:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\ \end{array} \]
                                          (FPCore (alphax alphay u0 cos2phi sin2phi)
                                            :precision binary32
                                            :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                              (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                         (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                    (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                               (<= 0.0 sin2phi))
                                            (let* ((t_0 (- (log (- 1.0 u0)))))
                                            (if (<= t_0 0.0024999999441206455)
                                              (/
                                               (fma u0 (* 0.5 u0) u0)
                                               (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay)))
                                              (/
                                               t_0
                                               (+
                                                (/ (/ cos2phi alphax) alphax)
                                                (/ sin2phi (* alphay alphay)))))))
                                          float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                          	float t_0 = -logf((1.0f - u0));
                                          	float tmp;
                                          	if (t_0 <= 0.0024999999441206455f) {
                                          		tmp = fmaf(u0, (0.5f * u0), u0) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
                                          	} else {
                                          		tmp = t_0 / (((cos2phi / alphax) / alphax) + (sin2phi / (alphay * alphay)));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(alphax, alphay, u0, cos2phi, sin2phi)
                                          	t_0 = Float32(-log(Float32(Float32(1.0) - u0)))
                                          	tmp = Float32(0.0)
                                          	if (t_0 <= Float32(0.0024999999441206455))
                                          		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay)));
                                          	else
                                          		tmp = Float32(t_0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32(sin2phi / Float32(alphay * alphay))));
                                          	end
                                          	return tmp
                                          end
                                          
                                          \begin{array}{l}
                                          t_0 := -\log \left(1 - u0\right)\\
                                          \mathbf{if}\;t\_0 \leq 0.0024999999441206455:\\
                                          \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{t\_0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if (neg.f32 (log.f32 (-.f32 #s(literal 1 binary32) u0))) < 0.00249999994

                                            1. Initial program 60.4%

                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                            2. Taylor expanded in u0 around 0

                                              \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites87.0%

                                                \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites87.1%

                                                  \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites87.1%

                                                    \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]

                                                  if 0.00249999994 < (neg.f32 (log.f32 (-.f32 #s(literal 1 binary32) u0)))

                                                  1. Initial program 60.4%

                                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites60.4%

                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                  3. Recombined 2 regimes into one program.
                                                  4. Add Preprocessing

                                                  Alternative 8: 96.2% accurate, 0.8× speedup?

                                                  \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                  \[\begin{array}{l} t_0 := \frac{cos2phi}{alphax \cdot alphax}\\ \mathbf{if}\;1 - u0 \leq 0.9975000023841858:\\ \;\;\;\;\frac{-\log \left(1 - u0\right)}{t\_0 + \frac{sin2phi}{alphay \cdot alphay}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{t\_0 + \frac{\frac{sin2phi}{alphay}}{alphay}}\\ \end{array} \]
                                                  (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                    :precision binary32
                                                    :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                      (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                 (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                            (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                       (<= 0.0 sin2phi))
                                                    (let* ((t_0 (/ cos2phi (* alphax alphax))))
                                                    (if (<= (- 1.0 u0) 0.9975000023841858)
                                                      (/ (- (log (- 1.0 u0))) (+ t_0 (/ sin2phi (* alphay alphay))))
                                                      (/ (fma u0 (* 0.5 u0) u0) (+ t_0 (/ (/ sin2phi alphay) alphay))))))
                                                  float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                  	float t_0 = cos2phi / (alphax * alphax);
                                                  	float tmp;
                                                  	if ((1.0f - u0) <= 0.9975000023841858f) {
                                                  		tmp = -logf((1.0f - u0)) / (t_0 + (sin2phi / (alphay * alphay)));
                                                  	} else {
                                                  		tmp = fmaf(u0, (0.5f * u0), u0) / (t_0 + ((sin2phi / alphay) / alphay));
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                  	t_0 = Float32(cos2phi / Float32(alphax * alphax))
                                                  	tmp = Float32(0.0)
                                                  	if (Float32(Float32(1.0) - u0) <= Float32(0.9975000023841858))
                                                  		tmp = Float32(Float32(-log(Float32(Float32(1.0) - u0))) / Float32(t_0 + Float32(sin2phi / Float32(alphay * alphay))));
                                                  	else
                                                  		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(t_0 + Float32(Float32(sin2phi / alphay) / alphay)));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  \begin{array}{l}
                                                  t_0 := \frac{cos2phi}{alphax \cdot alphax}\\
                                                  \mathbf{if}\;1 - u0 \leq 0.9975000023841858:\\
                                                  \;\;\;\;\frac{-\log \left(1 - u0\right)}{t\_0 + \frac{sin2phi}{alphay \cdot alphay}}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{t\_0 + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
                                                  
                                                  
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if (-.f32 #s(literal 1 binary32) u0) < 0.997500002

                                                    1. Initial program 60.4%

                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]

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

                                                    1. Initial program 60.4%

                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                    2. Taylor expanded in u0 around 0

                                                      \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites87.0%

                                                        \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites87.1%

                                                          \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites87.1%

                                                            \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]
                                                        3. Recombined 2 regimes into one program.
                                                        4. Add Preprocessing

                                                        Alternative 9: 92.6% accurate, 0.8× speedup?

                                                        \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                        \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 120000:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                        (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                          :precision binary32
                                                          :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                            (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                       (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                  (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                             (<= 0.0 sin2phi))
                                                          (if (<= (/ sin2phi (* alphay alphay)) 120000.0)
                                                          (/
                                                           (fma u0 (* 0.5 u0) u0)
                                                           (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay)))
                                                          (* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay)))
                                                        float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                        	float tmp;
                                                        	if ((sin2phi / (alphay * alphay)) <= 120000.0f) {
                                                        		tmp = fmaf(u0, (0.5f * u0), u0) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
                                                        	} else {
                                                        		tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                        	tmp = Float32(0.0)
                                                        	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(120000.0))
                                                        		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay)));
                                                        	else
                                                        		tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        \begin{array}{l}
                                                        \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 120000:\\
                                                        \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                        
                                                        
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.2e5

                                                          1. Initial program 60.4%

                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                          2. Taylor expanded in u0 around 0

                                                            \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites87.0%

                                                              \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites87.1%

                                                                \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                              2. Step-by-step derivation
                                                                1. Applied rewrites87.1%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}} \]

                                                                if 1.2e5 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                1. Initial program 60.4%

                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites61.0%

                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                  2. Taylor expanded in alphax around inf

                                                                    \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites49.1%

                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                    2. Step-by-step derivation
                                                                      1. Applied rewrites49.1%

                                                                        \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites74.5%

                                                                          \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                      3. Recombined 2 regimes into one program.
                                                                      4. Add Preprocessing

                                                                      Alternative 10: 92.6% accurate, 0.8× speedup?

                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                      \[\begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t\_0 \leq 120000:\\ \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                        :precision binary32
                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                           (<= 0.0 sin2phi))
                                                                        (let* ((t_0 (/ sin2phi (* alphay alphay))))
                                                                        (if (<= t_0 120000.0)
                                                                          (/ (fma u0 (* 0.5 u0) u0) (+ (/ cos2phi (* alphax alphax)) t_0))
                                                                          (* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay))))
                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                      	float t_0 = sin2phi / (alphay * alphay);
                                                                      	float tmp;
                                                                      	if (t_0 <= 120000.0f) {
                                                                      		tmp = fmaf(u0, (0.5f * u0), u0) / ((cos2phi / (alphax * alphax)) + t_0);
                                                                      	} else {
                                                                      		tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                      	t_0 = Float32(sin2phi / Float32(alphay * alphay))
                                                                      	tmp = Float32(0.0)
                                                                      	if (t_0 <= Float32(120000.0))
                                                                      		tmp = Float32(fma(u0, Float32(Float32(0.5) * u0), u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + t_0));
                                                                      	else
                                                                      		tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      \begin{array}{l}
                                                                      t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
                                                                      \mathbf{if}\;t\_0 \leq 120000:\\
                                                                      \;\;\;\;\frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 2 regimes
                                                                      2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.2e5

                                                                        1. Initial program 60.4%

                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                        2. Taylor expanded in u0 around 0

                                                                          \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites87.0%

                                                                            \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                          2. Step-by-step derivation
                                                                            1. Applied rewrites87.1%

                                                                              \[\leadsto \frac{\mathsf{fma}\left(u0, 0.5 \cdot u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]

                                                                            if 1.2e5 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                            1. Initial program 60.4%

                                                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                            2. Step-by-step derivation
                                                                              1. Applied rewrites61.0%

                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                              2. Taylor expanded in alphax around inf

                                                                                \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites49.1%

                                                                                  \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                2. Step-by-step derivation
                                                                                  1. Applied rewrites49.1%

                                                                                    \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                  2. Step-by-step derivation
                                                                                    1. Applied rewrites74.5%

                                                                                      \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                  3. Recombined 2 regimes into one program.
                                                                                  4. Add Preprocessing

                                                                                  Alternative 11: 92.6% accurate, 0.8× speedup?

                                                                                  \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                  \[\begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t\_0 \leq 120000:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{t\_0 + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                  (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                    :precision binary32
                                                                                    :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                      (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                 (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                            (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                       (<= 0.0 sin2phi))
                                                                                    (let* ((t_0 (/ sin2phi (* alphay alphay))))
                                                                                    (if (<= t_0 120000.0)
                                                                                      (/ (* (fma 0.5 u0 1.0) u0) (+ t_0 (/ cos2phi (* alphax alphax))))
                                                                                      (* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay))))
                                                                                  float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                  	float t_0 = sin2phi / (alphay * alphay);
                                                                                  	float tmp;
                                                                                  	if (t_0 <= 120000.0f) {
                                                                                  		tmp = (fmaf(0.5f, u0, 1.0f) * u0) / (t_0 + (cos2phi / (alphax * alphax)));
                                                                                  	} else {
                                                                                  		tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                  	t_0 = Float32(sin2phi / Float32(alphay * alphay))
                                                                                  	tmp = Float32(0.0)
                                                                                  	if (t_0 <= Float32(120000.0))
                                                                                  		tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) / Float32(t_0 + Float32(cos2phi / Float32(alphax * alphax))));
                                                                                  	else
                                                                                  		tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay);
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
                                                                                  \mathbf{if}\;t\_0 \leq 120000:\\
                                                                                  \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{t\_0 + \frac{cos2phi}{alphax \cdot alphax}}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 2 regimes
                                                                                  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.2e5

                                                                                    1. Initial program 60.4%

                                                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                    2. Taylor expanded in u0 around 0

                                                                                      \[\leadsto \frac{u0 \cdot \left(1 + \frac{1}{2} \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites87.0%

                                                                                        \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                      2. Step-by-step derivation
                                                                                        1. Applied rewrites87.0%

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]

                                                                                        if 1.2e5 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                        1. Initial program 60.4%

                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                        2. Step-by-step derivation
                                                                                          1. Applied rewrites61.0%

                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                          2. Taylor expanded in alphax around inf

                                                                                            \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites49.1%

                                                                                              \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                            2. Step-by-step derivation
                                                                                              1. Applied rewrites49.1%

                                                                                                \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                              2. Step-by-step derivation
                                                                                                1. Applied rewrites74.5%

                                                                                                  \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                              3. Recombined 2 regimes into one program.
                                                                                              4. Add Preprocessing

                                                                                              Alternative 12: 92.5% accurate, 0.8× speedup?

                                                                                              \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                              \[\begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t\_0 \leq 120000:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{t\_0 + \frac{cos2phi}{alphax \cdot alphax}} \cdot u0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                              (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                :precision binary32
                                                                                                :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                  (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                             (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                        (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                   (<= 0.0 sin2phi))
                                                                                                (let* ((t_0 (/ sin2phi (* alphay alphay))))
                                                                                                (if (<= t_0 120000.0)
                                                                                                  (* (/ (fma 0.5 u0 1.0) (+ t_0 (/ cos2phi (* alphax alphax)))) u0)
                                                                                                  (* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay))))
                                                                                              float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                              	float t_0 = sin2phi / (alphay * alphay);
                                                                                              	float tmp;
                                                                                              	if (t_0 <= 120000.0f) {
                                                                                              		tmp = (fmaf(0.5f, u0, 1.0f) / (t_0 + (cos2phi / (alphax * alphax)))) * u0;
                                                                                              	} else {
                                                                                              		tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                              	t_0 = Float32(sin2phi / Float32(alphay * alphay))
                                                                                              	tmp = Float32(0.0)
                                                                                              	if (t_0 <= Float32(120000.0))
                                                                                              		tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) / Float32(t_0 + Float32(cos2phi / Float32(alphax * alphax)))) * u0);
                                                                                              	else
                                                                                              		tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay);
                                                                                              	end
                                                                                              	return tmp
                                                                                              end
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
                                                                                              \mathbf{if}\;t\_0 \leq 120000:\\
                                                                                              \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{t\_0 + \frac{cos2phi}{alphax \cdot alphax}} \cdot u0\\
                                                                                              
                                                                                              \mathbf{else}:\\
                                                                                              \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                              
                                                                                              
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Split input into 2 regimes
                                                                                              2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.2e5

                                                                                                1. Initial program 60.4%

                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                2. Taylor expanded in u0 around 0

                                                                                                  \[\leadsto u0 \cdot \left(\frac{1}{2} \cdot \frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}} + \frac{1}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}\right) \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites87.0%

                                                                                                    \[\leadsto u0 \cdot \mathsf{fma}\left(0.5, \frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}, \frac{1}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}\right) \]
                                                                                                  2. Applied rewrites87.0%

                                                                                                    \[\leadsto \frac{\mathsf{fma}\left(0.5, u0, 1\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \cdot u0 \]

                                                                                                  if 1.2e5 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                  1. Initial program 60.4%

                                                                                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                  2. Step-by-step derivation
                                                                                                    1. Applied rewrites61.0%

                                                                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                    2. Taylor expanded in alphax around inf

                                                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites49.1%

                                                                                                        \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                      2. Step-by-step derivation
                                                                                                        1. Applied rewrites49.1%

                                                                                                          \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                        2. Step-by-step derivation
                                                                                                          1. Applied rewrites74.5%

                                                                                                            \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                        3. Recombined 2 regimes into one program.
                                                                                                        4. Add Preprocessing

                                                                                                        Alternative 13: 87.4% accurate, 1.0× speedup?

                                                                                                        \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                        \[\begin{array}{l} t_0 := -\mathsf{log1p}\left(-u0\right)\\ \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\frac{t\_0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                        (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                          :precision binary32
                                                                                                          :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                            (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                       (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                  (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                             (<= 0.0 sin2phi))
                                                                                                          (let* ((t_0 (- (log1p (- u0)))))
                                                                                                          (if (<= sin2phi 1.825378024189646e-15)
                                                                                                            (/ t_0 (* cos2phi (/ 1.0 (* alphax alphax))))
                                                                                                            (* (* (/ t_0 sin2phi) alphay) alphay))))
                                                                                                        float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                        	float t_0 = -log1pf(-u0);
                                                                                                        	float tmp;
                                                                                                        	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                        		tmp = t_0 / (cos2phi * (1.0f / (alphax * alphax)));
                                                                                                        	} else {
                                                                                                        		tmp = ((t_0 / sin2phi) * alphay) * alphay;
                                                                                                        	}
                                                                                                        	return tmp;
                                                                                                        }
                                                                                                        
                                                                                                        function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                        	t_0 = Float32(-log1p(Float32(-u0)))
                                                                                                        	tmp = Float32(0.0)
                                                                                                        	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                        		tmp = Float32(t_0 / Float32(cos2phi * Float32(Float32(1.0) / Float32(alphax * alphax))));
                                                                                                        	else
                                                                                                        		tmp = Float32(Float32(Float32(t_0 / sin2phi) * alphay) * alphay);
                                                                                                        	end
                                                                                                        	return tmp
                                                                                                        end
                                                                                                        
                                                                                                        \begin{array}{l}
                                                                                                        t_0 := -\mathsf{log1p}\left(-u0\right)\\
                                                                                                        \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                        \;\;\;\;\frac{t\_0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\
                                                                                                        
                                                                                                        \mathbf{else}:\\
                                                                                                        \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                                        
                                                                                                        
                                                                                                        \end{array}
                                                                                                        
                                                                                                        Derivation
                                                                                                        1. Split input into 2 regimes
                                                                                                        2. if sin2phi < 1.82537802e-15

                                                                                                          1. Initial program 60.4%

                                                                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                          2. Step-by-step derivation
                                                                                                            1. Applied rewrites60.4%

                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                            2. Taylor expanded in alphax around 0

                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites21.6%

                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                              2. Step-by-step derivation
                                                                                                                1. Applied rewrites27.7%

                                                                                                                  \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]

                                                                                                                if 1.82537802e-15 < sin2phi

                                                                                                                1. Initial program 60.4%

                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                2. Step-by-step derivation
                                                                                                                  1. Applied rewrites61.0%

                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                    \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites49.1%

                                                                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                    2. Step-by-step derivation
                                                                                                                      1. Applied rewrites49.1%

                                                                                                                        \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites74.5%

                                                                                                                          \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                      4. Add Preprocessing

                                                                                                                      Alternative 14: 87.4% accurate, 1.1× speedup?

                                                                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                      \[\begin{array}{l} t_0 := -\mathsf{log1p}\left(-u0\right)\\ \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\frac{t\_0}{\frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                        :precision binary32
                                                                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                           (<= 0.0 sin2phi))
                                                                                                                        (let* ((t_0 (- (log1p (- u0)))))
                                                                                                                        (if (<= sin2phi 1.825378024189646e-15)
                                                                                                                          (/ t_0 (/ cos2phi (* alphax alphax)))
                                                                                                                          (* (* (/ t_0 sin2phi) alphay) alphay))))
                                                                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                      	float t_0 = -log1pf(-u0);
                                                                                                                      	float tmp;
                                                                                                                      	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                                      		tmp = t_0 / (cos2phi / (alphax * alphax));
                                                                                                                      	} else {
                                                                                                                      		tmp = ((t_0 / sin2phi) * alphay) * alphay;
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                      	t_0 = Float32(-log1p(Float32(-u0)))
                                                                                                                      	tmp = Float32(0.0)
                                                                                                                      	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                                      		tmp = Float32(t_0 / Float32(cos2phi / Float32(alphax * alphax)));
                                                                                                                      	else
                                                                                                                      		tmp = Float32(Float32(Float32(t_0 / sin2phi) * alphay) * alphay);
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      t_0 := -\mathsf{log1p}\left(-u0\right)\\
                                                                                                                      \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                                      \;\;\;\;\frac{t\_0}{\frac{cos2phi}{alphax \cdot alphax}}\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 2 regimes
                                                                                                                      2. if sin2phi < 1.82537802e-15

                                                                                                                        1. Initial program 60.4%

                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                        2. Step-by-step derivation
                                                                                                                          1. Applied rewrites60.4%

                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                          2. Taylor expanded in alphax around 0

                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites21.6%

                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                            2. Step-by-step derivation
                                                                                                                              1. Applied rewrites21.6%

                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax}} \]
                                                                                                                              2. Step-by-step derivation
                                                                                                                                1. Applied rewrites27.7%

                                                                                                                                  \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax}} \]

                                                                                                                                if 1.82537802e-15 < sin2phi

                                                                                                                                1. Initial program 60.4%

                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                2. Step-by-step derivation
                                                                                                                                  1. Applied rewrites61.0%

                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                                    \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites49.1%

                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                    2. Step-by-step derivation
                                                                                                                                      1. Applied rewrites49.1%

                                                                                                                                        \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                      2. Step-by-step derivation
                                                                                                                                        1. Applied rewrites74.5%

                                                                                                                                          \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                      4. Add Preprocessing

                                                                                                                                      Alternative 15: 83.6% accurate, 1.1× speedup?

                                                                                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                      \[\begin{array}{l} t_0 := -\mathsf{log1p}\left(-u0\right)\\ \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\frac{t\_0}{cos2phi} \cdot \left(alphax \cdot alphax\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                        :precision binary32
                                                                                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                           (<= 0.0 sin2phi))
                                                                                                                                        (let* ((t_0 (- (log1p (- u0)))))
                                                                                                                                        (if (<= sin2phi 1.825378024189646e-15)
                                                                                                                                          (* (/ t_0 cos2phi) (* alphax alphax))
                                                                                                                                          (* (* (/ t_0 sin2phi) alphay) alphay))))
                                                                                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                      	float t_0 = -log1pf(-u0);
                                                                                                                                      	float tmp;
                                                                                                                                      	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                                                      		tmp = (t_0 / cos2phi) * (alphax * alphax);
                                                                                                                                      	} else {
                                                                                                                                      		tmp = ((t_0 / sin2phi) * alphay) * alphay;
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                      	t_0 = Float32(-log1p(Float32(-u0)))
                                                                                                                                      	tmp = Float32(0.0)
                                                                                                                                      	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                                                      		tmp = Float32(Float32(t_0 / cos2phi) * Float32(alphax * alphax));
                                                                                                                                      	else
                                                                                                                                      		tmp = Float32(Float32(Float32(t_0 / sin2phi) * alphay) * alphay);
                                                                                                                                      	end
                                                                                                                                      	return tmp
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      \begin{array}{l}
                                                                                                                                      t_0 := -\mathsf{log1p}\left(-u0\right)\\
                                                                                                                                      \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                                                      \;\;\;\;\frac{t\_0}{cos2phi} \cdot \left(alphax \cdot alphax\right)\\
                                                                                                                                      
                                                                                                                                      \mathbf{else}:\\
                                                                                                                                      \;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                                                                      
                                                                                                                                      
                                                                                                                                      \end{array}
                                                                                                                                      
                                                                                                                                      Derivation
                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                      2. if sin2phi < 1.82537802e-15

                                                                                                                                        1. Initial program 60.4%

                                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                        2. Step-by-step derivation
                                                                                                                                          1. Applied rewrites60.8%

                                                                                                                                            \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                          2. Step-by-step derivation
                                                                                                                                            1. Applied rewrites60.4%

                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right)} \cdot \left(alphax \cdot alphax\right) \]
                                                                                                                                            2. Taylor expanded in alphax around 0

                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi} \cdot \left(alphax \cdot alphax\right) \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites21.6%

                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi} \cdot \left(alphax \cdot alphax\right) \]
                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                1. Applied rewrites27.7%

                                                                                                                                                  \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{cos2phi} \cdot \left(alphax \cdot alphax\right) \]

                                                                                                                                                if 1.82537802e-15 < sin2phi

                                                                                                                                                1. Initial program 60.4%

                                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites61.0%

                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                                                    \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites49.1%

                                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                      1. Applied rewrites49.1%

                                                                                                                                                        \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites74.5%

                                                                                                                                                          \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                                      4. Add Preprocessing

                                                                                                                                                      Alternative 16: 83.6% accurate, 0.9× speedup?

                                                                                                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                      \[\begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t\_0 \leq 1.0000000116860974 \cdot 10^{-7}:\\ \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                        :precision binary32
                                                                                                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                           (<= 0.0 sin2phi))
                                                                                                                                                        (let* ((t_0 (/ sin2phi (* alphay alphay))))
                                                                                                                                                        (if (<= t_0 1.0000000116860974e-7)
                                                                                                                                                          (/ (- (- u0)) (+ (/ cos2phi (* alphax alphax)) t_0))
                                                                                                                                                          (* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay))))
                                                                                                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                      	float t_0 = sin2phi / (alphay * alphay);
                                                                                                                                                      	float tmp;
                                                                                                                                                      	if (t_0 <= 1.0000000116860974e-7f) {
                                                                                                                                                      		tmp = -(-u0) / ((cos2phi / (alphax * alphax)) + t_0);
                                                                                                                                                      	} else {
                                                                                                                                                      		tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
                                                                                                                                                      	}
                                                                                                                                                      	return tmp;
                                                                                                                                                      }
                                                                                                                                                      
                                                                                                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                      	t_0 = Float32(sin2phi / Float32(alphay * alphay))
                                                                                                                                                      	tmp = Float32(0.0)
                                                                                                                                                      	if (t_0 <= Float32(1.0000000116860974e-7))
                                                                                                                                                      		tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + t_0));
                                                                                                                                                      	else
                                                                                                                                                      		tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay);
                                                                                                                                                      	end
                                                                                                                                                      	return tmp
                                                                                                                                                      end
                                                                                                                                                      
                                                                                                                                                      \begin{array}{l}
                                                                                                                                                      t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
                                                                                                                                                      \mathbf{if}\;t\_0 \leq 1.0000000116860974 \cdot 10^{-7}:\\
                                                                                                                                                      \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\
                                                                                                                                                      
                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                      \;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
                                                                                                                                                      
                                                                                                                                                      
                                                                                                                                                      \end{array}
                                                                                                                                                      
                                                                                                                                                      Derivation
                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                      2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-7

                                                                                                                                                        1. Initial program 60.4%

                                                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                        2. Taylor expanded in u0 around 0

                                                                                                                                                          \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites75.7%

                                                                                                                                                            \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites75.7%

                                                                                                                                                              \[\leadsto \frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]

                                                                                                                                                            if 1.00000001e-7 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                            1. Initial program 60.4%

                                                                                                                                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites61.0%

                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                              2. Taylor expanded in alphax around inf

                                                                                                                                                                \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites49.1%

                                                                                                                                                                  \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites49.1%

                                                                                                                                                                    \[\leadsto \left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites74.5%

                                                                                                                                                                      \[\leadsto \left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay \]
                                                                                                                                                                  3. Recombined 2 regimes into one program.
                                                                                                                                                                  4. Add Preprocessing

                                                                                                                                                                  Alternative 17: 83.6% accurate, 0.9× speedup?

                                                                                                                                                                  \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                  \[\begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t\_0 \leq 1.0000000116860974 \cdot 10^{-7}:\\ \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\ \end{array} \]
                                                                                                                                                                  (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                    :precision binary32
                                                                                                                                                                    :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                      (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                 (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                            (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                       (<= 0.0 sin2phi))
                                                                                                                                                                    (let* ((t_0 (/ sin2phi (* alphay alphay))))
                                                                                                                                                                    (if (<= t_0 1.0000000116860974e-7)
                                                                                                                                                                      (/ (- (- u0)) (+ (/ cos2phi (* alphax alphax)) t_0))
                                                                                                                                                                      (* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay)))))
                                                                                                                                                                  float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                  	float t_0 = sin2phi / (alphay * alphay);
                                                                                                                                                                  	float tmp;
                                                                                                                                                                  	if (t_0 <= 1.0000000116860974e-7f) {
                                                                                                                                                                  		tmp = -(-u0) / ((cos2phi / (alphax * alphax)) + t_0);
                                                                                                                                                                  	} else {
                                                                                                                                                                  		tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
                                                                                                                                                                  	}
                                                                                                                                                                  	return tmp;
                                                                                                                                                                  }
                                                                                                                                                                  
                                                                                                                                                                  function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                  	t_0 = Float32(sin2phi / Float32(alphay * alphay))
                                                                                                                                                                  	tmp = Float32(0.0)
                                                                                                                                                                  	if (t_0 <= Float32(1.0000000116860974e-7))
                                                                                                                                                                  		tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + t_0));
                                                                                                                                                                  	else
                                                                                                                                                                  		tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay));
                                                                                                                                                                  	end
                                                                                                                                                                  	return tmp
                                                                                                                                                                  end
                                                                                                                                                                  
                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                  t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
                                                                                                                                                                  \mathbf{if}\;t\_0 \leq 1.0000000116860974 \cdot 10^{-7}:\\
                                                                                                                                                                  \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\
                                                                                                                                                                  
                                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                                  \;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
                                                                                                                                                                  
                                                                                                                                                                  
                                                                                                                                                                  \end{array}
                                                                                                                                                                  
                                                                                                                                                                  Derivation
                                                                                                                                                                  1. Split input into 2 regimes
                                                                                                                                                                  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-7

                                                                                                                                                                    1. Initial program 60.4%

                                                                                                                                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                    2. Taylor expanded in u0 around 0

                                                                                                                                                                      \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites75.7%

                                                                                                                                                                        \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites75.7%

                                                                                                                                                                          \[\leadsto \frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]

                                                                                                                                                                        if 1.00000001e-7 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                        1. Initial program 60.4%

                                                                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                          1. Applied rewrites61.0%

                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                          2. Taylor expanded in alphax around inf

                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                            1. Applied rewrites49.1%

                                                                                                                                                                              \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                              1. Applied rewrites49.1%

                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                1. Applied rewrites74.5%

                                                                                                                                                                                  \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                              3. Recombined 2 regimes into one program.
                                                                                                                                                                              4. Add Preprocessing

                                                                                                                                                                              Alternative 18: 83.2% accurate, 1.0× speedup?

                                                                                                                                                                              \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                              \[\begin{array}{l} \mathbf{if}\;1 - u0 \leq 0.9974200129508972:\\ \;\;\;\;\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\ \end{array} \]
                                                                                                                                                                              (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                :precision binary32
                                                                                                                                                                                :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                  (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                             (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                        (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                   (<= 0.0 sin2phi))
                                                                                                                                                                                (if (<= (- 1.0 u0) 0.9974200129508972)
                                                                                                                                                                                (* (/ (- (log (- 1.0 u0))) sin2phi) (* alphay alphay))
                                                                                                                                                                                (/
                                                                                                                                                                                 (- (- u0))
                                                                                                                                                                                 (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay))))))
                                                                                                                                                                              float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                              	float tmp;
                                                                                                                                                                              	if ((1.0f - u0) <= 0.9974200129508972f) {
                                                                                                                                                                              		tmp = (-logf((1.0f - u0)) / sin2phi) * (alphay * alphay);
                                                                                                                                                                              	} else {
                                                                                                                                                                              		tmp = -(-u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
                                                                                                                                                                              	}
                                                                                                                                                                              	return tmp;
                                                                                                                                                                              }
                                                                                                                                                                              
                                                                                                                                                                              real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                                                  real(4), intent (in) :: alphax
                                                                                                                                                                                  real(4), intent (in) :: alphay
                                                                                                                                                                                  real(4), intent (in) :: u0
                                                                                                                                                                                  real(4), intent (in) :: cos2phi
                                                                                                                                                                                  real(4), intent (in) :: sin2phi
                                                                                                                                                                                  real(4) :: tmp
                                                                                                                                                                                  if ((1.0e0 - u0) <= 0.9974200129508972e0) then
                                                                                                                                                                                      tmp = (-log((1.0e0 - u0)) / sin2phi) * (alphay * alphay)
                                                                                                                                                                                  else
                                                                                                                                                                                      tmp = -(-u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
                                                                                                                                                                                  end if
                                                                                                                                                                                  code = tmp
                                                                                                                                                                              end function
                                                                                                                                                                              
                                                                                                                                                                              function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                              	tmp = Float32(0.0)
                                                                                                                                                                              	if (Float32(Float32(1.0) - u0) <= Float32(0.9974200129508972))
                                                                                                                                                                              		tmp = Float32(Float32(Float32(-log(Float32(Float32(1.0) - u0))) / sin2phi) * Float32(alphay * alphay));
                                                                                                                                                                              	else
                                                                                                                                                                              		tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))));
                                                                                                                                                                              	end
                                                                                                                                                                              	return tmp
                                                                                                                                                                              end
                                                                                                                                                                              
                                                                                                                                                                              function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                              	tmp = single(0.0);
                                                                                                                                                                              	if ((single(1.0) - u0) <= single(0.9974200129508972))
                                                                                                                                                                              		tmp = (-log((single(1.0) - u0)) / sin2phi) * (alphay * alphay);
                                                                                                                                                                              	else
                                                                                                                                                                              		tmp = -(-u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
                                                                                                                                                                              	end
                                                                                                                                                                              	tmp_2 = tmp;
                                                                                                                                                                              end
                                                                                                                                                                              
                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                              \mathbf{if}\;1 - u0 \leq 0.9974200129508972:\\
                                                                                                                                                                              \;\;\;\;\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
                                                                                                                                                                              
                                                                                                                                                                              \mathbf{else}:\\
                                                                                                                                                                              \;\;\;\;\frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\
                                                                                                                                                                              
                                                                                                                                                                              
                                                                                                                                                                              \end{array}
                                                                                                                                                                              
                                                                                                                                                                              Derivation
                                                                                                                                                                              1. Split input into 2 regimes
                                                                                                                                                                              2. if (-.f32 #s(literal 1 binary32) u0) < 0.997420013

                                                                                                                                                                                1. Initial program 60.4%

                                                                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                  1. Applied rewrites61.0%

                                                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                                                                                    \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                    1. Applied rewrites49.1%

                                                                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                      1. Applied rewrites49.1%

                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right) \]

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

                                                                                                                                                                                      1. Initial program 60.4%

                                                                                                                                                                                        \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                      2. Taylor expanded in u0 around 0

                                                                                                                                                                                        \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                        1. Applied rewrites75.7%

                                                                                                                                                                                          \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                          1. Applied rewrites75.7%

                                                                                                                                                                                            \[\leadsto \frac{-\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                        3. Recombined 2 regimes into one program.
                                                                                                                                                                                        4. Add Preprocessing

                                                                                                                                                                                        Alternative 19: 75.4% accurate, 0.9× speedup?

                                                                                                                                                                                        \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                        \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 9.9999998245167 \cdot 10^{-15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, u0, \left(0.5 \cdot u0\right) \cdot u0\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}}\\ \end{array} \]
                                                                                                                                                                                        (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                          :precision binary32
                                                                                                                                                                                          :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                            (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                       (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                  (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                             (<= 0.0 sin2phi))
                                                                                                                                                                                          (if (<= (/ sin2phi (* alphay alphay)) 9.9999998245167e-15)
                                                                                                                                                                                          (* (/ (* (fma 0.5 u0 1.0) u0) (/ cos2phi alphax)) alphax)
                                                                                                                                                                                          (* (fma 1.0 u0 (* (* 0.5 u0) u0)) (/ alphay (/ sin2phi alphay)))))
                                                                                                                                                                                        float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                        	float tmp;
                                                                                                                                                                                        	if ((sin2phi / (alphay * alphay)) <= 9.9999998245167e-15f) {
                                                                                                                                                                                        		tmp = ((fmaf(0.5f, u0, 1.0f) * u0) / (cos2phi / alphax)) * alphax;
                                                                                                                                                                                        	} else {
                                                                                                                                                                                        		tmp = fmaf(1.0f, u0, ((0.5f * u0) * u0)) * (alphay / (sin2phi / alphay));
                                                                                                                                                                                        	}
                                                                                                                                                                                        	return tmp;
                                                                                                                                                                                        }
                                                                                                                                                                                        
                                                                                                                                                                                        function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                        	tmp = Float32(0.0)
                                                                                                                                                                                        	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(9.9999998245167e-15))
                                                                                                                                                                                        		tmp = Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) / Float32(cos2phi / alphax)) * alphax);
                                                                                                                                                                                        	else
                                                                                                                                                                                        		tmp = Float32(fma(Float32(1.0), u0, Float32(Float32(Float32(0.5) * u0) * u0)) * Float32(alphay / Float32(sin2phi / alphay)));
                                                                                                                                                                                        	end
                                                                                                                                                                                        	return tmp
                                                                                                                                                                                        end
                                                                                                                                                                                        
                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                        \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 9.9999998245167 \cdot 10^{-15}:\\
                                                                                                                                                                                        \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\
                                                                                                                                                                                        
                                                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                                                        \;\;\;\;\mathsf{fma}\left(1, u0, \left(0.5 \cdot u0\right) \cdot u0\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}}\\
                                                                                                                                                                                        
                                                                                                                                                                                        
                                                                                                                                                                                        \end{array}
                                                                                                                                                                                        
                                                                                                                                                                                        Derivation
                                                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                                                        2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 9.99999982e-15

                                                                                                                                                                                          1. Initial program 60.4%

                                                                                                                                                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                                                            1. Applied rewrites60.4%

                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                            2. Taylor expanded in alphax around 0

                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                              1. Applied rewrites21.6%

                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                              2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                  \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                2. Applied rewrites25.6%

                                                                                                                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax \]

                                                                                                                                                                                                if 9.99999982e-15 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                1. Initial program 60.4%

                                                                                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                  1. Applied rewrites60.8%

                                                                                                                                                                                                    \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                                                                                                    \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}} \]
                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                    1. Applied rewrites49.0%

                                                                                                                                                                                                      \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}} \]
                                                                                                                                                                                                    2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                        \[\leadsto \left(u0 \cdot \left(1 + 0.5 \cdot u0\right)\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}} \]
                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                        1. Applied rewrites66.8%

                                                                                                                                                                                                          \[\leadsto \mathsf{fma}\left(1, u0, \left(0.5 \cdot u0\right) \cdot u0\right) \cdot \frac{alphay}{\frac{sin2phi}{alphay}} \]
                                                                                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                                                                                      4. Add Preprocessing

                                                                                                                                                                                                      Alternative 20: 75.4% accurate, 1.2× speedup?

                                                                                                                                                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                      \[\begin{array}{l} \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\ \mathbf{else}:\\ \;\;\;\;\left(-1 \cdot \frac{alphay \cdot \left(u0 \cdot \left(-0.5 \cdot u0 - 1\right)\right)}{sin2phi}\right) \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                        :precision binary32
                                                                                                                                                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                           (<= 0.0 sin2phi))
                                                                                                                                                                                                        (if (<= sin2phi 1.825378024189646e-15)
                                                                                                                                                                                                        (* (/ (* (fma 0.5 u0 1.0) u0) (/ cos2phi alphax)) alphax)
                                                                                                                                                                                                        (*
                                                                                                                                                                                                         (* -1.0 (/ (* alphay (* u0 (- (* -0.5 u0) 1.0))) sin2phi))
                                                                                                                                                                                                         alphay)))
                                                                                                                                                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                      	float tmp;
                                                                                                                                                                                                      	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                                                                                                                      		tmp = ((fmaf(0.5f, u0, 1.0f) * u0) / (cos2phi / alphax)) * alphax;
                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                      		tmp = (-1.0f * ((alphay * (u0 * ((-0.5f * u0) - 1.0f))) / sin2phi)) * alphay;
                                                                                                                                                                                                      	}
                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                      }
                                                                                                                                                                                                      
                                                                                                                                                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                      	tmp = Float32(0.0)
                                                                                                                                                                                                      	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                                                                                                                      		tmp = Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) / Float32(cos2phi / alphax)) * alphax);
                                                                                                                                                                                                      	else
                                                                                                                                                                                                      		tmp = Float32(Float32(Float32(-1.0) * Float32(Float32(alphay * Float32(u0 * Float32(Float32(Float32(-0.5) * u0) - Float32(1.0)))) / sin2phi)) * alphay);
                                                                                                                                                                                                      	end
                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                      end
                                                                                                                                                                                                      
                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                      \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                                                                                                                      \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\
                                                                                                                                                                                                      
                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                      \;\;\;\;\left(-1 \cdot \frac{alphay \cdot \left(u0 \cdot \left(-0.5 \cdot u0 - 1\right)\right)}{sin2phi}\right) \cdot alphay\\
                                                                                                                                                                                                      
                                                                                                                                                                                                      
                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                      
                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                      2. if sin2phi < 1.82537802e-15

                                                                                                                                                                                                        1. Initial program 60.4%

                                                                                                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                          1. Applied rewrites60.4%

                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                          2. Taylor expanded in alphax around 0

                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                            1. Applied rewrites21.6%

                                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                            2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                              2. Applied rewrites25.6%

                                                                                                                                                                                                                \[\leadsto \frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax \]

                                                                                                                                                                                                              if 1.82537802e-15 < sin2phi

                                                                                                                                                                                                              1. Initial program 60.4%

                                                                                                                                                                                                                \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                1. Applied rewrites60.8%

                                                                                                                                                                                                                  \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                  1. Applied rewrites60.8%

                                                                                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                  2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                    \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                    1. Applied rewrites49.1%

                                                                                                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                    2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{alphay \cdot \left(u0 \cdot \left(\frac{-1}{2} \cdot u0 - 1\right)\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                      1. Applied rewrites66.8%

                                                                                                                                                                                                                        \[\leadsto \left(-1 \cdot \frac{alphay \cdot \left(u0 \cdot \left(-0.5 \cdot u0 - 1\right)\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                    4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                    5. Add Preprocessing

                                                                                                                                                                                                                    Alternative 21: 74.7% accurate, 1.3× speedup?

                                                                                                                                                                                                                    \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                    \[\begin{array}{l} \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                    (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                      :precision binary32
                                                                                                                                                                                                                      :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                        (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                   (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                              (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                         (<= 0.0 sin2phi))
                                                                                                                                                                                                                      (if (<= sin2phi 1.825378024189646e-15)
                                                                                                                                                                                                                      (* (/ (* (fma 0.5 u0 1.0) u0) (/ cos2phi alphax)) alphax)
                                                                                                                                                                                                                      (* (* (* (/ (fma 0.5 u0 1.0) sin2phi) u0) alphay) alphay)))
                                                                                                                                                                                                                    float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                    	float tmp;
                                                                                                                                                                                                                    	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                                                                                                                                    		tmp = ((fmaf(0.5f, u0, 1.0f) * u0) / (cos2phi / alphax)) * alphax;
                                                                                                                                                                                                                    	} else {
                                                                                                                                                                                                                    		tmp = (((fmaf(0.5f, u0, 1.0f) / sin2phi) * u0) * alphay) * alphay;
                                                                                                                                                                                                                    	}
                                                                                                                                                                                                                    	return tmp;
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                    	tmp = Float32(0.0)
                                                                                                                                                                                                                    	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                                                                                                                                    		tmp = Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) / Float32(cos2phi / alphax)) * alphax);
                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                    		tmp = Float32(Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) / sin2phi) * u0) * alphay) * alphay);
                                                                                                                                                                                                                    	end
                                                                                                                                                                                                                    	return tmp
                                                                                                                                                                                                                    end
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \begin{array}{l}
                                                                                                                                                                                                                    \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                                                                                                                                    \;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax\\
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \mathbf{else}:\\
                                                                                                                                                                                                                    \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay\\
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \end{array}
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    Derivation
                                                                                                                                                                                                                    1. Split input into 2 regimes
                                                                                                                                                                                                                    2. if sin2phi < 1.82537802e-15

                                                                                                                                                                                                                      1. Initial program 60.4%

                                                                                                                                                                                                                        \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                        1. Applied rewrites60.4%

                                                                                                                                                                                                                          \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                        2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                          \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                          1. Applied rewrites21.6%

                                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                          2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                              \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                            2. Applied rewrites25.6%

                                                                                                                                                                                                                              \[\leadsto \frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{\frac{cos2phi}{alphax}} \cdot alphax \]

                                                                                                                                                                                                                            if 1.82537802e-15 < sin2phi

                                                                                                                                                                                                                            1. Initial program 60.4%

                                                                                                                                                                                                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                              1. Applied rewrites61.0%

                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                              2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                1. Applied rewrites49.1%

                                                                                                                                                                                                                                  \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                    \[\leadsto \left(u0 \cdot \mathsf{fma}\left(0.5, \frac{u0}{sin2phi}, \frac{1}{sin2phi}\right)\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                    1. Applied rewrites66.8%

                                                                                                                                                                                                                                      \[\leadsto \left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay \]
                                                                                                                                                                                                                                  3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                  4. Add Preprocessing

                                                                                                                                                                                                                                  Alternative 22: 74.7% accurate, 1.4× speedup?

                                                                                                                                                                                                                                  \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                  \[\begin{array}{l} \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                  (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                    :precision binary32
                                                                                                                                                                                                                                    :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                      (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                 (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                            (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                       (<= 0.0 sin2phi))
                                                                                                                                                                                                                                    (if (<= sin2phi 1.825378024189646e-15)
                                                                                                                                                                                                                                    (* (* (fma 0.5 u0 1.0) u0) (/ (* alphax alphax) cos2phi))
                                                                                                                                                                                                                                    (* (* (* (/ (fma 0.5 u0 1.0) sin2phi) u0) alphay) alphay)))
                                                                                                                                                                                                                                  float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                  	float tmp;
                                                                                                                                                                                                                                  	if (sin2phi <= 1.825378024189646e-15f) {
                                                                                                                                                                                                                                  		tmp = (fmaf(0.5f, u0, 1.0f) * u0) * ((alphax * alphax) / cos2phi);
                                                                                                                                                                                                                                  	} else {
                                                                                                                                                                                                                                  		tmp = (((fmaf(0.5f, u0, 1.0f) / sin2phi) * u0) * alphay) * alphay;
                                                                                                                                                                                                                                  	}
                                                                                                                                                                                                                                  	return tmp;
                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                  	tmp = Float32(0.0)
                                                                                                                                                                                                                                  	if (sin2phi <= Float32(1.825378024189646e-15))
                                                                                                                                                                                                                                  		tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) * Float32(Float32(alphax * alphax) / cos2phi));
                                                                                                                                                                                                                                  	else
                                                                                                                                                                                                                                  		tmp = Float32(Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) / sin2phi) * u0) * alphay) * alphay);
                                                                                                                                                                                                                                  	end
                                                                                                                                                                                                                                  	return tmp
                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                                                                  \mathbf{if}\;sin2phi \leq 1.825378024189646 \cdot 10^{-15}:\\
                                                                                                                                                                                                                                  \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                                                                                                  \;\;\;\;\left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay\\
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  \end{array}
                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                  Derivation
                                                                                                                                                                                                                                  1. Split input into 2 regimes
                                                                                                                                                                                                                                  2. if sin2phi < 1.82537802e-15

                                                                                                                                                                                                                                    1. Initial program 60.4%

                                                                                                                                                                                                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                      1. Applied rewrites60.4%

                                                                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                      2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                        1. Applied rewrites21.6%

                                                                                                                                                                                                                                          \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                        2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                            \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                          2. Applied rewrites25.6%

                                                                                                                                                                                                                                            \[\leadsto \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi} \]

                                                                                                                                                                                                                                          if 1.82537802e-15 < sin2phi

                                                                                                                                                                                                                                          1. Initial program 60.4%

                                                                                                                                                                                                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                                                                                                            1. Applied rewrites61.0%

                                                                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                            2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                              \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                              1. Applied rewrites49.1%

                                                                                                                                                                                                                                                \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                              2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                                  \[\leadsto \left(u0 \cdot \mathsf{fma}\left(0.5, \frac{u0}{sin2phi}, \frac{1}{sin2phi}\right)\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                  1. Applied rewrites66.8%

                                                                                                                                                                                                                                                    \[\leadsto \left(\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot alphay\right) \cdot alphay \]
                                                                                                                                                                                                                                                3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                4. Add Preprocessing

                                                                                                                                                                                                                                                Alternative 23: 74.7% accurate, 1.0× speedup?

                                                                                                                                                                                                                                                \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 9.9999998245167 \cdot 10^{-15}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot \left(alphay \cdot alphay\right)\\ \end{array} \]
                                                                                                                                                                                                                                                (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                  :precision binary32
                                                                                                                                                                                                                                                  :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                    (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                               (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                          (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                     (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                  (if (<= (/ sin2phi (* alphay alphay)) 9.9999998245167e-15)
                                                                                                                                                                                                                                                  (* (* (fma 0.5 u0 1.0) u0) (/ (* alphax alphax) cos2phi))
                                                                                                                                                                                                                                                  (* (* (/ (fma 0.5 u0 1.0) sin2phi) u0) (* alphay alphay))))
                                                                                                                                                                                                                                                float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                	float tmp;
                                                                                                                                                                                                                                                	if ((sin2phi / (alphay * alphay)) <= 9.9999998245167e-15f) {
                                                                                                                                                                                                                                                		tmp = (fmaf(0.5f, u0, 1.0f) * u0) * ((alphax * alphax) / cos2phi);
                                                                                                                                                                                                                                                	} else {
                                                                                                                                                                                                                                                		tmp = ((fmaf(0.5f, u0, 1.0f) / sin2phi) * u0) * (alphay * alphay);
                                                                                                                                                                                                                                                	}
                                                                                                                                                                                                                                                	return tmp;
                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                	tmp = Float32(0.0)
                                                                                                                                                                                                                                                	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(9.9999998245167e-15))
                                                                                                                                                                                                                                                		tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) * Float32(Float32(alphax * alphax) / cos2phi));
                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                		tmp = Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) / sin2phi) * u0) * Float32(alphay * alphay));
                                                                                                                                                                                                                                                	end
                                                                                                                                                                                                                                                	return tmp
                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                                                                                                \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 9.9999998245167 \cdot 10^{-15}:\\
                                                                                                                                                                                                                                                \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                                                                                                                \;\;\;\;\left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot \left(alphay \cdot alphay\right)\\
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                \end{array}
                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                Derivation
                                                                                                                                                                                                                                                1. Split input into 2 regimes
                                                                                                                                                                                                                                                2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 9.99999982e-15

                                                                                                                                                                                                                                                  1. Initial program 60.4%

                                                                                                                                                                                                                                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                    1. Applied rewrites60.4%

                                                                                                                                                                                                                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                    2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                                      1. Applied rewrites21.6%

                                                                                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                      2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                                          \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                        2. Applied rewrites25.6%

                                                                                                                                                                                                                                                          \[\leadsto \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi} \]

                                                                                                                                                                                                                                                        if 9.99999982e-15 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                        1. Initial program 60.4%

                                                                                                                                                                                                                                                          \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                          1. Applied rewrites61.0%

                                                                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                          2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                            1. Applied rewrites49.1%

                                                                                                                                                                                                                                                              \[\leadsto \left(-1 \cdot \frac{\log \left(1 - u0\right)}{sin2phi}\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                            2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                                                \[\leadsto \left(u0 \cdot \mathsf{fma}\left(0.5, \frac{u0}{sin2phi}, \frac{1}{sin2phi}\right)\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                1. Applied rewrites66.8%

                                                                                                                                                                                                                                                                  \[\leadsto \left(\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{sin2phi} \cdot u0\right) \cdot \left(alphay \cdot alphay\right) \]
                                                                                                                                                                                                                                                              3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                              4. Add Preprocessing

                                                                                                                                                                                                                                                              Alternative 24: 67.9% accurate, 1.0× speedup?

                                                                                                                                                                                                                                                              \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                              \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                              (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                :precision binary32
                                                                                                                                                                                                                                                                :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                  (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                             (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                        (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                   (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                (* (* (fma 0.5 u0 1.0) u0) (/ (* alphax alphax) cos2phi))
                                                                                                                                                                                                                                                                (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                              float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                              	float tmp;
                                                                                                                                                                                                                                                              	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                              		tmp = (fmaf(0.5f, u0, 1.0f) * u0) * ((alphax * alphax) / cos2phi);
                                                                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                                                                              		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                              	}
                                                                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                              	tmp = Float32(0.0)
                                                                                                                                                                                                                                                              	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                              		tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) * Float32(Float32(alphax * alphax) / cos2phi));
                                                                                                                                                                                                                                                              	else
                                                                                                                                                                                                                                                              		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                              	end
                                                                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                                              \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                              \;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              \mathbf{else}:\\
                                                                                                                                                                                                                                                              \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                                                                              1. Split input into 2 regimes
                                                                                                                                                                                                                                                              2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                1. Initial program 60.4%

                                                                                                                                                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                                  1. Applied rewrites60.4%

                                                                                                                                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                  2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                    1. Applied rewrites21.6%

                                                                                                                                                                                                                                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                    2. Taylor expanded in u0 around 0

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

                                                                                                                                                                                                                                                                        \[\leadsto \frac{u0 \cdot \left(1 + 0.5 \cdot u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                      2. Applied rewrites25.6%

                                                                                                                                                                                                                                                                        \[\leadsto \left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi} \]

                                                                                                                                                                                                                                                                      if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                      1. Initial program 60.4%

                                                                                                                                                                                                                                                                        \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                        1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                          \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                                          1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                          2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                            1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                              \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                            2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                              \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                              1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                            5. Add Preprocessing

                                                                                                                                                                                                                                                                            Alternative 25: 65.8% accurate, 1.1× speedup?

                                                                                                                                                                                                                                                                            \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                            \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{-\left(-u0\right)}{cos2phi}}{\frac{1}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                                            (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                              :precision binary32
                                                                                                                                                                                                                                                                              :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                           (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                      (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                 (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                              (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                              (/ (/ (- (- u0)) cos2phi) (/ 1.0 (* alphax alphax)))
                                                                                                                                                                                                                                                                              (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                                            float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                            	float tmp;
                                                                                                                                                                                                                                                                            	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                                            		tmp = (-(-u0) / cos2phi) / (1.0f / (alphax * alphax));
                                                                                                                                                                                                                                                                            	} else {
                                                                                                                                                                                                                                                                            		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                            	}
                                                                                                                                                                                                                                                                            	return tmp;
                                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                            use fmin_fmax_functions
                                                                                                                                                                                                                                                                                real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                real(4) :: tmp
                                                                                                                                                                                                                                                                                if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10) then
                                                                                                                                                                                                                                                                                    tmp = (-(-u0) / cos2phi) / (1.0e0 / (alphax * alphax))
                                                                                                                                                                                                                                                                                else
                                                                                                                                                                                                                                                                                    tmp = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                end if
                                                                                                                                                                                                                                                                                code = tmp
                                                                                                                                                                                                                                                                            end function
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                            	tmp = Float32(0.0)
                                                                                                                                                                                                                                                                            	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                                            		tmp = Float32(Float32(Float32(-Float32(-u0)) / cos2phi) / Float32(Float32(1.0) / Float32(alphax * alphax)));
                                                                                                                                                                                                                                                                            	else
                                                                                                                                                                                                                                                                            		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                                            	end
                                                                                                                                                                                                                                                                            	return tmp
                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                            	tmp = single(0.0);
                                                                                                                                                                                                                                                                            	if ((sin2phi / (alphay * alphay)) <= single(1.000000013351432e-10))
                                                                                                                                                                                                                                                                            		tmp = (-(-u0) / cos2phi) / (single(1.0) / (alphax * alphax));
                                                                                                                                                                                                                                                                            	else
                                                                                                                                                                                                                                                                            		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                            	end
                                                                                                                                                                                                                                                                            	tmp_2 = tmp;
                                                                                                                                                                                                                                                                            end
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            \begin{array}{l}
                                                                                                                                                                                                                                                                            \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                                            \;\;\;\;\frac{\frac{-\left(-u0\right)}{cos2phi}}{\frac{1}{alphax \cdot alphax}}\\
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            \mathbf{else}:\\
                                                                                                                                                                                                                                                                            \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            \end{array}
                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                            Derivation
                                                                                                                                                                                                                                                                            1. Split input into 2 regimes
                                                                                                                                                                                                                                                                            2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                              1. Initial program 60.4%

                                                                                                                                                                                                                                                                                \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                1. Applied rewrites60.4%

                                                                                                                                                                                                                                                                                  \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                                  \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                                                                  1. Applied rewrites21.6%

                                                                                                                                                                                                                                                                                    \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                  2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                    \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                    1. Applied rewrites23.2%

                                                                                                                                                                                                                                                                                      \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                    2. Applied rewrites23.3%

                                                                                                                                                                                                                                                                                      \[\leadsto \frac{\frac{-\left(-u0\right)}{cos2phi}}{\frac{1}{alphax \cdot alphax}} \]

                                                                                                                                                                                                                                                                                    if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                                    1. Initial program 60.4%

                                                                                                                                                                                                                                                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                      1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                        \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                        1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                          \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                        2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                          \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                                                                          1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                          2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                            \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                            1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                              \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                          4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                          5. Add Preprocessing

                                                                                                                                                                                                                                                                                          Alternative 26: 65.8% accurate, 1.1× speedup?

                                                                                                                                                                                                                                                                                          \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                                          \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;\frac{--1 \cdot u0}{\frac{\frac{cos2phi}{alphax}}{alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                                                          (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                            :precision binary32
                                                                                                                                                                                                                                                                                            :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                              (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                                         (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                                    (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                               (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                            (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                                            (/ (- (* -1.0 u0)) (/ (/ cos2phi alphax) alphax))
                                                                                                                                                                                                                                                                                            (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                                                          float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                                          	float tmp;
                                                                                                                                                                                                                                                                                          	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                                                          		tmp = -(-1.0f * u0) / ((cos2phi / alphax) / alphax);
                                                                                                                                                                                                                                                                                          	} else {
                                                                                                                                                                                                                                                                                          		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                          	}
                                                                                                                                                                                                                                                                                          	return tmp;
                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                          use fmin_fmax_functions
                                                                                                                                                                                                                                                                                              real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                              real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                              real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                              real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                              real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                              real(4) :: tmp
                                                                                                                                                                                                                                                                                              if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10) then
                                                                                                                                                                                                                                                                                                  tmp = -((-1.0e0) * u0) / ((cos2phi / alphax) / alphax)
                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                  tmp = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                              end if
                                                                                                                                                                                                                                                                                              code = tmp
                                                                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                          	tmp = Float32(0.0)
                                                                                                                                                                                                                                                                                          	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                          		tmp = Float32(Float32(-Float32(Float32(-1.0) * u0)) / Float32(Float32(cos2phi / alphax) / alphax));
                                                                                                                                                                                                                                                                                          	else
                                                                                                                                                                                                                                                                                          		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                                                          	end
                                                                                                                                                                                                                                                                                          	return tmp
                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                          	tmp = single(0.0);
                                                                                                                                                                                                                                                                                          	if ((sin2phi / (alphay * alphay)) <= single(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                          		tmp = -(single(-1.0) * u0) / ((cos2phi / alphax) / alphax);
                                                                                                                                                                                                                                                                                          	else
                                                                                                                                                                                                                                                                                          		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                          	end
                                                                                                                                                                                                                                                                                          	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          \begin{array}{l}
                                                                                                                                                                                                                                                                                          \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                                                          \;\;\;\;\frac{--1 \cdot u0}{\frac{\frac{cos2phi}{alphax}}{alphax}}\\
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          \mathbf{else}:\\
                                                                                                                                                                                                                                                                                          \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                          Derivation
                                                                                                                                                                                                                                                                                          1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                          2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                                            1. Initial program 60.4%

                                                                                                                                                                                                                                                                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                              1. Applied rewrites60.4%

                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                              2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                1. Applied rewrites21.6%

                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                  1. Applied rewrites23.2%

                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                    1. Applied rewrites23.3%

                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{--1 \cdot u0}{\frac{\frac{cos2phi}{alphax}}{alphax}} \]

                                                                                                                                                                                                                                                                                                    if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                                                    1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                      1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                        \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                        1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                                        2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                                          \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                          1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                          2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                            1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                          4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                          5. Add Preprocessing

                                                                                                                                                                                                                                                                                                          Alternative 27: 65.7% accurate, 1.3× speedup?

                                                                                                                                                                                                                                                                                                          \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                                                          \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;-\frac{-u0}{\frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                                                                          (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                                            :precision binary32
                                                                                                                                                                                                                                                                                                            :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                                              (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                                                         (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                                                    (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                                               (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                                            (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                                                            (- (/ (- u0) (/ cos2phi (* alphax alphax))))
                                                                                                                                                                                                                                                                                                            (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                                                                          float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                                                          	float tmp;
                                                                                                                                                                                                                                                                                                          	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                                                                          		tmp = -(-u0 / (cos2phi / (alphax * alphax)));
                                                                                                                                                                                                                                                                                                          	} else {
                                                                                                                                                                                                                                                                                                          		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                          	}
                                                                                                                                                                                                                                                                                                          	return tmp;
                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                          use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                              real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                                              real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                                              real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                                              real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                                              real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                                              real(4) :: tmp
                                                                                                                                                                                                                                                                                                              if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10) then
                                                                                                                                                                                                                                                                                                                  tmp = -(-u0 / (cos2phi / (alphax * alphax)))
                                                                                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                                                                                  tmp = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                                              end if
                                                                                                                                                                                                                                                                                                              code = tmp
                                                                                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                          	tmp = Float32(0.0)
                                                                                                                                                                                                                                                                                                          	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                          		tmp = Float32(-Float32(Float32(-u0) / Float32(cos2phi / Float32(alphax * alphax))));
                                                                                                                                                                                                                                                                                                          	else
                                                                                                                                                                                                                                                                                                          		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                                                                          	end
                                                                                                                                                                                                                                                                                                          	return tmp
                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                          	tmp = single(0.0);
                                                                                                                                                                                                                                                                                                          	if ((sin2phi / (alphay * alphay)) <= single(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                          		tmp = -(-u0 / (cos2phi / (alphax * alphax)));
                                                                                                                                                                                                                                                                                                          	else
                                                                                                                                                                                                                                                                                                          		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                          	end
                                                                                                                                                                                                                                                                                                          	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          \begin{array}{l}
                                                                                                                                                                                                                                                                                                          \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                                                                          \;\;\;\;-\frac{-u0}{\frac{cos2phi}{alphax \cdot alphax}}\\
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                          \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                          Derivation
                                                                                                                                                                                                                                                                                                          1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                          2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                                                            1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                              \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                              1. Applied rewrites60.4%

                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                              2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                1. Applied rewrites21.6%

                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                  1. Applied rewrites23.2%

                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                  2. Applied rewrites23.3%

                                                                                                                                                                                                                                                                                                                    \[\leadsto -\frac{-u0}{\frac{cos2phi}{alphax \cdot alphax}} \]

                                                                                                                                                                                                                                                                                                                  if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                                                                  1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                    1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                      \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                      1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                      2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                                                        \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                        1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                                                          \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                        2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                          1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                        4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                        5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                        Alternative 28: 65.7% accurate, 1.3× speedup?

                                                                                                                                                                                                                                                                                                                        \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                                                                        \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;\frac{\left(-\left(-u0\right)\right) \cdot \left(alphax \cdot alphax\right)}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                        (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                                                          :precision binary32
                                                                                                                                                                                                                                                                                                                          :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                                                            (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                                                                       (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                                                                  (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                                                             (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                                                          (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                                                                          (/ (* (- (- u0)) (* alphax alphax)) cos2phi)
                                                                                                                                                                                                                                                                                                                          (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                                                                                        float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                                                                        	float tmp;
                                                                                                                                                                                                                                                                                                                        	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                                                                                        		tmp = (-(-u0) * (alphax * alphax)) / cos2phi;
                                                                                                                                                                                                                                                                                                                        	} else {
                                                                                                                                                                                                                                                                                                                        		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                        	}
                                                                                                                                                                                                                                                                                                                        	return tmp;
                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                        use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                                                            real(4) :: tmp
                                                                                                                                                                                                                                                                                                                            if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10) then
                                                                                                                                                                                                                                                                                                                                tmp = (-(-u0) * (alphax * alphax)) / cos2phi
                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                                tmp = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                                                            end if
                                                                                                                                                                                                                                                                                                                            code = tmp
                                                                                                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                        	tmp = Float32(0.0)
                                                                                                                                                                                                                                                                                                                        	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                                        		tmp = Float32(Float32(Float32(-Float32(-u0)) * Float32(alphax * alphax)) / cos2phi);
                                                                                                                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                                                                                                                        		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                                                                                                                        	return tmp
                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                        	tmp = single(0.0);
                                                                                                                                                                                                                                                                                                                        	if ((sin2phi / (alphay * alphay)) <= single(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                                        		tmp = (-(-u0) * (alphax * alphax)) / cos2phi;
                                                                                                                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                                                                                                                        		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                                                                                                                        	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                                                                                                                        \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                                                                                        \;\;\;\;\frac{\left(-\left(-u0\right)\right) \cdot \left(alphax \cdot alphax\right)}{cos2phi}\\
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                        \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                        Derivation
                                                                                                                                                                                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                                        2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                                                                          1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                          2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                            1. Applied rewrites75.7%

                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{--1 \cdot u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                              1. Applied rewrites75.6%

                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\left(-u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right)} \cdot \left(alphax \cdot alphax\right) \]
                                                                                                                                                                                                                                                                                                                              2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\left(-u0\right)}{cos2phi} \cdot \left(alphax \cdot alphax\right) \]
                                                                                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                1. Applied rewrites23.3%

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

                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{\left(-\left(-u0\right)\right) \cdot \left(alphax \cdot alphax\right)}{cos2phi} \]

                                                                                                                                                                                                                                                                                                                                  if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                                                                                  1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                                    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                      \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                      2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                                                                        \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                                                                          \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                        2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                        4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                                        5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                        Alternative 29: 65.7% accurate, 1.3× speedup?

                                                                                                                                                                                                                                                                                                                                        \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                                                                                        \[\begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;\left(-\left(-u0\right)\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                        (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                                                                          :precision binary32
                                                                                                                                                                                                                                                                                                                                          :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                                                                            (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                                                                                       (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                                                                                  (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                                                                             (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                                                                          (if (<= (/ sin2phi (* alphay alphay)) 1.000000013351432e-10)
                                                                                                                                                                                                                                                                                                                                          (* (- (- u0)) (/ (* alphax alphax) cos2phi))
                                                                                                                                                                                                                                                                                                                                          (* (/ (* alphay u0) sin2phi) alphay)))
                                                                                                                                                                                                                                                                                                                                        float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                                                                                        	float tmp;
                                                                                                                                                                                                                                                                                                                                        	if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10f) {
                                                                                                                                                                                                                                                                                                                                        		tmp = -(-u0) * ((alphax * alphax) / cos2phi);
                                                                                                                                                                                                                                                                                                                                        	} else {
                                                                                                                                                                                                                                                                                                                                        		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                                        	}
                                                                                                                                                                                                                                                                                                                                        	return tmp;
                                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                        use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                                                                            real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                                                                            real(4) :: tmp
                                                                                                                                                                                                                                                                                                                                            if ((sin2phi / (alphay * alphay)) <= 1.000000013351432e-10) then
                                                                                                                                                                                                                                                                                                                                                tmp = -(-u0) * ((alphax * alphax) / cos2phi)
                                                                                                                                                                                                                                                                                                                                            else
                                                                                                                                                                                                                                                                                                                                                tmp = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                                                                            end if
                                                                                                                                                                                                                                                                                                                                            code = tmp
                                                                                                                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                        	tmp = Float32(0.0)
                                                                                                                                                                                                                                                                                                                                        	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                                                        		tmp = Float32(Float32(-Float32(-u0)) * Float32(Float32(alphax * alphax) / cos2phi));
                                                                                                                                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                                                                                                                                        		tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay);
                                                                                                                                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                                                                                                                                        	return tmp
                                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                        	tmp = single(0.0);
                                                                                                                                                                                                                                                                                                                                        	if ((sin2phi / (alphay * alphay)) <= single(1.000000013351432e-10))
                                                                                                                                                                                                                                                                                                                                        		tmp = -(-u0) * ((alphax * alphax) / cos2phi);
                                                                                                                                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                                                                                                                                        		tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                                                                                                                                        	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                        \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.000000013351432 \cdot 10^{-10}:\\
                                                                                                                                                                                                                                                                                                                                        \;\;\;\;\left(-\left(-u0\right)\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                        \;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                        Derivation
                                                                                                                                                                                                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                                                        2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.00000001e-10

                                                                                                                                                                                                                                                                                                                                          1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                                            \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites60.4%

                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(\frac{sin2phi}{alphay \cdot alphay}, alphax \cdot alphax, cos2phi\right) \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                                            2. Taylor expanded in alphax around 0

                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites21.6%

                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{-\log \left(1 - u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                                              2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites23.2%

                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{--1 \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}} \]
                                                                                                                                                                                                                                                                                                                                                2. Applied rewrites23.3%

                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \left(-\left(-u0\right)\right) \cdot \frac{alphax \cdot alphax}{cos2phi} \]

                                                                                                                                                                                                                                                                                                                                                if 1.00000001e-10 < (/.f32 sin2phi (*.f32 alphay alphay))

                                                                                                                                                                                                                                                                                                                                                1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                                                  \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                    2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                      2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                      Alternative 30: 59.1% accurate, 2.8× speedup?

                                                                                                                                                                                                                                                                                                                                                      \[\left(\left(\left(\left(0.0001 \leq alphax \land alphax \leq 1\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right)\right) \land \left(0 \leq cos2phi \land cos2phi \leq 1\right)\right) \land 0 \leq sin2phi\]
                                                                                                                                                                                                                                                                                                                                                      \[\frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                      (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                                                                                        :precision binary32
                                                                                                                                                                                                                                                                                                                                                        :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0))
                                                                                                                                                                                                                                                                                                                                                                          (and (<= 0.0001 alphay) (<= alphay 1.0)))
                                                                                                                                                                                                                                                                                                                                                                     (and (<= 2.328306437e-10 u0) (<= u0 1.0)))
                                                                                                                                                                                                                                                                                                                                                                (and (<= 0.0 cos2phi) (<= cos2phi 1.0)))
                                                                                                                                                                                                                                                                                                                                                           (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                                                                                        (* (/ (* alphay u0) sin2phi) alphay))
                                                                                                                                                                                                                                                                                                                                                      float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
                                                                                                                                                                                                                                                                                                                                                      	return ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                          real(4), intent (in) :: alphax
                                                                                                                                                                                                                                                                                                                                                          real(4), intent (in) :: alphay
                                                                                                                                                                                                                                                                                                                                                          real(4), intent (in) :: u0
                                                                                                                                                                                                                                                                                                                                                          real(4), intent (in) :: cos2phi
                                                                                                                                                                                                                                                                                                                                                          real(4), intent (in) :: sin2phi
                                                                                                                                                                                                                                                                                                                                                          code = ((alphay * u0) / sin2phi) * alphay
                                                                                                                                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      function code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                                      	return Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay)
                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
                                                                                                                                                                                                                                                                                                                                                      	tmp = ((alphay * u0) / sin2phi) * alphay;
                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      \frac{alphay \cdot u0}{sin2phi} \cdot alphay
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                                                                                                      1. Initial program 60.4%

                                                                                                                                                                                                                                                                                                                                                        \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
                                                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \left(-\log \left(1 - u0\right)\right) \cdot \frac{alphay}{\mathsf{fma}\left(\frac{cos2phi}{alphax \cdot alphax}, alphay, \frac{sin2phi}{alphay}\right)} \]
                                                                                                                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites60.8%

                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{-\log \left(1 - u0\right)}{\mathsf{fma}\left(alphay, \frac{cos2phi}{alphax \cdot alphax}, \frac{sin2phi}{alphay}\right)} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                          2. Taylor expanded in alphax around inf

                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites49.1%

                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \left(-1 \cdot \frac{alphay \cdot \log \left(1 - u0\right)}{sin2phi}\right) \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                            2. Taylor expanded in u0 around 0

                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites59.1%

                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{alphay \cdot u0}{sin2phi} \cdot alphay \]
                                                                                                                                                                                                                                                                                                                                                              2. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                              Reproduce

                                                                                                                                                                                                                                                                                                                                                              ?
                                                                                                                                                                                                                                                                                                                                                              herbie shell --seed 2026086 
                                                                                                                                                                                                                                                                                                                                                              (FPCore (alphax alphay u0 cos2phi sin2phi)
                                                                                                                                                                                                                                                                                                                                                                :name "Beckmann Distribution sample, tan2theta, alphax != alphay, u1 <= 0.5"
                                                                                                                                                                                                                                                                                                                                                                :precision binary32
                                                                                                                                                                                                                                                                                                                                                                :pre (and (and (and (and (and (<= 0.0001 alphax) (<= alphax 1.0)) (and (<= 0.0001 alphay) (<= alphay 1.0))) (and (<= 2.328306437e-10 u0) (<= u0 1.0))) (and (<= 0.0 cos2phi) (<= cos2phi 1.0))) (<= 0.0 sin2phi))
                                                                                                                                                                                                                                                                                                                                                                (/ (- (log (- 1.0 u0))) (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))