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

Percentage Accurate: 60.9% → 98.5%
Time: 14.7s
Alternatives: 17
Speedup: 8.9×

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 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 60.9% 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} \\ \mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right) \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (*
  (log1p (- u0))
  (*
   alphay
   (/
    alphax
    (- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay)))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return log1pf(-u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(log1p(Float32(-u0)) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay))))))
end
\begin{array}{l}

\\
\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)
\end{array}
Derivation
  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. neg-sub059.8%

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

      \[\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-identity59.8%

      \[\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-sub59.8%

      \[\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-identity59.8%

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

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

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

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

    \[\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.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
    2. distribute-rgt-neg-out98.1%

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

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

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

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
    7. distribute-lft-neg-out98.1%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
    8. distribute-rgt-neg-in98.1%

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

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
    3. distribute-rgt-neg-out97.9%

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

    \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
  10. Step-by-step derivation
    1. associate-/r/98.1%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
    4. distribute-rgt-neg-in98.4%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
    2. *-un-lft-identity98.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

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

\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax} \cdot \frac{1}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Derivation
  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. neg-sub059.8%

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

      \[\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-identity59.8%

      \[\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-sub59.8%

      \[\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-identity59.8%

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

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

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

      \[\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-59.8%

      \[\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-neg59.8%

      \[\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-159.8%

      \[\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. Simplified98.3%

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

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

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

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

Alternative 3: 92.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\ \;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(-u0\right) \cdot \frac{-alphay}{\frac{sin2phi}{alphay}}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
   (*
    (- (* -0.5 (* u0 u0)) u0)
    (*
     alphay
     (/
      alphax
      (- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
   (* (log1p (- u0)) (/ (- alphay) (/ sin2phi alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
		tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
	} else {
		tmp = log1pf(-u0) * (-alphay / (sin2phi / alphay));
	}
	return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = Float32(0.0)
	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929))
		tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay))))));
	else
		tmp = Float32(log1p(Float32(-u0)) * Float32(Float32(-alphay) / Float32(sin2phi / alphay)));
	end
	return tmp
end
\begin{array}{l}

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

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


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

    1. Initial program 56.0%

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

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

        \[\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-identity56.0%

        \[\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-sub56.0%

        \[\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-identity56.0%

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

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

        \[\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.6%

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out98.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in98.6%

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{alphax \cdot \left(-alphay\right)}}} \]
    8. Step-by-step derivation
      1. div-inv98.3%

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out98.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.3%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.2%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
      2. *-un-lft-identity98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{{alphay}^{2}}{sin2phi}} \]
    13. Step-by-step derivation
      1. unpow297.0%

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{alphay}{\frac{sin2phi}{alphay}}} \]
    14. Simplified96.4%

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

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

Alternative 4: 92.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\ \;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(-u0\right) \cdot \frac{alphay \cdot \left(-alphay\right)}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
   (*
    (- (* -0.5 (* u0 u0)) u0)
    (*
     alphay
     (/
      alphax
      (- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
   (* (log1p (- u0)) (/ (* alphay (- alphay)) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
		tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
	} else {
		tmp = log1pf(-u0) * ((alphay * -alphay) / sin2phi);
	}
	return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = Float32(0.0)
	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929))
		tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay))))));
	else
		tmp = Float32(log1p(Float32(-u0)) * Float32(Float32(alphay * Float32(-alphay)) / sin2phi));
	end
	return tmp
end
\begin{array}{l}

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

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


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

    1. Initial program 56.0%

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

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

        \[\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-identity56.0%

        \[\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-sub56.0%

        \[\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-identity56.0%

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

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

        \[\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.6%

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out98.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in98.6%

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{alphax \cdot \left(-alphay\right)}}} \]
    8. Step-by-step derivation
      1. div-inv98.3%

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out98.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.3%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.2%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
      2. *-un-lft-identity98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{{alphay}^{2}}{sin2phi}} \]
    13. Step-by-step derivation
      1. unpow297.0%

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

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

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

Alternative 5: 92.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\ \;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\ \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.550000011920929)
   (*
    (- (* -0.5 (* u0 u0)) u0)
    (*
     alphay
     (/
      alphax
      (- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
   (* (/ (log1p (- u0)) sin2phi) (* alphay (- alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
		tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
	} else {
		tmp = (log1pf(-u0) / sin2phi) * (alphay * -alphay);
	}
	return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = Float32(0.0)
	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929))
		tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay))))));
	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.550000011920929:\\
