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

Percentage Accurate: 60.8% → 98.5%
Time: 13.9s
Alternatives: 14
Speedup: 12.7×

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\]
\[\begin{array}{l} \\ \frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (- (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)
    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
\begin{array}{l}

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

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (- (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)
    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
\begin{array}{l}

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

Alternative 1: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot \left(-alphax\right)\right)}{\frac{sin2phi}{\frac{alphay}{alphax}} + \frac{cos2phi}{\frac{alphax}{alphay}}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (* (log1p (- u0)) (* alphay (- alphax)))
  (+ (/ sin2phi (/ alphay alphax)) (/ cos2phi (/ alphax alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return (log1pf(-u0) * (alphay * -alphax)) / ((sin2phi / (alphay / alphax)) + (cos2phi / (alphax / alphay)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(log1p(Float32(-u0)) * Float32(alphay * Float32(-alphax))) / Float32(Float32(sin2phi / Float32(alphay / alphax)) + Float32(cos2phi / Float32(alphax / alphay))))
end
\begin{array}{l}

\\
\frac{\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot \left(-alphax\right)\right)}{\frac{sin2phi}{\frac{alphay}{alphax}} + \frac{cos2phi}{\frac{alphax}{alphay}}}
\end{array}
Derivation
  1. Initial program 57.7%

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

      \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    3. --rgt-identity57.7%

      \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    4. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    5. --rgt-identity57.7%

      \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    6. neg-sub057.7%

      \[\leadsto \frac{\color{blue}{-\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    7. sub-neg57.7%

      \[\leadsto \frac{-\log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    8. log1p-def97.6%

      \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified97.6%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Step-by-step derivation
    1. +-commutative97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    2. associate-/r*97.5%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}} + \frac{cos2phi}{alphax \cdot alphax}} \]
    3. associate-/r*97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}}} \]
    4. frac-add97.3%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  5. Applied egg-rr97.3%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u95.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)\right)} \]
    2. expm1-udef52.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)} - 1} \]
    3. associate-/r/52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)}\right)} - 1 \]
    4. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{alphax \cdot \frac{sin2phi}{alphay}} + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    5. fma-def52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    6. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \color{blue}{\left(alphax \cdot alphay\right)}\right)} - 1 \]
  7. Applied egg-rr52.3%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)} - 1} \]
  8. Step-by-step derivation
    1. expm1-def96.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)\right)} \]
    2. expm1-log1p98.4%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  9. Simplified98.4%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  10. Taylor expanded in alphax around 0 98.6%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}}} \cdot \left(alphax \cdot alphay\right) \]
  11. Step-by-step derivation
    1. associate-*l/98.4%

      \[\leadsto \color{blue}{\frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(alphax \cdot alphay\right)}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}}} \]
    2. associate-/l*98.6%

      \[\leadsto \frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(alphax \cdot alphay\right)}{\color{blue}{\frac{sin2phi}{\frac{alphay}{alphax}}} + \frac{cos2phi \cdot alphay}{alphax}} \]
    3. associate-/l*98.7%

      \[\leadsto \frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(alphax \cdot alphay\right)}{\frac{sin2phi}{\frac{alphay}{alphax}} + \color{blue}{\frac{cos2phi}{\frac{alphax}{alphay}}}} \]
  12. Applied egg-rr98.7%

    \[\leadsto \color{blue}{\frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(alphax \cdot alphay\right)}{\frac{sin2phi}{\frac{alphay}{alphax}} + \frac{cos2phi}{\frac{alphax}{alphay}}}} \]
  13. Final simplification98.7%

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

Alternative 2: 98.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(alphax \cdot alphay\right) \cdot \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (*
  (* alphax alphay)
  (/
   (- (log1p (- u0)))
   (+ (/ (* alphax sin2phi) alphay) (/ (* alphay cos2phi) alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return (alphax * alphay) * (-log1pf(-u0) / (((alphax * sin2phi) / alphay) + ((alphay * cos2phi) / alphax)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(alphax * alphay) * Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(Float32(alphax * sin2phi) / alphay) + Float32(Float32(alphay * cos2phi) / alphax))))
end
\begin{array}{l}

\\
\left(alphax \cdot alphay\right) \cdot \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}
\end{array}
Derivation
  1. Initial program 57.7%

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

      \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    3. --rgt-identity57.7%

      \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    4. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    5. --rgt-identity57.7%

      \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    6. neg-sub057.7%

      \[\leadsto \frac{\color{blue}{-\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    7. sub-neg57.7%

      \[\leadsto \frac{-\log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    8. log1p-def97.6%

      \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified97.6%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Step-by-step derivation
    1. +-commutative97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    2. associate-/r*97.5%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}} + \frac{cos2phi}{alphax \cdot alphax}} \]
    3. associate-/r*97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}}} \]
    4. frac-add97.3%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  5. Applied egg-rr97.3%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u95.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)\right)} \]
    2. expm1-udef52.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)} - 1} \]
    3. associate-/r/52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)}\right)} - 1 \]
    4. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{alphax \cdot \frac{sin2phi}{alphay}} + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    5. fma-def52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    6. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \color{blue}{\left(alphax \cdot alphay\right)}\right)} - 1 \]
  7. Applied egg-rr52.3%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)} - 1} \]
  8. Step-by-step derivation
    1. expm1-def96.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)\right)} \]
    2. expm1-log1p98.4%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  9. Simplified98.4%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  10. Taylor expanded in alphax around 0 98.6%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}}} \cdot \left(alphax \cdot alphay\right) \]
  11. Final simplification98.6%

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

