
(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 17 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) (* (pow alphay -2.0) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / (((cos2phi / alphax) / alphax) + (powf(alphay, -2.0f) * sin2phi));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32((alphay ^ Float32(-2.0)) * sin2phi))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + {alphay}^{-2} \cdot sin2phi}
\end{array}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
sub-neg61.4%
+-commutative61.4%
neg-sub061.4%
associate-+l-61.4%
sub0-neg61.4%
neg-mul-161.4%
log-prod-0.0%
associate--r+-0.0%
Simplified98.7%
clear-num98.6%
associate-/r/98.5%
pow298.5%
pow-flip98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (* alphax (/ alphax cos2phi))))
(if (<= (/ sin2phi (* alphay alphay)) 1.9999999920083944e-11)
(/ u0 (/ (+ alphay (* (/ sin2phi alphay) t_0)) (* alphay t_0)))
(* (* alphay alphay) (/ (- (log1p (- u0))) sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = alphax * (alphax / cos2phi);
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.9999999920083944e-11f) {
tmp = u0 / ((alphay + ((sin2phi / alphay) * t_0)) / (alphay * t_0));
} else {
tmp = (alphay * alphay) * (-log1pf(-u0) / sin2phi);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(alphax * Float32(alphax / cos2phi)) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.9999999920083944e-11)) tmp = Float32(u0 / Float32(Float32(alphay + Float32(Float32(sin2phi / alphay) * t_0)) / Float32(alphay * t_0))); else tmp = Float32(Float32(alphay * alphay) * Float32(Float32(-log1p(Float32(-u0))) / sin2phi)); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := alphax \cdot \frac{alphax}{cos2phi}\\
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.9999999920083944 \cdot 10^{-11}:\\
\;\;\;\;\frac{u0}{\frac{alphay + \frac{sin2phi}{alphay} \cdot t_0}{alphay \cdot t_0}}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999999e-11Initial program 59.0%
neg-sub059.0%
div-sub59.0%
--rgt-identity59.0%
div-sub59.0%
--rgt-identity59.0%
neg-sub059.0%
sub-neg59.0%
log1p-def98.8%
Simplified98.8%
Taylor expanded in u0 around 0 73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
associate-/r*73.5%
clear-num73.5%
frac-add73.5%
*-un-lft-identity73.5%
associate-/l*73.4%
div-inv73.4%
clear-num73.5%
associate-/l*73.4%
div-inv73.5%
clear-num73.5%
Applied egg-rr73.5%
if 1.99999999e-11 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 62.5%
neg-sub062.5%
div-sub62.5%
--rgt-identity62.5%
div-sub62.5%
--rgt-identity62.5%
neg-sub062.5%
sub-neg62.5%
log1p-def98.6%
Simplified98.6%
Taylor expanded in cos2phi around 0 62.0%
mul-1-neg62.0%
unpow262.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in alphay around 0 62.0%
associate-/l*61.6%
sub-neg61.6%
neg-mul-161.6%
log1p-def95.8%
neg-mul-195.8%
associate-/l*96.3%
*-commutative96.3%
associate-*l/96.3%
unpow296.3%
Simplified96.3%
Final simplification89.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (* alphax (/ alphax cos2phi))))
(if (<= (/ sin2phi (* alphay alphay)) 1.9999999920083944e-11)
(/ u0 (/ (+ alphay (* (/ sin2phi alphay) t_0)) (* alphay t_0)))
(* (log1p (- u0)) (/ (- (* alphay alphay)) sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = alphax * (alphax / cos2phi);
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.9999999920083944e-11f) {
tmp = u0 / ((alphay + ((sin2phi / alphay) * t_0)) / (alphay * t_0));
} else {
tmp = log1pf(-u0) * (-(alphay * alphay) / sin2phi);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(alphax * Float32(alphax / cos2phi)) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.9999999920083944e-11)) tmp = Float32(u0 / Float32(Float32(alphay + Float32(Float32(sin2phi / alphay) * t_0)) / Float32(alphay * t_0))); else tmp = Float32(log1p(Float32(-u0)) * Float32(Float32(-Float32(alphay * alphay)) / sin2phi)); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := alphax \cdot \frac{alphax}{cos2phi}\\
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.9999999920083944 \cdot 10^{-11}:\\
\;\;\;\;\frac{u0}{\frac{alphay + \frac{sin2phi}{alphay} \cdot t_0}{alphay \cdot t_0}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(-u0\right) \cdot \frac{-alphay \cdot alphay}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999999e-11Initial program 59.0%
neg-sub059.0%
div-sub59.0%
--rgt-identity59.0%
div-sub59.0%
--rgt-identity59.0%
neg-sub059.0%
sub-neg59.0%
log1p-def98.8%
Simplified98.8%
Taylor expanded in u0 around 0 73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
associate-/r*73.5%
clear-num73.5%
frac-add73.5%
*-un-lft-identity73.5%
associate-/l*73.4%
div-inv73.4%
clear-num73.5%
associate-/l*73.4%
div-inv73.5%
clear-num73.5%
Applied egg-rr73.5%
if 1.99999999e-11 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 62.5%
neg-sub062.5%
div-sub62.5%
--rgt-identity62.5%
div-sub62.5%
--rgt-identity62.5%
sub-neg62.5%
+-commutative62.5%
neg-sub062.5%
associate-+l-62.5%
sub0-neg62.5%
neg-mul-162.5%
log-prod-0.0%
associate--r+-0.0%
Simplified98.6%
associate-/r*98.6%
div-inv98.3%
Applied egg-rr98.3%
un-div-inv98.6%
Applied egg-rr98.6%
div-inv98.6%
associate-/r*98.6%
+-commutative98.6%
associate-/l/98.6%
Applied egg-rr98.6%
Taylor expanded in sin2phi around inf 96.4%
unpow296.4%
Simplified96.4%
Final simplification89.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(cos2phi / Float32(alphax * alphax)))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
neg-sub061.4%
sub-neg61.4%
log1p-def98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- (log1p (- u0))) (+ (/ (/ cos2phi alphax) alphax) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / (((cos2phi / alphax) / alphax) + (sin2phi / (alphay * alphay)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32(sin2phi / Float32(alphay * alphay)))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
sub-neg61.4%
+-commutative61.4%
neg-sub061.4%
associate-+l-61.4%
sub0-neg61.4%
neg-mul-161.4%
log-prod-0.0%
associate--r+-0.0%
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(Float32(-log1p(Float32(-u0))) / Float32(Float32(Float32(cos2phi / alphax) / 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 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
sub-neg61.4%
+-commutative61.4%
neg-sub061.4%
associate-+l-61.4%
sub0-neg61.4%
neg-mul-161.4%
log-prod-0.0%
associate--r+-0.0%
Simplified98.7%
associate-/r*98.7%
div-inv98.4%
Applied egg-rr98.4%
un-div-inv98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (* alphax (/ alphax cos2phi))))
(if (<= sin2phi 1.0000000116860974e-7)
(/ u0 (/ (+ alphay (* (/ sin2phi alphay) t_0)) (* alphay t_0)))
(/ (* (* alphay alphay) (- u0 (* (* u0 u0) -0.5))) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = alphax * (alphax / cos2phi);
float tmp;
if (sin2phi <= 1.0000000116860974e-7f) {
tmp = u0 / ((alphay + ((sin2phi / alphay) * t_0)) / (alphay * t_0));
} else {
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * -0.5f))) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: t_0
real(4) :: tmp
t_0 = alphax * (alphax / cos2phi)
if (sin2phi <= 1.0000000116860974e-7) then
tmp = u0 / ((alphay + ((sin2phi / alphay) * t_0)) / (alphay * t_0))
else
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * (-0.5e0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(alphax * Float32(alphax / cos2phi)) tmp = Float32(0.0) if (sin2phi <= Float32(1.0000000116860974e-7)) tmp = Float32(u0 / Float32(Float32(alphay + Float32(Float32(sin2phi / alphay) * t_0)) / Float32(alphay * t_0))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = alphax * (alphax / cos2phi); tmp = single(0.0); if (sin2phi <= single(1.0000000116860974e-7)) tmp = u0 / ((alphay + ((sin2phi / alphay) * t_0)) / (alphay * t_0)); else tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * single(-0.5)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := alphax \cdot \frac{alphax}{cos2phi}\\
\mathbf{if}\;sin2phi \leq 1.0000000116860974 \cdot 10^{-7}:\\
\;\;\;\;\frac{u0}{\frac{alphay + \frac{sin2phi}{alphay} \cdot t_0}{alphay \cdot t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - \left(u0 \cdot u0\right) \cdot -0.5\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 1.00000001e-7Initial program 56.5%
neg-sub056.5%
div-sub56.5%
--rgt-identity56.5%
div-sub56.5%
--rgt-identity56.5%
neg-sub056.5%
sub-neg56.5%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
associate-/r*75.1%
clear-num75.1%
frac-add75.1%
*-un-lft-identity75.1%
associate-/l*75.1%
div-inv75.1%
clear-num75.1%
associate-/l*75.1%
div-inv75.1%
clear-num75.2%
Applied egg-rr75.2%
if 1.00000001e-7 < sin2phi Initial program 64.2%
neg-sub064.2%
div-sub64.2%
--rgt-identity64.2%
div-sub64.2%
--rgt-identity64.2%
neg-sub064.2%
sub-neg64.2%
log1p-def98.6%
Simplified98.6%
Taylor expanded in cos2phi around 0 64.2%
mul-1-neg64.2%
unpow264.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in u0 around 0 87.7%
+-commutative87.7%
neg-mul-187.7%
unsub-neg87.7%
*-commutative87.7%
unpow287.7%
Simplified87.7%
Final simplification83.1%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= sin2phi 1.0000000116860974e-7)
(/
u0
(/
(+ (/ sin2phi (/ alphay (* alphax alphax))) (* cos2phi alphay))
(* alphay (* alphax alphax))))
(/ (* (* alphay alphay) (- u0 (* (* u0 u0) -0.5))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.0000000116860974e-7f) {
tmp = u0 / (((sin2phi / (alphay / (alphax * alphax))) + (cos2phi * alphay)) / (alphay * (alphax * alphax)));
} else {
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * -0.5f))) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 1.0000000116860974e-7) then
tmp = u0 / (((sin2phi / (alphay / (alphax * alphax))) + (cos2phi * alphay)) / (alphay * (alphax * alphax)))
else
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * (-0.5e0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.0000000116860974e-7)) tmp = Float32(u0 / Float32(Float32(Float32(sin2phi / Float32(alphay / Float32(alphax * alphax))) + Float32(cos2phi * alphay)) / Float32(alphay * Float32(alphax * alphax)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.0000000116860974e-7)) tmp = u0 / (((sin2phi / (alphay / (alphax * alphax))) + (cos2phi * alphay)) / (alphay * (alphax * alphax))); else tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * single(-0.5)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.0000000116860974 \cdot 10^{-7}:\\
\;\;\;\;\frac{u0}{\frac{\frac{sin2phi}{\frac{alphay}{alphax \cdot alphax}} + cos2phi \cdot alphay}{alphay \cdot \left(alphax \cdot alphax\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - \left(u0 \cdot u0\right) \cdot -0.5\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 1.00000001e-7Initial program 56.5%
neg-sub056.5%
div-sub56.5%
--rgt-identity56.5%
div-sub56.5%
--rgt-identity56.5%
neg-sub056.5%
sub-neg56.5%
log1p-def98.7%
Simplified98.7%
associate-/r*98.8%
frac-add98.2%
fma-def98.3%
Applied egg-rr98.3%
associate-*l*98.0%
associate-*r/98.1%
associate-/l*98.1%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in u0 around 0 75.0%
associate-/l*75.1%
associate-/l*75.1%
unpow275.1%
*-commutative75.1%
unpow275.1%
Simplified75.1%
if 1.00000001e-7 < sin2phi Initial program 64.2%
neg-sub064.2%
div-sub64.2%
--rgt-identity64.2%
div-sub64.2%
--rgt-identity64.2%
neg-sub064.2%
sub-neg64.2%
log1p-def98.6%
Simplified98.6%
Taylor expanded in cos2phi around 0 64.2%
mul-1-neg64.2%
unpow264.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in u0 around 0 87.7%
+-commutative87.7%
neg-mul-187.7%
unsub-neg87.7%
*-commutative87.7%
unpow287.7%
Simplified87.7%
Final simplification83.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 1.0000000116860974e-7) (/ u0 (- (/ sin2phi (* alphay alphay)) (/ (/ cos2phi alphax) (- alphax)))) (/ (* (* alphay alphay) (- u0 (* (* u0 u0) -0.5))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.0000000116860974e-7f) {
tmp = u0 / ((sin2phi / (alphay * alphay)) - ((cos2phi / alphax) / -alphax));
} else {
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * -0.5f))) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 1.0000000116860974e-7) then
tmp = u0 / ((sin2phi / (alphay * alphay)) - ((cos2phi / alphax) / -alphax))
else
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * (-0.5e0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.0000000116860974e-7)) tmp = Float32(u0 / Float32(Float32(sin2phi / Float32(alphay * alphay)) - Float32(Float32(cos2phi / alphax) / Float32(-alphax)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.0000000116860974e-7)) tmp = u0 / ((sin2phi / (alphay * alphay)) - ((cos2phi / alphax) / -alphax)); else tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * single(-0.5)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.0000000116860974 \cdot 10^{-7}:\\
\;\;\;\;\frac{u0}{\frac{sin2phi}{alphay \cdot alphay} - \frac{\frac{cos2phi}{alphax}}{-alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - \left(u0 \cdot u0\right) \cdot -0.5\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 1.00000001e-7Initial program 56.5%
neg-sub056.5%
div-sub56.5%
--rgt-identity56.5%
div-sub56.5%
--rgt-identity56.5%
neg-sub056.5%
sub-neg56.5%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
associate-/r*75.1%
frac-2neg75.1%
distribute-frac-neg75.1%
Applied egg-rr75.1%
if 1.00000001e-7 < sin2phi Initial program 64.2%
neg-sub064.2%
div-sub64.2%
--rgt-identity64.2%
div-sub64.2%
--rgt-identity64.2%
neg-sub064.2%
sub-neg64.2%
log1p-def98.6%
Simplified98.6%
Taylor expanded in cos2phi around 0 64.2%
mul-1-neg64.2%
unpow264.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in u0 around 0 87.7%
+-commutative87.7%
neg-mul-187.7%
unsub-neg87.7%
*-commutative87.7%
unpow287.7%
Simplified87.7%
Final simplification83.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 1.0000000116860974e-7) (/ u0 (+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax)))) (/ (* (* alphay alphay) (- u0 (* (* u0 u0) -0.5))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.0000000116860974e-7f) {
tmp = u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
} else {
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * -0.5f))) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 1.0000000116860974e-7) then
tmp = u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)))
else
tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * (-0.5e0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.0000000116860974e-7)) tmp = Float32(u0 / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(u0 * u0) * Float32(-0.5)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.0000000116860974e-7)) tmp = u0 / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax))); else tmp = ((alphay * alphay) * (u0 - ((u0 * u0) * single(-0.5)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.0000000116860974 \cdot 10^{-7}:\\
\;\;\;\;\frac{u0}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - \left(u0 \cdot u0\right) \cdot -0.5\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 1.00000001e-7Initial program 56.5%
neg-sub056.5%
div-sub56.5%
--rgt-identity56.5%
div-sub56.5%
--rgt-identity56.5%
neg-sub056.5%
sub-neg56.5%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
if 1.00000001e-7 < sin2phi Initial program 64.2%
neg-sub064.2%
div-sub64.2%
--rgt-identity64.2%
div-sub64.2%
--rgt-identity64.2%
neg-sub064.2%
sub-neg64.2%
log1p-def98.6%
Simplified98.6%
Taylor expanded in cos2phi around 0 64.2%
mul-1-neg64.2%
unpow264.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in u0 around 0 87.7%
+-commutative87.7%
neg-mul-187.7%
unsub-neg87.7%
*-commutative87.7%
unpow287.7%
Simplified87.7%
Final simplification83.0%
(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}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
neg-sub061.4%
sub-neg61.4%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 76.4%
unpow276.4%
unpow276.4%
Simplified76.4%
Final simplification76.4%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 5.000000229068525e-19) (* (* alphax alphax) (/ u0 cos2phi)) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 5.000000229068525e-19f) {
tmp = (alphax * alphax) * (u0 / cos2phi);
} else {
tmp = (alphay * alphay) * (u0 / sin2phi);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 5.000000229068525e-19) then
tmp = (alphax * alphax) * (u0 / cos2phi)
else
tmp = (alphay * alphay) * (u0 / sin2phi)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(5.000000229068525e-19)) tmp = Float32(Float32(alphax * alphax) * Float32(u0 / cos2phi)); else tmp = Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(5.000000229068525e-19)) tmp = (alphax * alphax) * (u0 / cos2phi); else tmp = (alphay * alphay) * (u0 / sin2phi); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 5.000000229068525 \cdot 10^{-19}:\\
\;\;\;\;\left(alphax \cdot alphax\right) \cdot \frac{u0}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 5.00000023e-19Initial program 57.8%
neg-sub057.8%
div-sub57.8%
--rgt-identity57.8%
div-sub57.8%
--rgt-identity57.8%
neg-sub057.8%
sub-neg57.8%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
Taylor expanded in cos2phi around inf 59.6%
associate-/l*59.5%
associate-/r/59.5%
unpow259.5%
Simplified59.5%
if 5.00000023e-19 < sin2phi Initial program 62.7%
neg-sub062.7%
div-sub62.7%
--rgt-identity62.7%
div-sub62.7%
--rgt-identity62.7%
neg-sub062.7%
sub-neg62.7%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 77.0%
unpow277.0%
unpow277.0%
Simplified77.0%
Taylor expanded in cos2phi around 0 74.4%
unpow274.4%
*-commutative74.4%
*-lft-identity74.4%
times-frac74.4%
/-rgt-identity74.4%
Simplified74.4%
Final simplification70.5%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 5.000000229068525e-19) (/ u0 (/ cos2phi (* alphax alphax))) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 5.000000229068525e-19f) {
tmp = u0 / (cos2phi / (alphax * alphax));
} else {
tmp = (alphay * alphay) * (u0 / sin2phi);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 5.000000229068525e-19) then
tmp = u0 / (cos2phi / (alphax * alphax))
else
tmp = (alphay * alphay) * (u0 / sin2phi)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(5.000000229068525e-19)) tmp = Float32(u0 / Float32(cos2phi / Float32(alphax * alphax))); else tmp = Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(5.000000229068525e-19)) tmp = u0 / (cos2phi / (alphax * alphax)); else tmp = (alphay * alphay) * (u0 / sin2phi); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 5.000000229068525 \cdot 10^{-19}:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 5.00000023e-19Initial program 57.8%
neg-sub057.8%
div-sub57.8%
--rgt-identity57.8%
div-sub57.8%
--rgt-identity57.8%
neg-sub057.8%
sub-neg57.8%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
frac-2neg74.7%
div-inv74.7%
distribute-rgt-neg-in74.7%
Applied egg-rr74.7%
Taylor expanded in cos2phi around inf 59.6%
associate-/l*59.5%
unpow259.5%
Simplified59.5%
if 5.00000023e-19 < sin2phi Initial program 62.7%
neg-sub062.7%
div-sub62.7%
--rgt-identity62.7%
div-sub62.7%
--rgt-identity62.7%
neg-sub062.7%
sub-neg62.7%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 77.0%
unpow277.0%
unpow277.0%
Simplified77.0%
Taylor expanded in cos2phi around 0 74.4%
unpow274.4%
*-commutative74.4%
*-lft-identity74.4%
times-frac74.4%
/-rgt-identity74.4%
Simplified74.4%
Final simplification70.5%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 5.000000229068525e-19) (/ (* u0 (* alphax alphax)) cos2phi) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 5.000000229068525e-19f) {
tmp = (u0 * (alphax * alphax)) / cos2phi;
} else {
tmp = (alphay * alphay) * (u0 / sin2phi);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 5.000000229068525e-19) then
tmp = (u0 * (alphax * alphax)) / cos2phi
else
tmp = (alphay * alphay) * (u0 / sin2phi)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(5.000000229068525e-19)) tmp = Float32(Float32(u0 * Float32(alphax * alphax)) / cos2phi); else tmp = Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(5.000000229068525e-19)) tmp = (u0 * (alphax * alphax)) / cos2phi; else tmp = (alphay * alphay) * (u0 / sin2phi); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 5.000000229068525 \cdot 10^{-19}:\\
\;\;\;\;\frac{u0 \cdot \left(alphax \cdot alphax\right)}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 5.00000023e-19Initial program 57.8%
neg-sub057.8%
div-sub57.8%
--rgt-identity57.8%
div-sub57.8%
--rgt-identity57.8%
neg-sub057.8%
sub-neg57.8%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
Taylor expanded in cos2phi around inf 59.6%
unpow259.6%
Simplified59.6%
if 5.00000023e-19 < sin2phi Initial program 62.7%
neg-sub062.7%
div-sub62.7%
--rgt-identity62.7%
div-sub62.7%
--rgt-identity62.7%
neg-sub062.7%
sub-neg62.7%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 77.0%
unpow277.0%
unpow277.0%
Simplified77.0%
Taylor expanded in cos2phi around 0 74.4%
unpow274.4%
*-commutative74.4%
*-lft-identity74.4%
times-frac74.4%
/-rgt-identity74.4%
Simplified74.4%
Final simplification70.5%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 5.000000229068525e-19) (/ (* u0 (* alphax alphax)) cos2phi) (/ (* u0 (* alphay alphay)) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 5.000000229068525e-19f) {
tmp = (u0 * (alphax * alphax)) / cos2phi;
} else {
tmp = (u0 * (alphay * alphay)) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if (sin2phi <= 5.000000229068525e-19) then
tmp = (u0 * (alphax * alphax)) / cos2phi
else
tmp = (u0 * (alphay * alphay)) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(5.000000229068525e-19)) tmp = Float32(Float32(u0 * Float32(alphax * alphax)) / cos2phi); else tmp = Float32(Float32(u0 * Float32(alphay * alphay)) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(5.000000229068525e-19)) tmp = (u0 * (alphax * alphax)) / cos2phi; else tmp = (u0 * (alphay * alphay)) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 5.000000229068525 \cdot 10^{-19}:\\
\;\;\;\;\frac{u0 \cdot \left(alphax \cdot alphax\right)}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\frac{u0 \cdot \left(alphay \cdot alphay\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 5.00000023e-19Initial program 57.8%
neg-sub057.8%
div-sub57.8%
--rgt-identity57.8%
div-sub57.8%
--rgt-identity57.8%
neg-sub057.8%
sub-neg57.8%
log1p-def98.7%
Simplified98.7%
Taylor expanded in u0 around 0 74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
Taylor expanded in cos2phi around inf 59.6%
unpow259.6%
Simplified59.6%
if 5.00000023e-19 < sin2phi Initial program 62.7%
neg-sub062.7%
div-sub62.7%
--rgt-identity62.7%
div-sub62.7%
--rgt-identity62.7%
neg-sub062.7%
sub-neg62.7%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 77.0%
unpow277.0%
unpow277.0%
Simplified77.0%
Taylor expanded in cos2phi around 0 74.4%
unpow274.4%
*-commutative74.4%
*-lft-identity74.4%
times-frac74.4%
/-rgt-identity74.4%
Simplified74.4%
associate-*r/74.4%
Applied egg-rr74.4%
Final simplification70.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* alphay (* alphay (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return alphay * (alphay * (u0 / sin2phi));
}
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 = alphay * (alphay * (u0 / sin2phi))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(alphay * Float32(alphay * Float32(u0 / sin2phi))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = alphay * (alphay * (u0 / sin2phi)); end
\begin{array}{l}
\\
alphay \cdot \left(alphay \cdot \frac{u0}{sin2phi}\right)
\end{array}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
neg-sub061.4%
sub-neg61.4%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 76.4%
unpow276.4%
unpow276.4%
Simplified76.4%
Taylor expanded in cos2phi around 0 61.0%
unpow261.0%
*-commutative61.0%
*-lft-identity61.0%
times-frac61.0%
/-rgt-identity61.0%
Simplified61.0%
Taylor expanded in alphay around 0 61.0%
*-commutative61.0%
associate-*r/61.0%
unpow261.0%
associate-*l*61.0%
Simplified61.0%
Final simplification61.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* (* alphay alphay) (/ u0 sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (alphay * alphay) * (u0 / sin2phi);
}
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 = (alphay * alphay) * (u0 / sin2phi)
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (alphay * alphay) * (u0 / sin2phi); end
\begin{array}{l}
\\
\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}
\end{array}
Initial program 61.4%
neg-sub061.4%
div-sub61.4%
--rgt-identity61.4%
div-sub61.4%
--rgt-identity61.4%
neg-sub061.4%
sub-neg61.4%
log1p-def98.6%
Simplified98.6%
Taylor expanded in u0 around 0 76.4%
unpow276.4%
unpow276.4%
Simplified76.4%
Taylor expanded in cos2phi around 0 61.0%
unpow261.0%
*-commutative61.0%
*-lft-identity61.0%
times-frac61.0%
/-rgt-identity61.0%
Simplified61.0%
Final simplification61.0%
herbie shell --seed 2023230
(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)))))