\;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\

\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.550000012

    1. Initial program 56.0%

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

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

        \[\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-identity56.0%

        \[\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-sub56.0%

        \[\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-identity56.0%

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

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

        \[\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.6%

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out98.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in98.6%

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{alphax \cdot \left(-alphay\right)}}} \]
    8. Step-by-step derivation
      1. div-inv98.3%

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out98.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.3%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.2%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
      2. *-un-lft-identity98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
      2. *-un-lft-identity98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\mathsf{log1p}\left(-u0\right) \cdot {alphay}^{2}}}{sin2phi} \]
      6. distribute-lft-neg-in97.1%

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

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

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

        \[\leadsto \color{blue}{\left(alphay \cdot alphay\right)} \cdot \frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \]
    18. Simplified97.1%

      \[\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 simplification92.8%

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

Alternative 6: 92.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\ \;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{alphay \cdot \left(\mathsf{log1p}\left(-u0\right) \cdot \left(-alphay\right)\right)}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
   (*
    (- (* -0.5 (* u0 u0)) u0)
    (*
     alphay
     (/
      alphax
      (- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
   (/ (* alphay (* (log1p (- u0)) (- alphay))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
		tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
	} else {
		tmp = (alphay * (log1pf(-u0) * -alphay)) / sin2phi;
	}
	return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = Float32(0.0)
	if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929))
		tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay))))));
	else
		tmp = Float32(Float32(alphay * Float32(log1p(Float32(-u0)) * Float32(-alphay))) / sin2phi);
	end
	return tmp
end
\begin{array}{l}

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

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


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

    1. Initial program 56.0%

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

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

        \[\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-identity56.0%

        \[\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-sub56.0%

        \[\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-identity56.0%

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

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

        \[\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.6%

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out98.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out98.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in98.6%

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\color{blue}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{alphax \cdot \left(-alphay\right)}}} \]
    8. Step-by-step derivation
      1. div-inv98.3%

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out98.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.3%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.2%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
      2. *-un-lft-identity98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\left(alphay \cdot alphay\right)}}{sin2phi} \]
    14. Simplified97.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{alphay \cdot \left(alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)\right)}}{sin2phi} \]
    17. Simplified97.2%

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

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