Alternative 3: 92.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.0012000000569969416:\\ \;\;\;\;\left(alphax \cdot alphay\right) \cdot \frac{u0 - \left(u0 \cdot u0\right) \cdot -0.5}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot \left(-alphay\right)\right)\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (if (<= (/ sin2phi (* alphay alphay)) 0.0012000000569969416)
   (*
    (* alphax alphay)
    (/
     (- u0 (* (* u0 u0) -0.5))
     (+ (/ (* alphax sin2phi) alphay) (/ (* alphay cos2phi) alphax))))
   (* (/ (log1p (- u0)) sin2phi) (* alphay (- alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 0.0012000000569969416f) {
		tmp = (alphax * alphay) * ((u0 - ((u0 * u0) * -0.5f)) / (((alphax * sin2phi) / alphay) + ((alphay * cos2phi) / alphax)));
	} 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(0.0012000000569969416))
		tmp = Float32(Float32(alphax * alphay) * Float32(Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5))) / Float32(Float32(Float32(alphax * sin2phi) / alphay) + Float32(Float32(alphay * cos2phi) / alphax))));
	else
		tmp = Float32(Float32(log1p(Float32(-u0)) / sin2phi) * Float32(alphay * Float32(-alphay)));
	end
	return tmp
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.0012000000569969416:\\
\;\;\;\;\left(alphax \cdot alphay\right) \cdot \frac{u0 - \left(u0 \cdot u0\right) \cdot -0.5}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot \left(-alphay\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.00120000006

    1. Initial program 54.9%

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

        \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
      2. div-sub54.9%

        \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
      3. --rgt-identity54.9%

        \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
      4. div-sub54.9%

        \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
      5. --rgt-identity54.9%

        \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
      6. neg-sub054.9%

        \[\leadsto \frac{\color{blue}{-\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
      7. sub-neg54.9%

        \[\leadsto \frac{-\log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
      8. log1p-def98.6%

        \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified98.6%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Step-by-step derivation
      1. +-commutative98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
      2. associate-/r*98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}} + \frac{cos2phi}{alphax \cdot alphax}} \]
      3. associate-/r*98.8%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}}} \]
      4. frac-add98.2%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
    5. Applied egg-rr98.2%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u94.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)\right)} \]
      2. expm1-udef84.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)} - 1} \]
      3. associate-/r/84.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)}\right)} - 1 \]
      4. *-commutative84.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{alphax \cdot \frac{sin2phi}{alphay}} + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
      5. fma-def84.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
      6. *-commutative84.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \color{blue}{\left(alphax \cdot alphay\right)}\right)} - 1 \]
    7. Applied egg-rr84.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def94.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)\right)} \]
      2. expm1-log1p98.4%

        \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
    9. Simplified98.4%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
    10. Taylor expanded in alphax around 0 98.3%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}}} \cdot \left(alphax \cdot alphay\right) \]
    11. Taylor expanded in u0 around 0 86.2%

      \[\leadsto \frac{-\color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)}}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}} \cdot \left(alphax \cdot alphay\right) \]
    12. Step-by-step derivation
      1. neg-mul-137.8%

        \[\leadsto -\left(\left(\color{blue}{\left(-u0\right)} + -0.5 \cdot {u0}^{2}\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      2. +-commutative37.8%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. unsub-neg37.8%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      4. *-commutative37.8%

        \[\leadsto -\left(\left(\color{blue}{{u0}^{2} \cdot -0.5} - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      5. unpow237.8%

        \[\leadsto -\left(\left(\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    13. Simplified86.2%

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

    if 0.00120000006 < (/.f32 sin2phi (*.f32 alphay alphay))

    1. Initial program 59.8%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*59.8%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified59.8%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in cos2phi around 0 62.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    5. Step-by-step derivation
      1. mul-1-neg62.1%

        \[\leadsto \color{blue}{-\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
      2. unpow262.1%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot \log \left(1 - u0\right)}{sin2phi} \]
      3. *-commutative62.1%

        \[\leadsto -\frac{\color{blue}{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}}{sin2phi} \]
    6. Simplified62.1%

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

      \[\leadsto -\color{blue}{\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    8. Step-by-step derivation
      1. associate-/l*61.8%

        \[\leadsto -\color{blue}{\frac{{alphay}^{2}}{\frac{sin2phi}{\log \left(1 - u0\right)}}} \]
      2. sub-neg61.8%

        \[\leadsto -\frac{{alphay}^{2}}{\frac{sin2phi}{\log \color{blue}{\left(1 + \left(-u0\right)\right)}}} \]
      3. log1p-def98.1%

        \[\leadsto -\frac{{alphay}^{2}}{\frac{sin2phi}{\color{blue}{\mathsf{log1p}\left(-u0\right)}}} \]
      4. associate-/l*98.7%

        \[\leadsto -\color{blue}{\frac{{alphay}^{2} \cdot \mathsf{log1p}\left(-u0\right)}{sin2phi}} \]
      5. *-commutative98.7%

        \[\leadsto -\frac{\color{blue}{\mathsf{log1p}\left(-u0\right) \cdot {alphay}^{2}}}{sin2phi} \]
      6. associate-*l/98.6%

        \[\leadsto -\color{blue}{\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot {alphay}^{2}} \]
      7. *-commutative98.6%

        \[\leadsto -\color{blue}{{alphay}^{2} \cdot \frac{\mathsf{log1p}\left(-u0\right)}{sin2phi}} \]
      8. unpow298.6%

        \[\leadsto -\color{blue}{\left(alphay \cdot alphay\right)} \cdot \frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \]
    9. Simplified98.6%

      \[\leadsto -\color{blue}{\left(alphay \cdot alphay\right) \cdot \frac{\mathsf{log1p}\left(-u0\right)}{sin2phi}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.0012000000569969416:\\ \;\;\;\;\left(alphax \cdot alphay\right) \cdot \frac{u0 - \left(u0 \cdot u0\right) \cdot -0.5}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot \left(-alphay\right)\right)\\ \end{array} \]

Alternative 4: 98.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (- (log1p (- u0)))
  (+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return -log1pf(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax))))
end
\begin{array}{l}

\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Derivation
  1. Initial program 57.7%

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

      \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    3. --rgt-identity57.7%

      \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    4. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    5. --rgt-identity57.7%

      \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    6. neg-sub057.7%

      \[\leadsto \frac{\color{blue}{-\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    7. sub-neg57.7%

      \[\leadsto \frac{-\log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    8. log1p-def97.6%

      \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified97.6%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Final simplification97.6%

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

Alternative 5: 98.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (- (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(Float32(cos2phi / alphax) / alphax) + Float32(sin2phi / Float32(alphay * alphay))))
end
\begin{array}{l}

\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Derivation
  1. Initial program 57.7%

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

      \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    3. --rgt-identity57.7%

      \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    4. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    5. --rgt-identity57.7%

      \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    6. sub-neg57.7%

      \[\leadsto \frac{0 - \log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    7. +-commutative57.7%

      \[\leadsto \frac{0 - \log \color{blue}{\left(\left(-u0\right) + 1\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    8. neg-sub057.7%

      \[\leadsto \frac{0 - \log \left(\color{blue}{\left(0 - u0\right)} + 1\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    9. associate-+l-57.7%

      \[\leadsto \frac{0 - \log \color{blue}{\left(0 - \left(u0 - 1\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    10. sub0-neg57.7%

      \[\leadsto \frac{0 - \log \color{blue}{\left(-\left(u0 - 1\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    11. neg-mul-157.7%

      \[\leadsto \frac{0 - \log \color{blue}{\left(-1 \cdot \left(u0 - 1\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    12. log-prod-0.0%

      \[\leadsto \frac{0 - \color{blue}{\left(\log -1 + \log \left(u0 - 1\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    13. associate--r+-0.0%

      \[\leadsto \frac{\color{blue}{\left(0 - \log -1\right) - \log \left(u0 - 1\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified97.6%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Final simplification97.6%

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

Alternative 6: 81.3% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t_0 \leq 0.00015999999595806003:\\ \;\;\;\;u0 \cdot \frac{1}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi} - \frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (let* ((t_0 (/ sin2phi (* alphay alphay))))
   (if (<= t_0 0.00015999999595806003)
     (* u0 (/ 1.0 (+ t_0 (/ cos2phi (* alphax alphax)))))
     (-
      (* (* alphay alphay) (/ u0 sin2phi))
      (/ (* alphay (* alphay (* u0 u0))) (/ sin2phi -0.5))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float t_0 = sin2phi / (alphay * alphay);
	float tmp;
	if (t_0 <= 0.00015999999595806003f) {
		tmp = u0 * (1.0f / (t_0 + (cos2phi / (alphax * alphax))));
	} else {
		tmp = ((alphay * alphay) * (u0 / sin2phi)) - ((alphay * (alphay * (u0 * u0))) / (sin2phi / -0.5f));
	}
	return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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) :: t_0
    real(4) :: tmp
    t_0 = sin2phi / (alphay * alphay)
    if (t_0 <= 0.00015999999595806003e0) then
        tmp = u0 * (1.0e0 / (t_0 + (cos2phi / (alphax * alphax))))
    else
        tmp = ((alphay * alphay) * (u0 / sin2phi)) - ((alphay * (alphay * (u0 * u0))) / (sin2phi / (-0.5e0)))
    end if
    code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = Float32(sin2phi / Float32(alphay * alphay))
	tmp = Float32(0.0)
	if (t_0 <= Float32(0.00015999999595806003))
		tmp = Float32(u0 * Float32(Float32(1.0) / Float32(t_0 + Float32(cos2phi / Float32(alphax * alphax)))));
	else
		tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)) - Float32(Float32(alphay * Float32(alphay * Float32(u0 * u0))) / Float32(sin2phi / Float32(-0.5))));
	end
	return tmp
end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = sin2phi / (alphay * alphay);
	tmp = single(0.0);
	if (t_0 <= single(0.00015999999595806003))
		tmp = u0 * (single(1.0) / (t_0 + (cos2phi / (alphax * alphax))));
	else
		tmp = ((alphay * alphay) * (u0 / sin2phi)) - ((alphay * (alphay * (u0 * u0))) / (sin2phi / single(-0.5)));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.00015999999595806003:\\
\;\;\;\;u0 \cdot \frac{1}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\

\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi} - \frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.59999996e-4

    1. Initial program 54.9%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*54.9%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified54.9%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified74.1%

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

        \[\leadsto \color{blue}{u0 \cdot \frac{1}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
      2. +-commutative74.2%

        \[\leadsto u0 \cdot \frac{1}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    8. Applied egg-rr74.2%

      \[\leadsto \color{blue}{u0 \cdot \frac{1}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]

    if 1.59999996e-4 < (/.f32 sin2phi (*.f32 alphay alphay))

    1. Initial program 59.6%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*59.6%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified59.6%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in cos2phi around 0 61.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    5. Step-by-step derivation
      1. mul-1-neg61.3%

        \[\leadsto \color{blue}{-\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
      2. unpow261.3%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot \log \left(1 - u0\right)}{sin2phi} \]
      3. *-commutative61.3%

        \[\leadsto -\frac{\color{blue}{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}}{sin2phi} \]
    6. Simplified61.3%

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

      \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{{u0}^{2} \cdot {alphay}^{2}}{sin2phi} + -1 \cdot \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg88.0%

        \[\leadsto -\left(-0.5 \cdot \frac{{u0}^{2} \cdot {alphay}^{2}}{sin2phi} + \color{blue}{\left(-\frac{u0 \cdot {alphay}^{2}}{sin2phi}\right)}\right) \]
      2. unsub-neg88.0%

        \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{{u0}^{2} \cdot {alphay}^{2}}{sin2phi} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right)} \]
      3. associate-*r/88.0%

        \[\leadsto -\left(\color{blue}{\frac{-0.5 \cdot \left({u0}^{2} \cdot {alphay}^{2}\right)}{sin2phi}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      4. *-commutative88.0%

        \[\leadsto -\left(\frac{\color{blue}{\left({u0}^{2} \cdot {alphay}^{2}\right) \cdot -0.5}}{sin2phi} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      5. associate-/l*88.0%

        \[\leadsto -\left(\color{blue}{\frac{{u0}^{2} \cdot {alphay}^{2}}{\frac{sin2phi}{-0.5}}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      6. *-commutative88.0%

        \[\leadsto -\left(\frac{\color{blue}{{alphay}^{2} \cdot {u0}^{2}}}{\frac{sin2phi}{-0.5}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      7. unpow288.0%

        \[\leadsto -\left(\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot {u0}^{2}}{\frac{sin2phi}{-0.5}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      8. associate-*l*88.0%

        \[\leadsto -\left(\frac{\color{blue}{alphay \cdot \left(alphay \cdot {u0}^{2}\right)}}{\frac{sin2phi}{-0.5}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      9. unpow288.0%

        \[\leadsto -\left(\frac{alphay \cdot \left(alphay \cdot \color{blue}{\left(u0 \cdot u0\right)}\right)}{\frac{sin2phi}{-0.5}} - \frac{u0 \cdot {alphay}^{2}}{sin2phi}\right) \]
      10. associate-/l*86.7%

        \[\leadsto -\left(\frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}} - \color{blue}{\frac{u0}{\frac{sin2phi}{{alphay}^{2}}}}\right) \]
      11. associate-/r/88.1%

        \[\leadsto -\left(\frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}} - \color{blue}{\frac{u0}{sin2phi} \cdot {alphay}^{2}}\right) \]
      12. unpow288.1%

        \[\leadsto -\left(\frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}} - \frac{u0}{sin2phi} \cdot \color{blue}{\left(alphay \cdot alphay\right)}\right) \]
    9. Simplified88.1%

      \[\leadsto -\color{blue}{\left(\frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}} - \frac{u0}{sin2phi} \cdot \left(alphay \cdot alphay\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.00015999999595806003:\\ \;\;\;\;u0 \cdot \frac{1}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi} - \frac{alphay \cdot \left(alphay \cdot \left(u0 \cdot u0\right)\right)}{\frac{sin2phi}{-0.5}}\\ \end{array} \]

Alternative 7: 87.5% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \left(alphax \cdot alphay\right) \cdot \frac{u0 - \left(u0 \cdot u0\right) \cdot -0.5}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (*
  (* alphax alphay)
  (/
   (- u0 (* (* u0 u0) -0.5))
   (+ (/ (* alphax sin2phi) alphay) (/ (* alphay cos2phi) alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return (alphax * alphay) * ((u0 - ((u0 * u0) * -0.5f)) / (((alphax * sin2phi) / alphay) + ((alphay * cos2phi) / alphax)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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 = (alphax * alphay) * ((u0 - ((u0 * u0) * (-0.5e0))) / (((alphax * sin2phi) / alphay) + ((alphay * cos2phi) / alphax)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(alphax * alphay) * Float32(Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5))) / Float32(Float32(Float32(alphax * sin2phi) / alphay) + Float32(Float32(alphay * cos2phi) / alphax))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = (alphax * alphay) * ((u0 - ((u0 * u0) * single(-0.5))) / (((alphax * sin2phi) / alphay) + ((alphay * cos2phi) / alphax)));
end
\begin{array}{l}

\\
\left(alphax \cdot alphay\right) \cdot \frac{u0 - \left(u0 \cdot u0\right) \cdot -0.5}{\frac{alphax \cdot sin2phi}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}
\end{array}
Derivation
  1. Initial program 57.7%

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

      \[\leadsto \frac{\color{blue}{0 - \log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    3. --rgt-identity57.7%

      \[\leadsto \frac{0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} - \frac{\color{blue}{\log \left(1 - u0\right) - 0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    4. div-sub57.7%

      \[\leadsto \color{blue}{\frac{0 - \left(\log \left(1 - u0\right) - 0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    5. --rgt-identity57.7%

      \[\leadsto \frac{0 - \color{blue}{\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    6. neg-sub057.7%

      \[\leadsto \frac{\color{blue}{-\log \left(1 - u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    7. sub-neg57.7%

      \[\leadsto \frac{-\log \color{blue}{\left(1 + \left(-u0\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    8. log1p-def97.6%

      \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified97.6%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Step-by-step derivation
    1. +-commutative97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    2. associate-/r*97.5%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}} + \frac{cos2phi}{alphax \cdot alphax}} \]
    3. associate-/r*97.6%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}}} \]
    4. frac-add97.3%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  5. Applied egg-rr97.3%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u95.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)\right)} \]
    2. expm1-udef52.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}}{alphay \cdot alphax}}\right)} - 1} \]
    3. associate-/r/52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay} \cdot alphax + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)}\right)} - 1 \]
    4. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{alphax \cdot \frac{sin2phi}{alphay}} + alphay \cdot \frac{cos2phi}{alphax}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    5. fma-def52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)}} \cdot \left(alphay \cdot alphax\right)\right)} - 1 \]
    6. *-commutative52.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \color{blue}{\left(alphax \cdot alphay\right)}\right)} - 1 \]
  7. Applied egg-rr52.3%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)} - 1} \]
  8. Step-by-step derivation
    1. expm1-def96.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)\right)\right)} \]
    2. expm1-log1p98.4%

      \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  9. Simplified98.4%

    \[\leadsto \color{blue}{\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphax, \frac{sin2phi}{alphay}, alphay \cdot \frac{cos2phi}{alphax}\right)} \cdot \left(alphax \cdot alphay\right)} \]
  10. Taylor expanded in alphax around 0 98.6%

    \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}}} \cdot \left(alphax \cdot alphay\right) \]
  11. Taylor expanded in u0 around 0 87.6%

    \[\leadsto \frac{-\color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)}}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}} \cdot \left(alphax \cdot alphay\right) \]
  12. Step-by-step derivation
    1. neg-mul-166.0%

      \[\leadsto -\left(\left(\color{blue}{\left(-u0\right)} + -0.5 \cdot {u0}^{2}\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    2. +-commutative66.0%

      \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    3. unsub-neg66.0%

      \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    4. *-commutative66.0%

      \[\leadsto -\left(\left(\color{blue}{{u0}^{2} \cdot -0.5} - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    5. unpow266.0%

      \[\leadsto -\left(\left(\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
  13. Simplified87.6%

    \[\leadsto \frac{-\color{blue}{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)}}{\frac{sin2phi \cdot alphax}{alphay} + \frac{cos2phi \cdot alphay}{alphax}} \cdot \left(alphax \cdot alphay\right) \]
  14. Final simplification87.6%

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

Alternative 8: 81.3% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t_0 \leq 0.00015999999595806003:\\ \;\;\;\;u0 \cdot \frac{1}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (let* ((t_0 (/ sin2phi (* alphay alphay))))
   (if (<= t_0 0.00015999999595806003)
     (* u0 (/ 1.0 (+ t_0 (/ cos2phi (* alphax alphax)))))
     (/ (* (* alphay alphay) (- u0 (* u0 (* u0 -0.5)))) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float t_0 = sin2phi / (alphay * alphay);
	float tmp;
	if (t_0 <= 0.00015999999595806003f) {
		tmp = u0 * (1.0f / (t_0 + (cos2phi / (alphax * alphax))));
	} else {
		tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * -0.5f)))) / sin2phi;
	}
	return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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) :: t_0
    real(4) :: tmp
    t_0 = sin2phi / (alphay * alphay)
    if (t_0 <= 0.00015999999595806003e0) then
        tmp = u0 * (1.0e0 / (t_0 + (cos2phi / (alphax * alphax))))
    else
        tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * (-0.5e0))))) / sin2phi
    end if
    code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = Float32(sin2phi / Float32(alphay * alphay))
	tmp = Float32(0.0)
	if (t_0 <= Float32(0.00015999999595806003))
		tmp = Float32(u0 * Float32(Float32(1.0) / Float32(t_0 + Float32(cos2phi / Float32(alphax * alphax)))));
	else
		tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5))))) / sin2phi);
	end
	return tmp
end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = sin2phi / (alphay * alphay);
	tmp = single(0.0);
	if (t_0 <= single(0.00015999999595806003))
		tmp = u0 * (single(1.0) / (t_0 + (cos2phi / (alphax * alphax))));
	else
		tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * single(-0.5))))) / sin2phi;
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.00015999999595806003:\\
\;\;\;\;u0 \cdot \frac{1}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.59999996e-4

    1. Initial program 54.9%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*54.9%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified54.9%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified74.1%

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

        \[\leadsto \color{blue}{u0 \cdot \frac{1}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
      2. +-commutative74.2%

        \[\leadsto u0 \cdot \frac{1}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    8. Applied egg-rr74.2%

      \[\leadsto \color{blue}{u0 \cdot \frac{1}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]

    if 1.59999996e-4 < (/.f32 sin2phi (*.f32 alphay alphay))

    1. Initial program 59.6%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*59.6%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified59.6%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in cos2phi around 0 61.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    5. Step-by-step derivation
      1. mul-1-neg61.3%

        \[\leadsto \color{blue}{-\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
      2. unpow261.3%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot \log \left(1 - u0\right)}{sin2phi} \]
      3. *-commutative61.3%

        \[\leadsto -\frac{\color{blue}{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}}{sin2phi} \]
    6. Simplified61.3%

      \[\leadsto \color{blue}{-\frac{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}} \]
    7. Step-by-step derivation
      1. div-inv61.3%

        \[\leadsto -\color{blue}{\left(\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
      2. sub-neg61.3%

        \[\leadsto -\left(\log \color{blue}{\left(1 + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. log1p-udef97.6%

        \[\leadsto -\left(\color{blue}{\mathsf{log1p}\left(-u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    8. Applied egg-rr97.6%

      \[\leadsto -\color{blue}{\left(\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
    9. Taylor expanded in u0 around 0 87.9%

      \[\leadsto -\left(\color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    10. Step-by-step derivation
      1. neg-mul-187.9%

        \[\leadsto -\left(\left(\color{blue}{\left(-u0\right)} + -0.5 \cdot {u0}^{2}\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      2. +-commutative87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. unsub-neg87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      4. *-commutative87.9%

        \[\leadsto -\left(\left(\color{blue}{{u0}^{2} \cdot -0.5} - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      5. unpow287.9%

        \[\leadsto -\left(\left(\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    11. Simplified87.9%

      \[\leadsto -\left(\color{blue}{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    12. Step-by-step derivation
      1. un-div-inv88.1%

        \[\leadsto -\color{blue}{\frac{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}} \]
      2. *-commutative88.1%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right) \cdot \left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)}}{sin2phi} \]
      3. associate-*l*88.1%

        \[\leadsto -\frac{\left(alphay \cdot alphay\right) \cdot \left(\color{blue}{u0 \cdot \left(u0 \cdot -0.5\right)} - u0\right)}{sin2phi} \]
    13. Applied egg-rr88.1%

      \[\leadsto -\color{blue}{\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 \cdot \left(u0 \cdot -0.5\right) - u0\right)}{sin2phi}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.00015999999595806003:\\ \;\;\;\;u0 \cdot \frac{1}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\ \end{array} \]

Alternative 9: 81.3% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t_0 \leq 0.00015999999595806003:\\ \;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot alphay}{sin2phi} \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (let* ((t_0 (/ sin2phi (* alphay alphay))))
   (if (<= t_0 0.00015999999595806003)
     (/ u0 (+ (/ (/ cos2phi alphax) alphax) t_0))
     (* (/ (* alphay alphay) sin2phi) (- u0 (* u0 (* u0 -0.5)))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float t_0 = sin2phi / (alphay * alphay);
	float tmp;
	if (t_0 <= 0.00015999999595806003f) {
		tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
	} else {
		tmp = ((alphay * alphay) / sin2phi) * (u0 - (u0 * (u0 * -0.5f)));
	}
	return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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) :: t_0
    real(4) :: tmp
    t_0 = sin2phi / (alphay * alphay)
    if (t_0 <= 0.00015999999595806003e0) then
        tmp = u0 / (((cos2phi / alphax) / alphax) + t_0)
    else
        tmp = ((alphay * alphay) / sin2phi) * (u0 - (u0 * (u0 * (-0.5e0))))
    end if
    code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = Float32(sin2phi / Float32(alphay * alphay))
	tmp = Float32(0.0)
	if (t_0 <= Float32(0.00015999999595806003))
		tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0));
	else
		tmp = Float32(Float32(Float32(alphay * alphay) / sin2phi) * Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))));
	end
	return tmp
end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = sin2phi / (alphay * alphay);
	tmp = single(0.0);
	if (t_0 <= single(0.00015999999595806003))
		tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
	else
		tmp = ((alphay * alphay) / sin2phi) * (u0 - (u0 * (u0 * single(-0.5))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.00015999999595806003:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{alphay \cdot alphay}{sin2phi} \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.59999996e-4

    1. Initial program 54.9%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*54.9%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified54.9%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    7. Step-by-step derivation
      1. +-commutative74.1%

        \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
      2. clear-num74.2%

        \[\leadsto \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \color{blue}{\frac{1}{\frac{alphax \cdot alphax}{cos2phi}}}} \]
      3. frac-add74.0%

        \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \frac{alphax \cdot alphax}{cos2phi} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}}} \]
      4. associate-/l*74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      5. div-inv74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      6. clear-num73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right) + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      7. *-commutative73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{1 \cdot \left(alphay \cdot alphay\right)}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      8. *-un-lft-identity73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{alphay \cdot alphay}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      9. associate-/l*73.8%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}}}} \]
      10. div-inv73.8%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)}}} \]
      11. clear-num74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right)}} \]
    8. Applied egg-rr74.0%

      \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right)}}} \]
    9. Taylor expanded in sin2phi around 0 74.1%

      \[\leadsto \frac{u0}{\color{blue}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    10. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. associate-/r*74.1%

        \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      3. unpow274.1%

        \[\leadsto \frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    11. Simplified74.1%

      \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]

    if 1.59999996e-4 < (/.f32 sin2phi (*.f32 alphay alphay))

    1. Initial program 59.6%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*59.6%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified59.6%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in cos2phi around 0 61.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    5. Step-by-step derivation
      1. mul-1-neg61.3%

        \[\leadsto \color{blue}{-\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
      2. unpow261.3%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot \log \left(1 - u0\right)}{sin2phi} \]
      3. *-commutative61.3%

        \[\leadsto -\frac{\color{blue}{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}}{sin2phi} \]
    6. Simplified61.3%

      \[\leadsto \color{blue}{-\frac{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}} \]
    7. Step-by-step derivation
      1. div-inv61.3%

        \[\leadsto -\color{blue}{\left(\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
      2. sub-neg61.3%

        \[\leadsto -\left(\log \color{blue}{\left(1 + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. log1p-udef97.6%

        \[\leadsto -\left(\color{blue}{\mathsf{log1p}\left(-u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    8. Applied egg-rr97.6%

      \[\leadsto -\color{blue}{\left(\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
    9. Taylor expanded in u0 around 0 87.9%

      \[\leadsto -\left(\color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    10. Step-by-step derivation
      1. neg-mul-187.9%

        \[\leadsto -\left(\left(\color{blue}{\left(-u0\right)} + -0.5 \cdot {u0}^{2}\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      2. +-commutative87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. unsub-neg87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      4. *-commutative87.9%

        \[\leadsto -\left(\left(\color{blue}{{u0}^{2} \cdot -0.5} - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      5. unpow287.9%

        \[\leadsto -\left(\left(\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    11. Simplified87.9%

      \[\leadsto -\left(\color{blue}{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    12. Taylor expanded in alphay around 0 88.1%

      \[\leadsto -\color{blue}{\frac{{alphay}^{2} \cdot \left(-0.5 \cdot {u0}^{2} - u0\right)}{sin2phi}} \]
    13. Step-by-step derivation
      1. associate-/l*87.6%

        \[\leadsto -\color{blue}{\frac{{alphay}^{2}}{\frac{sin2phi}{-0.5 \cdot {u0}^{2} - u0}}} \]
      2. *-commutative87.6%

        \[\leadsto -\frac{{alphay}^{2}}{\frac{sin2phi}{\color{blue}{{u0}^{2} \cdot -0.5} - u0}} \]
      3. unpow287.6%

        \[\leadsto -\frac{{alphay}^{2}}{\frac{sin2phi}{\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0}} \]
      4. associate-*r*87.6%

        \[\leadsto -\frac{{alphay}^{2}}{\frac{sin2phi}{\color{blue}{u0 \cdot \left(u0 \cdot -0.5\right)} - u0}} \]
      5. associate-/r/88.0%

        \[\leadsto -\color{blue}{\frac{{alphay}^{2}}{sin2phi} \cdot \left(u0 \cdot \left(u0 \cdot -0.5\right) - u0\right)} \]
      6. unpow288.0%

        \[\leadsto -\frac{\color{blue}{alphay \cdot alphay}}{sin2phi} \cdot \left(u0 \cdot \left(u0 \cdot -0.5\right) - u0\right) \]
    14. Simplified88.0%

      \[\leadsto -\color{blue}{\frac{alphay \cdot alphay}{sin2phi} \cdot \left(u0 \cdot \left(u0 \cdot -0.5\right) - u0\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.00015999999595806003:\\ \;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot alphay}{sin2phi} \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)\\ \end{array} \]

Alternative 10: 81.3% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t_0 \leq 0.00015999999595806003:\\ \;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (let* ((t_0 (/ sin2phi (* alphay alphay))))
   (if (<= t_0 0.00015999999595806003)
     (/ u0 (+ (/ (/ cos2phi alphax) alphax) t_0))
     (/ (* (* alphay alphay) (- u0 (* u0 (* u0 -0.5)))) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float t_0 = sin2phi / (alphay * alphay);
	float tmp;
	if (t_0 <= 0.00015999999595806003f) {
		tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
	} else {
		tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * -0.5f)))) / sin2phi;
	}
	return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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) :: t_0
    real(4) :: tmp
    t_0 = sin2phi / (alphay * alphay)
    if (t_0 <= 0.00015999999595806003e0) then
        tmp = u0 / (((cos2phi / alphax) / alphax) + t_0)
    else
        tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * (-0.5e0))))) / sin2phi
    end if
    code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = Float32(sin2phi / Float32(alphay * alphay))
	tmp = Float32(0.0)
	if (t_0 <= Float32(0.00015999999595806003))
		tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0));
	else
		tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5))))) / sin2phi);
	end
	return tmp
end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
	t_0 = sin2phi / (alphay * alphay);
	tmp = single(0.0);
	if (t_0 <= single(0.00015999999595806003))
		tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
	else
		tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * single(-0.5))))) / sin2phi;
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.00015999999595806003:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.59999996e-4

    1. Initial program 54.9%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*54.9%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified54.9%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified74.1%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    7. Step-by-step derivation
      1. +-commutative74.1%

        \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
      2. clear-num74.2%

        \[\leadsto \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \color{blue}{\frac{1}{\frac{alphax \cdot alphax}{cos2phi}}}} \]
      3. frac-add74.0%

        \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \frac{alphax \cdot alphax}{cos2phi} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}}} \]
      4. associate-/l*74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      5. div-inv74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      6. clear-num73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right) + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      7. *-commutative73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{1 \cdot \left(alphay \cdot alphay\right)}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      8. *-un-lft-identity73.9%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{alphay \cdot alphay}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
      9. associate-/l*73.8%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}}}} \]
      10. div-inv73.8%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)}}} \]
      11. clear-num74.0%

        \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right)}} \]
    8. Applied egg-rr74.0%

      \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right)}}} \]
    9. Taylor expanded in sin2phi around 0 74.1%

      \[\leadsto \frac{u0}{\color{blue}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    10. Step-by-step derivation
      1. unpow274.1%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. associate-/r*74.1%

        \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      3. unpow274.1%

        \[\leadsto \frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    11. Simplified74.1%

      \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]

    if 1.59999996e-4 < (/.f32 sin2phi (*.f32 alphay alphay))

    1. Initial program 59.6%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*59.6%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified59.6%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in cos2phi around 0 61.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
    5. Step-by-step derivation
      1. mul-1-neg61.3%

        \[\leadsto \color{blue}{-\frac{{alphay}^{2} \cdot \log \left(1 - u0\right)}{sin2phi}} \]
      2. unpow261.3%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot \log \left(1 - u0\right)}{sin2phi} \]
      3. *-commutative61.3%

        \[\leadsto -\frac{\color{blue}{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}}{sin2phi} \]
    6. Simplified61.3%

      \[\leadsto \color{blue}{-\frac{\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}} \]
    7. Step-by-step derivation
      1. div-inv61.3%

        \[\leadsto -\color{blue}{\left(\log \left(1 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
      2. sub-neg61.3%

        \[\leadsto -\left(\log \color{blue}{\left(1 + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. log1p-udef97.6%

        \[\leadsto -\left(\color{blue}{\mathsf{log1p}\left(-u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    8. Applied egg-rr97.6%

      \[\leadsto -\color{blue}{\left(\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi}} \]
    9. Taylor expanded in u0 around 0 87.9%

      \[\leadsto -\left(\color{blue}{\left(-1 \cdot u0 + -0.5 \cdot {u0}^{2}\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    10. Step-by-step derivation
      1. neg-mul-187.9%

        \[\leadsto -\left(\left(\color{blue}{\left(-u0\right)} + -0.5 \cdot {u0}^{2}\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      2. +-commutative87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} + \left(-u0\right)\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      3. unsub-neg87.9%

        \[\leadsto -\left(\color{blue}{\left(-0.5 \cdot {u0}^{2} - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      4. *-commutative87.9%

        \[\leadsto -\left(\left(\color{blue}{{u0}^{2} \cdot -0.5} - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
      5. unpow287.9%

        \[\leadsto -\left(\left(\color{blue}{\left(u0 \cdot u0\right)} \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    11. Simplified87.9%

      \[\leadsto -\left(\color{blue}{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)} \cdot \left(alphay \cdot alphay\right)\right) \cdot \frac{1}{sin2phi} \]
    12. Step-by-step derivation
      1. un-div-inv88.1%

        \[\leadsto -\color{blue}{\frac{\left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}} \]
      2. *-commutative88.1%

        \[\leadsto -\frac{\color{blue}{\left(alphay \cdot alphay\right) \cdot \left(\left(u0 \cdot u0\right) \cdot -0.5 - u0\right)}}{sin2phi} \]
      3. associate-*l*88.1%

        \[\leadsto -\frac{\left(alphay \cdot alphay\right) \cdot \left(\color{blue}{u0 \cdot \left(u0 \cdot -0.5\right)} - u0\right)}{sin2phi} \]
    13. Applied egg-rr88.1%

      \[\leadsto -\color{blue}{\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 \cdot \left(u0 \cdot -0.5\right) - u0\right)}{sin2phi}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.00015999999595806003:\\ \;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\ \end{array} \]

Alternative 11: 75.7% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/ u0 (+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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 = u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(u0 / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
end
\begin{array}{l}

\\
\frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Derivation
  1. Initial program 57.7%

    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  2. Step-by-step derivation
    1. associate-/r*57.7%

      \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified57.7%

    \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Taylor expanded in u0 around 0 75.2%

    \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
  5. Step-by-step derivation
    1. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
    2. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
  6. Simplified75.2%

    \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  7. Final simplification75.2%

    \[\leadsto \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]

Alternative 12: 75.7% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/ u0 (+ (/ (/ cos2phi alphax) alphax) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return u0 / (((cos2phi / alphax) / alphax) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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 = u0 / (((cos2phi / alphax) / alphax) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32(sin2phi / Float32(alphay * alphay))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = u0 / (((cos2phi / alphax) / alphax) + (sin2phi / (alphay * alphay)));
end
\begin{array}{l}

\\
\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Derivation
  1. Initial program 57.7%

    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  2. Step-by-step derivation
    1. associate-/r*57.7%

      \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified57.7%

    \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Taylor expanded in u0 around 0 75.2%

    \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
  5. Step-by-step derivation
    1. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
    2. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
  6. Simplified75.2%

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

      \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}} \]
    2. clear-num75.2%

      \[\leadsto \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \color{blue}{\frac{1}{\frac{alphax \cdot alphax}{cos2phi}}}} \]
    3. frac-add68.1%

      \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \frac{alphax \cdot alphax}{cos2phi} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}}} \]
    4. associate-/l*68.0%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
    5. div-inv68.0%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)} + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
    6. clear-num67.9%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right) + \left(alphay \cdot alphay\right) \cdot 1}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
    7. *-commutative67.9%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{1 \cdot \left(alphay \cdot alphay\right)}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
    8. *-un-lft-identity67.9%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + \color{blue}{alphay \cdot alphay}}{\left(alphay \cdot alphay\right) \cdot \frac{alphax \cdot alphax}{cos2phi}}} \]
    9. associate-/l*67.9%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\frac{alphax}{\frac{cos2phi}{alphax}}}}} \]
    10. div-inv67.9%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \color{blue}{\left(alphax \cdot \frac{1}{\frac{cos2phi}{alphax}}\right)}}} \]
    11. clear-num68.1%

      \[\leadsto \frac{u0}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \color{blue}{\frac{alphax}{cos2phi}}\right)}} \]
  8. Applied egg-rr68.1%

    \[\leadsto \frac{u0}{\color{blue}{\frac{sin2phi \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right) + alphay \cdot alphay}{\left(alphay \cdot alphay\right) \cdot \left(alphax \cdot \frac{alphax}{cos2phi}\right)}}} \]
  9. Taylor expanded in sin2phi around 0 75.2%

    \[\leadsto \frac{u0}{\color{blue}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
  10. Step-by-step derivation
    1. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
    2. associate-/r*75.2%

      \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
    3. unpow275.2%

      \[\leadsto \frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
  11. Simplified75.2%

    \[\leadsto \frac{u0}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  12. Final simplification75.2%

    \[\leadsto \frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]

Alternative 13: 66.5% accurate, 12.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;sin2phi \leq 9.999999998199587 \cdot 10^{-24}:\\ \;\;\;\;\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (if (<= sin2phi 9.999999998199587e-24)
   (* (* alphax alphax) (/ u0 cos2phi))
   (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if (sin2phi <= 9.999999998199587e-24f) {
		tmp = (alphax * alphax) * (u0 / cos2phi);
	} else {
		tmp = (alphay * alphay) * (u0 / sin2phi);
	}
	return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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 <= 9.999999998199587e-24) then
        tmp = (alphax * alphax) * (u0 / cos2phi)
    else
        tmp = (alphay * alphay) * (u0 / sin2phi)
    end if
    code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = Float32(0.0)
	if (sin2phi <= Float32(9.999999998199587e-24))
		tmp = Float32(Float32(alphax * alphax) * Float32(u0 / cos2phi));
	else
		tmp = Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi));
	end
	return tmp
end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = single(0.0);
	if (sin2phi <= single(9.999999998199587e-24))
		tmp = (alphax * alphax) * (u0 / cos2phi);
	else
		tmp = (alphay * alphay) * (u0 / sin2phi);
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 9.999999998199587 \cdot 10^{-24}:\\
\;\;\;\;\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}\\

\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if sin2phi < 1e-23

    1. Initial program 54.1%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*54.0%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 74.8%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow274.8%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow274.8%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified74.8%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    7. Taylor expanded in cos2phi around inf 62.3%

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphax}^{2}}{cos2phi}} \]
    8. Step-by-step derivation
      1. associate-/l*62.3%

        \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}}}} \]
      2. associate-/r/62.3%

        \[\leadsto \color{blue}{\frac{u0}{cos2phi} \cdot {alphax}^{2}} \]
      3. unpow262.3%

        \[\leadsto \frac{u0}{cos2phi} \cdot \color{blue}{\left(alphax \cdot alphax\right)} \]
    9. Simplified62.3%

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

    if 1e-23 < sin2phi

    1. Initial program 58.8%

      \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
    2. Step-by-step derivation
      1. associate-/r*58.8%

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified58.8%

      \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    4. Taylor expanded in u0 around 0 75.3%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
    5. Step-by-step derivation
      1. unpow275.3%

        \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
      2. unpow275.3%

        \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
    6. Simplified75.3%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
    7. Taylor expanded in cos2phi around 0 69.4%

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphay}^{2}}{sin2phi}} \]
    8. Step-by-step derivation
      1. associate-/l*68.7%

        \[\leadsto \color{blue}{\frac{u0}{\frac{sin2phi}{{alphay}^{2}}}} \]
      2. associate-/r/69.5%

        \[\leadsto \color{blue}{\frac{u0}{sin2phi} \cdot {alphay}^{2}} \]
      3. unpow269.5%

        \[\leadsto \frac{u0}{sin2phi} \cdot \color{blue}{\left(alphay \cdot alphay\right)} \]
    9. Simplified69.5%

      \[\leadsto \color{blue}{\frac{u0}{sin2phi} \cdot \left(alphay \cdot alphay\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;sin2phi \leq 9.999999998199587 \cdot 10^{-24}:\\ \;\;\;\;\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}\\ \mathbf{else}:\\ \;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\ \end{array} \]

Alternative 14: 23.9% accurate, 16.6× speedup?

\[\begin{array}{l} \\ \left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (* (* alphax alphax) (/ u0 cos2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return (alphax * alphax) * (u0 / cos2phi);
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    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 = (alphax * alphax) * (u0 / cos2phi)
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(alphax * alphax) * Float32(u0 / cos2phi))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = (alphax * alphax) * (u0 / cos2phi);
end
\begin{array}{l}

\\
\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}
\end{array}
Derivation
  1. Initial program 57.7%

    \[\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  2. Step-by-step derivation
    1. associate-/r*57.7%

      \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
  3. Simplified57.7%

    \[\leadsto \color{blue}{\frac{-\log \left(1 - u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Taylor expanded in u0 around 0 75.2%

    \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}} + \frac{sin2phi}{{alphay}^{2}}}} \]
  5. Step-by-step derivation
    1. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{\color{blue}{alphax \cdot alphax}} + \frac{sin2phi}{{alphay}^{2}}} \]
    2. unpow275.2%

      \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{\color{blue}{alphay \cdot alphay}}} \]
  6. Simplified75.2%

    \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}} \]
  7. Taylor expanded in cos2phi around inf 24.6%

    \[\leadsto \color{blue}{\frac{u0 \cdot {alphax}^{2}}{cos2phi}} \]
  8. Step-by-step derivation
    1. associate-/l*24.6%

      \[\leadsto \color{blue}{\frac{u0}{\frac{cos2phi}{{alphax}^{2}}}} \]
    2. associate-/r/24.7%

      \[\leadsto \color{blue}{\frac{u0}{cos2phi} \cdot {alphax}^{2}} \]
    3. unpow224.7%

      \[\leadsto \frac{u0}{cos2phi} \cdot \color{blue}{\left(alphax \cdot alphax\right)} \]
  9. Simplified24.7%

    \[\leadsto \color{blue}{\frac{u0}{cos2phi} \cdot \left(alphax \cdot alphax\right)} \]
  10. Final simplification24.7%

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

Reproduce

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