
(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)) (- (* (pow alphay -2.0) (- sin2phi)) (/ cos2phi (* alphax alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return log1pf(-u0) / ((powf(alphay, -2.0f) * -sin2phi) - (cos2phi / (alphax * alphax)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(log1p(Float32(-u0)) / Float32(Float32((alphay ^ Float32(-2.0)) * Float32(-sin2phi)) - Float32(cos2phi / Float32(alphax * alphax)))) end
\begin{array}{l}
\\
\frac{\mathsf{log1p}\left(-u0\right)}{{alphay}^{-2} \cdot \left(-sin2phi\right) - \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
neg-mul-158.1%
associate-/r*58.1%
metadata-eval58.1%
distribute-neg-frac258.1%
/-rgt-identity58.1%
sub-neg58.1%
log1p-define98.7%
Simplified98.7%
clear-num98.6%
associate-/r/98.6%
pow298.6%
pow-flip98.8%
metadata-eval98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 200000.0)
(/
(* u0 (+ 1.0 (* u0 (+ 0.5 (* u0 (+ 0.3333333333333333 (* u0 0.25)))))))
(+ (/ cos2phi (* alphax alphax)) t_0))
(* (/ (log1p (- u0)) sin2phi) (* alphay (- alphay))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 200000.0f) {
tmp = (u0 * (1.0f + (u0 * (0.5f + (u0 * (0.3333333333333333f + (u0 * 0.25f))))))) / ((cos2phi / (alphax * alphax)) + t_0);
} else {
tmp = (log1pf(-u0) / sin2phi) * (alphay * -alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(200000.0)) 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)) + t_0)); else tmp = Float32(Float32(log1p(Float32(-u0)) / sin2phi) * Float32(alphay * Float32(-alphay))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t\_0 \leq 200000:\\
\;\;\;\;\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} + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot \left(-alphay\right)\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 2e5Initial program 53.1%
Taylor expanded in u0 around 0 92.0%
*-commutative92.0%
Simplified92.0%
if 2e5 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 64.7%
distribute-frac-neg64.7%
distribute-neg-frac264.7%
sub-neg64.7%
log1p-define98.2%
neg-sub098.2%
associate--r+98.2%
neg-sub098.2%
associate-/r*98.2%
distribute-neg-frac298.2%
Simplified98.2%
Taylor expanded in cos2phi around 0 65.2%
mul-1-neg65.2%
associate-/l*65.2%
distribute-rgt-neg-in65.2%
distribute-neg-frac265.2%
sub-neg65.2%
log1p-define98.8%
Simplified98.8%
pow298.8%
Applied egg-rr98.8%
Final simplification95.0%
(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(log1p(Float32(-u0)) / Float32(Float32(-Float32(sin2phi / Float32(alphay * alphay))) - Float32(cos2phi / Float32(alphax * alphax)))) end
\begin{array}{l}
\\
\frac{\mathsf{log1p}\left(-u0\right)}{\left(-\frac{sin2phi}{alphay \cdot alphay}\right) - \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
neg-mul-158.1%
associate-/r*58.1%
metadata-eval58.1%
distribute-neg-frac258.1%
/-rgt-identity58.1%
sub-neg58.1%
log1p-define98.7%
Simplified98.7%
Final simplification98.7%
(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(Float32(sin2phi / alphay) / alphay))) end
\begin{array}{l}
\\
\frac{\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{-alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
sub-neg58.1%
log1p-define98.7%
neg-sub098.7%
associate--r+98.7%
neg-sub098.7%
associate-/r*98.6%
distribute-neg-frac298.6%
Simplified98.6%
associate-/r*98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
(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(log1p(Float32(-u0)) / Float32(Float32(sin2phi / Float32(alphay * Float32(-alphay))) - Float32(Float32(cos2phi / alphax) / alphax))) end
\begin{array}{l}
\\
\frac{\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot \left(-alphay\right)} - \frac{\frac{cos2phi}{alphax}}{alphax}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
sub-neg58.1%
log1p-define98.7%
neg-sub098.7%
associate--r+98.7%
neg-sub098.7%
associate-/r*98.6%
distribute-neg-frac298.6%
Simplified98.6%
Final simplification98.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (+ (* u0 (- (* u0 (- (* u0 -0.25) 0.3333333333333333)) 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 * ((u0 * ((u0 * -0.25f) - 0.3333333333333333f)) - 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 * ((u0 * ((u0 * (-0.25e0)) - 0.3333333333333333e0)) - 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(Float32(u0 * Float32(Float32(u0 * Float32(-0.25)) - Float32(0.3333333333333333))) - Float32(0.5))) + Float32(-1.0))) / Float32(Float32(Float32(Float32(-1.0) / Float32(alphax / cos2phi)) / alphax) - Float32(Float32(sin2phi / alphay) / alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 * ((u0 * ((u0 * ((u0 * single(-0.25)) - single(0.3333333333333333))) - 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 \left(u0 \cdot \left(u0 \cdot -0.25 - 0.3333333333333333\right) - 0.5\right) + -1\right)}{\frac{\frac{-1}{\frac{alphax}{cos2phi}}}{alphax} - \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
sub-neg58.1%
log1p-define98.7%
neg-sub098.7%
associate--r+98.7%
neg-sub098.7%
associate-/r*98.6%
distribute-neg-frac298.6%
Simplified98.6%
Taylor expanded in u0 around 0 91.7%
associate-/r*98.6%
div-inv98.5%
Applied egg-rr91.7%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified91.8%
clear-num91.8%
inv-pow91.8%
Applied egg-rr91.8%
unpow-191.8%
Simplified91.8%
Final simplification91.8%
(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}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
sub-neg58.1%
log1p-define98.7%
neg-sub098.7%
associate--r+98.7%
neg-sub098.7%
associate-/r*98.6%
distribute-neg-frac298.6%
Simplified98.6%
Taylor expanded in u0 around 0 91.7%
associate-/r*98.6%
div-inv98.5%
Applied egg-rr91.7%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified91.8%
Final simplification91.8%
(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 58.1%
Taylor expanded in u0 around 0 91.8%
*-commutative91.8%
Simplified91.8%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (* u0 (- 1.0 (* u0 (- (* u0 -0.3333333333333333) 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 * ((u0 * -0.3333333333333333f) - 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 * ((u0 * (-0.3333333333333333e0)) - 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(Float32(u0 * Float32(-0.3333333333333333)) - 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 * ((u0 * single(-0.3333333333333333)) - single(0.5))))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) / alphax)); end
\begin{array}{l}
\\
\frac{u0 \cdot \left(1 - u0 \cdot \left(u0 \cdot -0.3333333333333333 - 0.5\right)\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}}
\end{array}
Initial program 58.1%
distribute-frac-neg58.1%
distribute-neg-frac258.1%
sub-neg58.1%
log1p-define98.7%
neg-sub098.7%
associate--r+98.7%
neg-sub098.7%
associate-/r*98.6%
distribute-neg-frac298.6%
Simplified98.6%
Taylor expanded in u0 around 0 91.7%
associate-/r*98.6%
div-inv98.5%
Applied egg-rr91.7%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified91.8%
Taylor expanded in u0 around 0 90.4%
Final simplification90.4%
(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 58.1%
Taylor expanded in u0 around 0 90.3%
*-commutative90.3%
Simplified90.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(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 58.1%
Taylor expanded in u0 around 0 87.2%
*-commutative87.2%
Simplified87.2%
(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 58.1%
Taylor expanded in u0 around 0 77.0%
associate-/r*98.6%
div-inv98.5%
Applied egg-rr77.0%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified77.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(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 58.1%
Taylor expanded in u0 around 0 77.0%
herbie shell --seed 2024152
(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)))))