Alternative 7: 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 59.8%

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

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

      \[\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-identity59.8%

      \[\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-sub59.8%

      \[\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-identity59.8%

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

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

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

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

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

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

Alternative 8: 98.3% accurate, 1.0× speedup?

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

\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}}
\end{array}
Derivation
  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. neg-sub059.8%

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

      \[\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-identity59.8%

      \[\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-sub59.8%

      \[\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-identity59.8%

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

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

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

      \[\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-59.8%

      \[\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-neg59.8%

      \[\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-159.8%

      \[\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. Simplified98.3%

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

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

Alternative 9: 87.5% accurate, 4.8× speedup?

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

\\
\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)
\end{array}
Derivation
  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. neg-sub059.8%

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

      \[\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-identity59.8%

      \[\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-sub59.8%

      \[\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-identity59.8%

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

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

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

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

    \[\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.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
    2. distribute-rgt-neg-out98.1%

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

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

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

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

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
    7. distribute-lft-neg-out98.1%

      \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
    8. distribute-rgt-neg-in98.1%

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

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
    3. distribute-rgt-neg-out97.9%

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

    \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
  10. Step-by-step derivation
    1. associate-/r/98.1%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
    4. distribute-rgt-neg-in98.4%

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

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

      \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\frac{1 \cdot \left(alphax \cdot \left(-alphay\right)\right)}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{alphax \cdot sin2phi}{alphay}}} \]
    2. *-un-lft-identity98.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-\left(-0.5 \cdot \color{blue}{\left(u0 \cdot u0\right)} - u0\right)\right) \cdot \left(\frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}} \cdot \left(-alphay\right)\right) \]
  18. Simplified88.4%

    \[\leadsto \left(-\color{blue}{\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right)}\right) \cdot \left(\frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}} \cdot \left(-alphay\right)\right) \]
  19. Final simplification88.4%

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

Alternative 10: 81.4% accurate, 5.5× speedup?

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

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


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

    1. Initial program 56.0%

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

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified56.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 75.1%

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

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

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\left(alphay \cdot alphay\right)}}{sin2phi} \]
    14. Simplified97.1%

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

      \[\leadsto \frac{\color{blue}{u0 \cdot {alphay}^{2} + 0.5 \cdot \left({u0}^{2} \cdot {alphay}^{2}\right)}}{sin2phi} \]
    16. Step-by-step derivation
      1. associate-*r*87.9%

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

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

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

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

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

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

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

Alternative 11: 81.4% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{sin2phi}{alphay \cdot alphay}\\ \mathbf{if}\;t_0 \leq 0.550000011920929:\\ \;\;\;\;\frac{u0}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 + \left(u0 \cdot u0\right) \cdot 0.5\right)}{sin2phi}\\ \end{array} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (let* ((t_0 (/ sin2phi (* alphay alphay))))
   (if (<= t_0 0.550000011920929)
     (/ u0 (+ 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.550000011920929f) {
		tmp = u0 / (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.550000011920929e0) then
        tmp = u0 / (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.550000011920929))
		tmp = Float32(u0 / Float32(t_0 + Float32(cos2phi / Float32(alphax * alphax))));
	else
		tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 + Float32(Float32(u0 * 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.550000011920929))
		tmp = u0 / (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.550000011920929:\\
\;\;\;\;\frac{u0}{t_0 + \frac{cos2phi}{alphax \cdot alphax}}\\

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


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

    1. Initial program 56.0%

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

        \[\leadsto \frac{-\log \left(1 - u0\right)}{\color{blue}{\frac{\frac{cos2phi}{alphax}}{alphax}} + \frac{sin2phi}{alphay \cdot alphay}} \]
    3. Simplified56.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 75.1%

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

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

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

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

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

    1. Initial program 63.0%

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

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

        \[\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-identity63.0%

        \[\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-sub63.0%

        \[\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-identity63.0%

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

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

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

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

      \[\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.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\color{blue}{alphay \cdot \frac{-cos2phi}{alphax} + \frac{sin2phi}{alphay} \cdot \left(-alphax\right)}}{alphay \cdot \left(-alphax\right)}} \]
      2. distribute-rgt-neg-out97.6%

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

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

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

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

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{\left(-alphax\right) \cdot alphay}}} \]
      7. distribute-lft-neg-out97.6%

        \[\leadsto \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{\frac{alphay}{alphax}}}{\color{blue}{-alphax \cdot alphay}}} \]
      8. distribute-rgt-neg-in97.6%

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

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot alphax}}{alphax \cdot \left(-alphay\right)}} \]
      3. distribute-rgt-neg-out97.4%

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

      \[\leadsto \color{blue}{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{1}{\frac{alphay \cdot \frac{-cos2phi}{alphax} - \frac{sin2phi}{alphay} \cdot alphax}{-alphax \cdot alphay}}} \]
    10. Step-by-step derivation
      1. associate-/r/97.9%

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

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

        \[\leadsto \left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \left(\frac{1}{alphay \cdot \frac{-cos2phi}{alphax} - \frac{\color{blue}{alphax \cdot sin2phi}}{alphay}} \cdot \left(-alphax \cdot alphay\right)\right) \]
      4. distribute-rgt-neg-in98.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \color{blue}{\left(alphay \cdot alphay\right)}}{sin2phi} \]
    14. Simplified97.1%

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

      \[\leadsto \frac{\color{blue}{u0 \cdot {alphay}^{2} + 0.5 \cdot \left({u0}^{2} \cdot {alphay}^{2}\right)}}{sin2phi} \]
    16. Step-by-step derivation
      1. associate-*r*87.9%

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

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

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

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

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

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

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

