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

Percentage Accurate: 60.8% → 98.4%
Time: 16.4s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 60.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  (- (log (- 1.0 u0)))
  (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return -logf((1.0f - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    real(4), intent (in) :: alphax
    real(4), intent (in) :: alphay
    real(4), intent (in) :: u0
    real(4), intent (in) :: cos2phi
    real(4), intent (in) :: sin2phi
    code = -log((1.0e0 - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(Float32(-log(Float32(Float32(1.0) - u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = -log((single(1.0) - u0)) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
end
\begin{array}{l}

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

Alternative 1: 98.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. distribute-frac-neg298.5%

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

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

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

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

      \[\leadsto \frac{\mathsf{log1p}\left(-u0\right)}{\left(0 - cos2phi \cdot \frac{1}{\color{blue}{{alphax}^{2}}}\right) - \frac{sin2phi}{alphay \cdot alphay}} \]
    6. pow-flip98.6%

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

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

    \[\leadsto \frac{\mathsf{log1p}\left(-u0\right)}{\color{blue}{\left(0 - cos2phi \cdot {alphax}^{-2}\right)} - \frac{sin2phi}{alphay \cdot alphay}} \]
  7. Step-by-step derivation
    1. neg-sub098.6%

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

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

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

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

Alternative 2: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 93.1% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  6. Step-by-step derivation
    1. associate-/r*93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  7. Applied egg-rr93.6%

    \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  8. Step-by-step derivation
    1. associate-*r/93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  9. Simplified93.8%

    \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
  10. Final simplification93.8%

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}} \]
  11. Add Preprocessing

Alternative 4: 93.1% accurate, 4.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  6. Final simplification93.7%

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right)\right)\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}} \]
  7. Add Preprocessing

Alternative 5: 93.1% accurate, 4.3× speedup?

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

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

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot \left(0.3333333333333333 + 0.25 \cdot u0\right)\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  4. Step-by-step derivation
    1. *-commutative93.7%

      \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot \left(0.3333333333333333 + \color{blue}{u0 \cdot 0.25}\right)\right)\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  5. Simplified93.7%

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot \left(0.3333333333333333 + u0 \cdot 0.25\right)\right)\right)}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  6. Final simplification93.7%

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot \left(0.3333333333333333 + u0 \cdot 0.25\right)\right)\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]
  7. Add Preprocessing

Alternative 6: 91.2% accurate, 5.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  6. Applied egg-rr98.2%

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  8. Simplified98.5%

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(u0 \cdot \left(-0.3333333333333333 \cdot u0 - 0.5\right) - 1\right)}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}} \]
  10. Final simplification91.7%

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot -0.3333333333333333\right)\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}} \]
  11. Add Preprocessing

Alternative 7: 91.2% accurate, 5.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(u0 \cdot \left(-0.3333333333333333 \cdot u0 - 0.5\right) - 1\right)}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  6. Final simplification91.7%

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 - u0 \cdot -0.3333333333333333\right)\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}} \]
  7. Add Preprocessing

Alternative 8: 91.2% accurate, 5.0× speedup?

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

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

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

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

      \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 + \color{blue}{u0 \cdot 0.3333333333333333}\right)\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  5. Simplified91.6%

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

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]
  7. Add Preprocessing

