
(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:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- (log1p (- u0))) (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
associate-/r*98.3%
div-inv98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= u0 0.0949999988079071)
(/
(* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 (+ 0.3333333333333333 (* u0 0.25)))))))
(+ (/ cos2phi (* alphax alphax)) (/ 1.0 (/ alphay (/ sin2phi alphay)))))
(/
(log1p (- u0))
(- (/ (/ cos2phi alphax) alphax) (/ sin2phi (* alphay alphay))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (u0 <= 0.0949999988079071f) {
tmp = (u0 * (1.0f + (u0 * (0.5f + (u0 * (0.3333333333333333f + (u0 * 0.25f))))))) / ((cos2phi / (alphax * alphax)) + (1.0f / (alphay / (sin2phi / alphay))));
} else {
tmp = log1pf(-u0) / (((cos2phi / alphax) / alphax) - (sin2phi / (alphay * alphay)));
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (u0 <= Float32(0.0949999988079071)) tmp = 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(cos2phi / Float32(alphax * alphax)) + Float32(Float32(1.0) / Float32(alphay / Float32(sin2phi / alphay))))); else tmp = Float32(log1p(Float32(-u0)) / Float32(Float32(Float32(cos2phi / alphax) / alphax) - Float32(sin2phi / Float32(alphay * alphay)))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u0 \leq 0.0949999988079071:\\
\;\;\;\;\frac{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{1}{\frac{alphay}{\frac{sin2phi}{alphay}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} - \frac{sin2phi}{alphay \cdot alphay}}\\
\end{array}
\end{array}
if u0 < 0.0949999988Initial program 59.9%
distribute-frac-neg59.9%
distribute-neg-frac259.9%
neg-mul-159.9%
associate-/r*59.9%
remove-double-neg59.9%
distribute-frac-neg59.9%
distribute-neg-frac259.9%
metadata-eval59.9%
/-rgt-identity59.9%
sub-neg59.9%
log1p-define98.2%
Simplified98.2%
expm1-log1p-u95.5%
expm1-undefine80.4%
div-inv80.4%
pow280.4%
pow-flip80.4%
metadata-eval80.4%
Applied egg-rr80.4%
expm1-define95.5%
Simplified95.5%
expm1-log1p-u98.2%
metadata-eval98.2%
pow-flip98.1%
pow298.1%
div-inv98.2%
associate-/r*98.3%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in u0 around 0 97.3%
*-commutative97.3%
Simplified97.3%
if 0.0949999988 < u0 Initial program 97.8%
distribute-frac-neg97.8%
distribute-neg-frac297.8%
sub-neg97.8%
log1p-define99.0%
neg-sub099.0%
associate--r+99.0%
neg-sub099.0%
associate-/r*98.9%
distribute-neg-frac298.9%
Simplified98.9%
add-sqr-sqrt-0.0%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-prod78.1%
add-sqr-sqrt78.1%
div-inv78.1%
Applied egg-rr78.1%
associate-*r/78.1%
*-rgt-identity78.1%
Simplified78.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- (log1p (- u0))) (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
(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}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
sub-neg64.8%
log1p-define98.3%
neg-sub098.3%
associate--r+98.3%
neg-sub098.3%
associate-/r*98.3%
distribute-neg-frac298.3%
Simplified98.3%
Final simplification98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 (+ 0.3333333333333333 (* u0 0.25))))))) (+ (/ cos2phi (* alphax alphax)) (/ 1.0 (/ alphay (/ sin2phi alphay))))))
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))))))) / ((cos2phi / (alphax * alphax)) + (1.0f / (alphay / (sin2phi / 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 * (1.0e0 + (u0 * (0.5e0 + (u0 * (0.3333333333333333e0 + (u0 * 0.25e0))))))) / ((cos2phi / (alphax * alphax)) + (1.0e0 / (alphay / (sin2phi / alphay))))
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(cos2phi / Float32(alphax * alphax)) + Float32(Float32(1.0) / Float32(alphay / Float32(sin2phi / alphay))))) 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)))))))) / ((cos2phi / (alphax * alphax)) + (single(1.0) / (alphay / (sin2phi / alphay)))); 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{cos2phi}{alphax \cdot alphax} + \frac{1}{\frac{alphay}{\frac{sin2phi}{alphay}}}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
expm1-log1p-u95.4%
expm1-undefine78.8%
div-inv78.8%
pow278.8%
pow-flip78.8%
metadata-eval78.8%
Applied egg-rr78.8%
expm1-define95.4%
Simplified95.4%
expm1-log1p-u98.2%
metadata-eval98.2%
pow-flip98.2%
pow298.2%
div-inv98.3%
associate-/r*98.3%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in u0 around 0 91.7%
*-commutative91.7%
Simplified91.7%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 (+ 0.3333333333333333 (* u0 0.25))))))) (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
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))))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * (0.5e0 + (u0 * (0.3333333333333333e0 + (u0 * 0.25e0))))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
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(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))) 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)))))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); 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{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
associate-/r*98.3%
div-inv98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in u0 around 0 91.6%
*-commutative91.7%
Simplified91.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 (+ 0.3333333333333333 (* u0 0.25))))))) (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
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))))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * (0.5e0 + (u0 * (0.3333333333333333e0 + (u0 * 0.25e0))))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
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(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) 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)))))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay))); 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{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 64.8%
Taylor expanded in u0 around 0 91.6%
*-commutative91.6%
Simplified91.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 0.3333333333333333))))) (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 * (1.0f + (u0 * (0.5f + (u0 * 0.3333333333333333f))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * (0.5e0 + (u0 * 0.3333333333333333e0))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
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(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 * (single(1.0) + (u0 * (single(0.5) + (u0 * single(0.3333333333333333)))))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); end
\begin{array}{l}
\\
\frac{u0 \cdot \left(1 + u0 \cdot \left(0.5 + u0 \cdot 0.3333333333333333\right)\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
associate-/r*98.3%
div-inv98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in u0 around 0 89.3%
*-commutative89.3%
Simplified89.3%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 0.3333333333333333))))) (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 * (1.0f + (u0 * (0.5f + (u0 * 0.3333333333333333f))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * (0.5e0 + (u0 * 0.3333333333333333e0))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
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(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 * (single(1.0) + (u0 * (single(0.5) + (u0 * single(0.3333333333333333)))))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay))); end
\begin{array}{l}
\\
\frac{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}}
\end{array}
Initial program 64.8%
Taylor expanded in u0 around 0 89.3%
*-commutative89.3%
Simplified89.3%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 0.5))) (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 * (1.0f + (u0 * 0.5f))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * 0.5e0))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(u0 * Float32(Float32(1.0) + Float32(u0 * Float32(0.5)))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 * (single(1.0) + (u0 * single(0.5)))) / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); end
\begin{array}{l}
\\
\frac{u0 \cdot \left(1 + u0 \cdot 0.5\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
associate-/r*98.3%
div-inv98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in u0 around 0 85.1%
*-commutative85.1%
Simplified85.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ 1.0 (* u0 0.5))) (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 * (1.0f + (u0 * 0.5f))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (u0 * (1.0e0 + (u0 * 0.5e0))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(u0 * Float32(Float32(1.0) + Float32(u0 * Float32(0.5)))) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 * (single(1.0) + (u0 * single(0.5)))) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay))); end
\begin{array}{l}
\\
\frac{u0 \cdot \left(1 + u0 \cdot 0.5\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 64.8%
Taylor expanded in u0 around 0 85.0%
*-commutative85.0%
Simplified85.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ u0 (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); end
\begin{array}{l}
\\
\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
neg-mul-164.8%
associate-/r*64.8%
remove-double-neg64.8%
distribute-frac-neg64.8%
distribute-neg-frac264.8%
metadata-eval64.8%
/-rgt-identity64.8%
sub-neg64.8%
log1p-define98.3%
Simplified98.3%
associate-/r*98.3%
div-inv98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in u0 around 0 74.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ u0 (+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return u0 / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = u0 / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = u0 / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay))); end
\begin{array}{l}
\\
\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 64.8%
Taylor expanded in u0 around 0 74.0%
herbie shell --seed 2024145
(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)))))