Alternative 12: 67.4% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 2.0000000072549875 \cdot 10^{-15}:\\ \;\;\;\;alphax \cdot \frac{u0 \cdot alphax}{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 (* alphay alphay)) 2.0000000072549875e-15)
   (* alphax (/ (* u0 alphax) cos2phi))
   (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	float tmp;
	if ((sin2phi / (alphay * alphay)) <= 2.0000000072549875e-15f) {
		tmp = alphax * ((u0 * alphax) / 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 / (alphay * alphay)) <= 2.0000000072549875e-15) then
        tmp = alphax * ((u0 * alphax) / 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(2.0000000072549875e-15))
		tmp = Float32(alphax * Float32(Float32(u0 * alphax) / 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 / (alphay * alphay)) <= single(2.0000000072549875e-15))
		tmp = alphax * ((u0 * alphax) / cos2phi);
	else
		tmp = (alphay * alphay) * (u0 / sin2phi);
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 2.0000000072549875 \cdot 10^{-15}:\\
\;\;\;\;alphax \cdot \frac{u0 \cdot alphax}{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 (/.f32 sin2phi (*.f32 alphay alphay)) < 2.00000001e-15

    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 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 58.6%

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphax}^{2}}{cos2phi}} \]
    8. Step-by-step derivation
      1. pow258.6%

        \[\leadsto \frac{u0 \cdot \color{blue}{\left(alphax \cdot alphax\right)}}{cos2phi} \]
      2. *-commutative58.6%

        \[\leadsto \frac{\color{blue}{\left(alphax \cdot alphax\right) \cdot u0}}{cos2phi} \]
      3. associate-*r/58.5%

        \[\leadsto \color{blue}{\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}} \]
      4. associate-*l*58.5%

        \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
    9. Applied egg-rr58.5%

      \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
    10. Taylor expanded in alphax around 0 58.6%

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

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

    1. Initial program 60.4%

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

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

      \[\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 76.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphay}^{2}}{sin2phi}} \]
    8. Step-by-step derivation
      1. unpow270.4%

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

        \[\leadsto \frac{\color{blue}{\left(alphay \cdot alphay\right) \cdot u0}}{sin2phi} \]
      3. *-lft-identity70.4%

        \[\leadsto \frac{\left(alphay \cdot alphay\right) \cdot u0}{\color{blue}{1 \cdot sin2phi}} \]
      4. times-frac70.3%

        \[\leadsto \color{blue}{\frac{alphay \cdot alphay}{1} \cdot \frac{u0}{sin2phi}} \]
      5. /-rgt-identity70.3%

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

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

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

Alternative 13: 67.4% accurate, 8.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 2.0000000072549875 \cdot 10^{-15}:\\
\;\;\;\;alphax \cdot \frac{u0 \cdot alphax}{cos2phi}\\

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


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

    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 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 58.6%

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphax}^{2}}{cos2phi}} \]
    8. Step-by-step derivation
      1. pow258.6%

        \[\leadsto \frac{u0 \cdot \color{blue}{\left(alphax \cdot alphax\right)}}{cos2phi} \]
      2. *-commutative58.6%

        \[\leadsto \frac{\color{blue}{\left(alphax \cdot alphax\right) \cdot u0}}{cos2phi} \]
      3. associate-*r/58.5%

        \[\leadsto \color{blue}{\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}} \]
      4. associate-*l*58.5%

        \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
    9. Applied egg-rr58.5%

      \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
    10. Taylor expanded in alphax around 0 58.6%

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

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

    1. Initial program 60.4%

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

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

      \[\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 76.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{u0 \cdot {alphay}^{2}}{sin2phi}} \]
    10. Step-by-step derivation
      1. *-commutative70.4%

        \[\leadsto \frac{\color{blue}{{alphay}^{2} \cdot u0}}{sin2phi} \]
      2. unpow270.4%

        \[\leadsto \frac{\color{blue}{\left(alphay \cdot alphay\right)} \cdot u0}{sin2phi} \]
    11. Simplified70.4%

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

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