Alternative 9: 87.3% accurate, 5.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  6. Step-by-step derivation
    1. clear-num93.7%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\color{blue}{\frac{1}{\frac{alphax}{cos2phi}}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
    2. inv-pow93.7%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\color{blue}{{\left(\frac{alphax}{cos2phi}\right)}^{-1}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  7. Applied egg-rr93.7%

    \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\color{blue}{{\left(\frac{alphax}{cos2phi}\right)}^{-1}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  8. Step-by-step derivation
    1. unpow-193.7%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\color{blue}{\frac{1}{\frac{alphax}{cos2phi}}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  9. Simplified93.7%

    \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\color{blue}{\frac{1}{\frac{alphax}{cos2phi}}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  10. Taylor expanded in u0 around 0 87.3%

    \[\leadsto \frac{u0 \cdot \left(\color{blue}{-0.5 \cdot u0} - 1\right)}{\frac{\frac{1}{\frac{alphax}{cos2phi}}}{-alphax} - \frac{sin2phi}{alphay \cdot alphay}} \]
  11. Step-by-step derivation
    1. *-commutative87.3%

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

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

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

Alternative 10: 87.3% accurate, 6.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  6. Applied egg-rr98.2%

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  8. Simplified98.5%

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

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

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

Alternative 11: 87.3% accurate, 6.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 87.3% accurate, 6.1× speedup?

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

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

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

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

      \[\leadsto \frac{u0 \cdot \left(1 + \color{blue}{u0 \cdot 0.5}\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  5. Simplified87.3%

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

    \[\leadsto \frac{u0 \cdot \left(1 + u0 \cdot 0.5\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]
  7. Add Preprocessing

Alternative 13: 75.7% accurate, 7.7× speedup?

\[\begin{array}{l} \\ \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi \cdot \frac{1}{alphay}}{alphay}} \end{array} \]
(FPCore (alphax alphay u0 cos2phi sin2phi)
 :precision binary32
 (/
  u0
  (+ (/ cos2phi (* alphax alphax)) (/ (* sin2phi (/ 1.0 alphay)) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
	return u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi * (1.0f / alphay)) / alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
    real(4), intent (in) :: alphax
    real(4), intent (in) :: alphay
    real(4), intent (in) :: u0
    real(4), intent (in) :: cos2phi
    real(4), intent (in) :: sin2phi
    code = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi * (1.0e0 / alphay)) / alphay))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi)
	return Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi * Float32(Float32(1.0) / alphay)) / alphay)))
end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi)
	tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi * (single(1.0) / alphay)) / alphay));
end
\begin{array}{l}

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

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

    \[\leadsto \frac{\color{blue}{u0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  4. Step-by-step derivation
    1. associate-/r*93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  5. Applied egg-rr74.3%

    \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  6. Step-by-step derivation
    1. associate-*r/93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  7. Simplified74.4%

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

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

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

Alternative 14: 75.8% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \frac{u0}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{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(Float32(sin2phi / alphay) / alphay) + Float32(Float32(cos2phi / 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{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}}
\end{array}
Derivation
  1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  6. Applied egg-rr98.2%

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

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  8. Simplified98.5%

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

    \[\leadsto \frac{\color{blue}{-1 \cdot u0}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}} \]
  10. Step-by-step derivation
    1. mul-1-neg74.4%

      \[\leadsto \frac{\color{blue}{-u0}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}} \]
  11. Simplified74.4%

    \[\leadsto \frac{\color{blue}{-u0}}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}} \]
  12. Final simplification74.4%

    \[\leadsto \frac{u0}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}} \]
  13. Add Preprocessing

Alternative 15: 75.8% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \frac{u0}{\frac{\frac{sin2phi}{alphay}}{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(Float32(sin2phi / 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{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Derivation
  1. Initial program 61.9%

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

    \[\leadsto \frac{\color{blue}{u0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  4. Step-by-step derivation
    1. associate-/r*93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
    2. div-inv93.6%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  5. Applied egg-rr74.3%

    \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \color{blue}{\frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}} \]
  6. Step-by-step derivation
    1. associate-*r/93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \color{blue}{\frac{\frac{sin2phi}{alphay} \cdot 1}{alphay}}} \]
    2. *-rgt-identity93.8%

      \[\leadsto \frac{u0 \cdot \left(u0 \cdot \left(u0 \cdot \left(-0.25 \cdot u0 - 0.3333333333333333\right) - 0.5\right) - 1\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\color{blue}{\frac{sin2phi}{alphay}}}{alphay}} \]
  7. Simplified74.4%

    \[\leadsto \frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \color{blue}{\frac{\frac{sin2phi}{alphay}}{alphay}}} \]
  8. Final simplification74.4%

    \[\leadsto \frac{u0}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]
  9. Add Preprocessing

Alternative 16: 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 61.9%

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

    \[\leadsto \frac{\color{blue}{u0}}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}} \]
  4. Final simplification74.3%

    \[\leadsto \frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \]
  5. Add Preprocessing

Reproduce

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