Alternative 14: 75.8% 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 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 u0 around 0 76.2%

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

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

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

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

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

Alternative 15: 23.9% accurate, 16.6× speedup?

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

\\
alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)
\end{array}
Derivation
  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 u0 around 0 76.2%

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

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

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

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

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

      \[\leadsto \frac{u0 \cdot \color{blue}{\left(alphax \cdot alphax\right)}}{cos2phi} \]
    2. *-commutative24.8%

      \[\leadsto \frac{\color{blue}{\left(alphax \cdot alphax\right) \cdot u0}}{cos2phi} \]
    3. associate-*r/24.8%

      \[\leadsto \color{blue}{\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}} \]
    4. associate-*l*24.8%

      \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
  9. Applied egg-rr24.8%

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

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

Alternative 16: 23.9% accurate, 16.6× speedup?

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

\\
alphax \cdot \frac{u0 \cdot alphax}{cos2phi}
\end{array}
Derivation
  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 u0 around 0 76.2%

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

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

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

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

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

      \[\leadsto \frac{u0 \cdot \color{blue}{\left(alphax \cdot alphax\right)}}{cos2phi} \]
    2. *-commutative24.8%

      \[\leadsto \frac{\color{blue}{\left(alphax \cdot alphax\right) \cdot u0}}{cos2phi} \]
    3. associate-*r/24.8%

      \[\leadsto \color{blue}{\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}} \]
    4. associate-*l*24.8%

      \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
  9. Applied egg-rr24.8%

    \[\leadsto \color{blue}{alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)} \]
  10. Taylor expanded in alphax around 0 24.8%

    \[\leadsto alphax \cdot \color{blue}{\frac{u0 \cdot alphax}{cos2phi}} \]
  11. Final simplification24.8%

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

Alternative 17: 23.9% accurate, 16.6× speedup?

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

\\
u0 \cdot \frac{alphax \cdot alphax}{cos2phi}
\end{array}
Derivation
  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 u0 around 0 76.2%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{alphax}^{2} \cdot u0}}{cos2phi} \]
    2. *-lft-identity24.8%

      \[\leadsto \frac{{alphax}^{2} \cdot u0}{\color{blue}{1 \cdot cos2phi}} \]
    3. times-frac24.8%

      \[\leadsto \color{blue}{\frac{{alphax}^{2}}{1} \cdot \frac{u0}{cos2phi}} \]
    4. /-rgt-identity24.8%

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

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

    \[\leadsto \color{blue}{\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}} \]
  10. Taylor expanded in alphax around 0 24.8%

    \[\leadsto \color{blue}{\frac{u0 \cdot {alphax}^{2}}{cos2phi}} \]
  11. Step-by-step derivation
    1. unpow224.8%

      \[\leadsto \frac{u0 \cdot \color{blue}{\left(alphax \cdot alphax\right)}}{cos2phi} \]
    2. associate-*r/24.8%

      \[\leadsto \color{blue}{u0 \cdot \frac{alphax \cdot alphax}{cos2phi}} \]
  12. Simplified24.8%

    \[\leadsto \color{blue}{u0 \cdot \frac{alphax \cdot alphax}{cos2phi}} \]
  13. Final simplification24.8%

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

Reproduce

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