
(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 24 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))) (+ (/ sin2phi (/ alphay alphax)) (/ cos2phi (/ alphax alphay)))) (* alphay alphax)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (-log1pf(-u0) / ((sin2phi / (alphay / alphax)) + (cos2phi / (alphax / alphay)))) * (alphay * alphax);
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(sin2phi / Float32(alphay / alphax)) + Float32(cos2phi / Float32(alphax / alphay)))) * Float32(alphay * alphax)) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{\frac{alphay}{alphax}} + \frac{cos2phi}{\frac{alphax}{alphay}}} \cdot \left(alphay \cdot alphax\right)
\end{array}
Initial program 61.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
neg-sub061.1%
sub-neg61.1%
log1p-def97.9%
Simplified97.9%
+-commutative97.9%
associate-/r*98.2%
associate-/r*98.2%
frac-add97.8%
Applied egg-rr97.8%
associate-/r/98.4%
*-commutative98.4%
fma-def98.5%
*-commutative98.5%
*-commutative98.5%
Applied egg-rr98.5%
Taylor expanded in alphax around 0 98.5%
distribute-frac-neg98.5%
associate-/l*98.5%
associate-/l*98.5%
Applied egg-rr98.5%
Final simplification98.5%
(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.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
neg-sub061.1%
sub-neg61.1%
log1p-def97.9%
Simplified97.9%
Final simplification97.9%
(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.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
sub-neg61.1%
+-commutative61.1%
neg-sub061.1%
associate-+l-61.1%
sub0-neg61.1%
neg-mul-161.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.0%
Final simplification98.0%
(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.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
sub-neg61.1%
+-commutative61.1%
neg-sub061.1%
associate-+l-61.1%
sub0-neg61.1%
neg-mul-161.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.0%
associate-/r*98.2%
div-inv98.0%
Applied egg-rr98.0%
un-div-inv98.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= u0 0.010999999940395355)
(/
(- u0 (* u0 (* u0 -0.5)))
(+ (/ (/ sin2phi alphay) alphay) (* (/ cos2phi alphax) (/ 1.0 alphax))))
(* alphay (/ (- alphay) (/ sin2phi (log1p (- u0)))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (u0 <= 0.010999999940395355f) {
tmp = (u0 - (u0 * (u0 * -0.5f))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (1.0f / alphax)));
} else {
tmp = alphay * (-alphay / (sin2phi / log1pf(-u0)));
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (u0 <= Float32(0.010999999940395355)) tmp = Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(sin2phi / alphay) / alphay) + Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)))); else tmp = Float32(alphay * Float32(Float32(-alphay) / Float32(sin2phi / log1p(Float32(-u0))))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u0 \leq 0.010999999940395355:\\
\;\;\;\;\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax} \cdot \frac{1}{alphax}}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \frac{-alphay}{\frac{sin2phi}{\mathsf{log1p}\left(-u0\right)}}\\
\end{array}
\end{array}
if u0 < 0.0109999999Initial program 51.0%
neg-sub051.0%
div-sub51.0%
--rgt-identity51.0%
div-sub51.0%
--rgt-identity51.0%
sub-neg51.0%
+-commutative51.0%
neg-sub051.0%
associate-+l-51.0%
sub0-neg51.0%
neg-mul-151.0%
log-prod-0.0%
associate--r+-0.0%
Simplified98.6%
associate-/r*98.8%
div-inv98.6%
Applied egg-rr98.6%
un-div-inv98.8%
Applied egg-rr98.8%
Taylor expanded in u0 around 0 96.7%
+-commutative96.7%
neg-mul-196.7%
unsub-neg96.7%
*-commutative96.7%
unpow296.7%
associate-*l*96.7%
Simplified96.7%
div-inv96.7%
Applied egg-rr96.7%
if 0.0109999999 < u0 Initial program 92.8%
Taylor expanded in cos2phi around 0 73.0%
mul-1-neg73.0%
unpow273.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in alphay around 0 73.0%
*-rgt-identity73.0%
times-frac73.0%
unpow273.0%
associate-/l*72.1%
times-frac72.3%
*-commutative72.3%
times-frac72.2%
/-rgt-identity72.2%
sub-neg72.2%
log1p-def75.2%
Simplified75.2%
Taylor expanded in sin2phi around 0 72.9%
associate-/l*72.8%
sub-neg72.8%
log1p-def75.7%
Simplified75.7%
Final simplification91.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= sin2phi 0.4000000059604645)
(/
(- u0 (* u0 (* u0 -0.5)))
(+ (/ (/ sin2phi alphay) alphay) (* (/ cos2phi alphax) (/ 1.0 alphax))))
(* alphay (/ (- (log1p (- u0))) (/ sin2phi alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 0.4000000059604645f) {
tmp = (u0 - (u0 * (u0 * -0.5f))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (1.0f / alphax)));
} else {
tmp = alphay * (-log1pf(-u0) / (sin2phi / alphay));
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(0.4000000059604645)) tmp = Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(sin2phi / alphay) / alphay) + Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)))); else tmp = Float32(alphay * Float32(Float32(-log1p(Float32(-u0))) / Float32(sin2phi / alphay))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 0.4000000059604645:\\
\;\;\;\;\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax} \cdot \frac{1}{alphax}}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay}}\\
\end{array}
\end{array}
if sin2phi < 0.400000006Initial program 55.1%
neg-sub055.1%
div-sub55.1%
--rgt-identity55.1%
div-sub55.1%
--rgt-identity55.1%
sub-neg55.1%
+-commutative55.1%
neg-sub055.1%
associate-+l-55.1%
sub0-neg55.1%
neg-mul-155.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.5%
associate-/r*98.7%
div-inv98.5%
Applied egg-rr98.5%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in u0 around 0 85.5%
+-commutative85.5%
neg-mul-185.5%
unsub-neg85.5%
*-commutative85.5%
unpow285.5%
associate-*l*85.5%
Simplified85.5%
div-inv85.5%
Applied egg-rr85.5%
if 0.400000006 < sin2phi Initial program 66.5%
Taylor expanded in cos2phi around 0 67.4%
mul-1-neg67.4%
unpow267.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in alphay around 0 67.4%
*-rgt-identity67.4%
times-frac67.4%
unpow267.4%
associate-/l*66.9%
times-frac67.0%
*-commutative67.0%
times-frac67.0%
/-rgt-identity67.0%
sub-neg67.0%
log1p-def98.1%
Simplified98.1%
Final simplification92.1%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= sin2phi 0.4000000059604645)
(/
(- u0 (* u0 (* u0 -0.5)))
(+ (/ (/ sin2phi alphay) alphay) (* (/ cos2phi alphax) (/ 1.0 alphax))))
(/ (* (log1p (- u0)) (- (* alphay alphay))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 0.4000000059604645f) {
tmp = (u0 - (u0 * (u0 * -0.5f))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (1.0f / alphax)));
} else {
tmp = (log1pf(-u0) * -(alphay * alphay)) / sin2phi;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(0.4000000059604645)) tmp = Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(sin2phi / alphay) / alphay) + Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)))); else tmp = Float32(Float32(log1p(Float32(-u0)) * Float32(-Float32(alphay * alphay))) / sin2phi); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 0.4000000059604645:\\
\;\;\;\;\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax} \cdot \frac{1}{alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(-u0\right) \cdot \left(-alphay \cdot alphay\right)}{sin2phi}\\
\end{array}
\end{array}
if sin2phi < 0.400000006Initial program 55.1%
neg-sub055.1%
div-sub55.1%
--rgt-identity55.1%
div-sub55.1%
--rgt-identity55.1%
sub-neg55.1%
+-commutative55.1%
neg-sub055.1%
associate-+l-55.1%
sub0-neg55.1%
neg-mul-155.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.5%
associate-/r*98.7%
div-inv98.5%
Applied egg-rr98.5%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in u0 around 0 85.5%
+-commutative85.5%
neg-mul-185.5%
unsub-neg85.5%
*-commutative85.5%
unpow285.5%
associate-*l*85.5%
Simplified85.5%
div-inv85.5%
Applied egg-rr85.5%
if 0.400000006 < sin2phi Initial program 66.5%
Taylor expanded in cos2phi around 0 67.4%
mul-1-neg67.4%
unpow267.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in alphay around 0 67.4%
unpow267.4%
sub-neg67.4%
log1p-def98.2%
Simplified98.2%
Final simplification92.2%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* (* alphay alphax) (/ (- u0 (* u0 (* u0 -0.5))) (+ (/ (* sin2phi alphax) alphay) (/ (* alphay cos2phi) alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (alphay * alphax) * ((u0 - (u0 * (u0 * -0.5f))) / (((sin2phi * alphax) / alphay) + ((alphay * cos2phi) / 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 = (alphay * alphax) * ((u0 - (u0 * (u0 * (-0.5e0)))) / (((sin2phi * alphax) / alphay) + ((alphay * cos2phi) / alphax)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(alphay * alphax) * Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(sin2phi * alphax) / alphay) + Float32(Float32(alphay * cos2phi) / alphax)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (alphay * alphax) * ((u0 - (u0 * (u0 * single(-0.5)))) / (((sin2phi * alphax) / alphay) + ((alphay * cos2phi) / alphax))); end
\begin{array}{l}
\\
\left(alphay \cdot alphax\right) \cdot \frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{sin2phi \cdot alphax}{alphay} + \frac{alphay \cdot cos2phi}{alphax}}
\end{array}
Initial program 61.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
neg-sub061.1%
sub-neg61.1%
log1p-def97.9%
Simplified97.9%
+-commutative97.9%
associate-/r*98.2%
associate-/r*98.2%
frac-add97.8%
Applied egg-rr97.8%
associate-/r/98.4%
*-commutative98.4%
fma-def98.5%
*-commutative98.5%
*-commutative98.5%
Applied egg-rr98.5%
Taylor expanded in alphax around 0 98.5%
Taylor expanded in u0 around 0 86.3%
+-commutative86.0%
neg-mul-186.0%
unsub-neg86.0%
*-commutative86.0%
unpow286.0%
associate-*l*86.0%
Simplified86.3%
Final simplification86.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.024000000208616257)
(/ u0 (+ t_0 (* (/ cos2phi alphax) (/ 1.0 alphax))))
(/ (* (* alphay alphay) (- u0 (* -0.5 (* u0 u0)))) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 0.024000000208616257f) {
tmp = u0 / (t_0 + ((cos2phi / alphax) * (1.0f / alphax)));
} else {
tmp = ((alphay * alphay) * (u0 - (-0.5f * (u0 * 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) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.024000000208616257e0) then
tmp = u0 / (t_0 + ((cos2phi / alphax) * (1.0e0 / alphax)))
else
tmp = ((alphay * alphay) * (u0 - ((-0.5e0) * (u0 * u0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.024000000208616257)) tmp = Float32(u0 / Float32(t_0 + Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(-0.5) * Float32(u0 * u0)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.024000000208616257)) tmp = u0 / (t_0 + ((cos2phi / alphax) * (single(1.0) / alphax))); else tmp = ((alphay * alphay) * (u0 - (single(-0.5) * (u0 * u0)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.024000000208616257:\\
\;\;\;\;\frac{u0}{t_0 + \frac{cos2phi}{alphax} \cdot \frac{1}{alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - -0.5 \cdot \left(u0 \cdot u0\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.0240000002Initial program 54.7%
Taylor expanded in u0 around 0 73.1%
unpow273.1%
unpow273.1%
Simplified73.1%
associate-/r*73.2%
div-inv73.2%
Applied egg-rr73.2%
if 0.0240000002 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 66.0%
Taylor expanded in cos2phi around 0 66.4%
mul-1-neg66.4%
unpow266.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in u0 around 0 86.9%
+-commutative86.9%
associate-*r*86.9%
neg-mul-186.9%
associate-*r*86.9%
distribute-rgt-out87.0%
unpow287.0%
unpow287.0%
Simplified87.0%
Final simplification81.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- u0 (* u0 (* u0 -0.5))) (+ (/ (/ sin2phi alphay) alphay) (* (/ cos2phi alphax) (/ 1.0 alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 - (u0 * (u0 * -0.5f))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (1.0f / 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 - (u0 * (u0 * (-0.5e0)))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (1.0e0 / alphax)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(sin2phi / alphay) / alphay) + Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 - (u0 * (u0 * single(-0.5)))) / (((sin2phi / alphay) / alphay) + ((cos2phi / alphax) * (single(1.0) / alphax))); end
\begin{array}{l}
\\
\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{sin2phi}{alphay}}{alphay} + \frac{cos2phi}{alphax} \cdot \frac{1}{alphax}}
\end{array}
Initial program 61.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
sub-neg61.1%
+-commutative61.1%
neg-sub061.1%
associate-+l-61.1%
sub0-neg61.1%
neg-mul-161.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.0%
associate-/r*98.2%
div-inv98.0%
Applied egg-rr98.0%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in u0 around 0 86.0%
+-commutative86.0%
neg-mul-186.0%
unsub-neg86.0%
*-commutative86.0%
unpow286.0%
associate-*l*86.0%
Simplified86.0%
div-inv86.0%
Applied egg-rr86.0%
Final simplification86.0%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.024000000208616257)
(/ u0 (+ (/ (/ cos2phi alphax) alphax) t_0))
(/ (+ u0 (* 0.5 (* u0 u0))) t_0))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 0.024000000208616257f) {
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
} else {
tmp = (u0 + (0.5f * (u0 * u0))) / t_0;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.024000000208616257e0) then
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0)
else
tmp = (u0 + (0.5e0 * (u0 * u0))) / t_0
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.024000000208616257)) tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0)); else tmp = Float32(Float32(u0 + Float32(Float32(0.5) * Float32(u0 * u0))) / t_0); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.024000000208616257)) tmp = u0 / (((cos2phi / alphax) / alphax) + t_0); else tmp = (u0 + (single(0.5) * (u0 * u0))) / t_0; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.024000000208616257:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{u0 + 0.5 \cdot \left(u0 \cdot u0\right)}{t_0}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.0240000002Initial program 54.7%
Taylor expanded in u0 around 0 73.1%
unpow273.1%
unpow273.1%
Simplified73.1%
associate-/r*73.2%
div-inv73.2%
Applied egg-rr73.2%
div-inv73.2%
Applied egg-rr73.2%
if 0.0240000002 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 66.0%
neg-sub066.0%
div-sub66.0%
--rgt-identity66.0%
div-sub66.0%
--rgt-identity66.0%
sub-neg66.0%
+-commutative66.0%
neg-sub066.0%
associate-+l-66.0%
sub0-neg66.0%
neg-mul-166.0%
log-prod-0.0%
associate--r+-0.0%
Simplified97.5%
associate-/r*97.7%
div-inv97.7%
Applied egg-rr97.7%
un-div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in u0 around 0 86.9%
+-commutative86.9%
neg-mul-186.9%
unsub-neg86.9%
*-commutative86.9%
unpow286.9%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in cos2phi around 0 87.0%
associate-/l*85.9%
cancel-sign-sub-inv85.9%
metadata-eval85.9%
unpow285.9%
unpow285.9%
Simplified85.9%
Final simplification80.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.024000000208616257)
(/ u0 (+ (/ (/ cos2phi alphax) alphax) t_0))
(* alphay (/ (- u0 (* u0 (* u0 -0.5))) (/ sin2phi alphay))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 0.024000000208616257f) {
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
} else {
tmp = alphay * ((u0 - (u0 * (u0 * -0.5f))) / (sin2phi / alphay));
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.024000000208616257e0) then
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0)
else
tmp = alphay * ((u0 - (u0 * (u0 * (-0.5e0)))) / (sin2phi / alphay))
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.024000000208616257)) tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0)); else tmp = Float32(alphay * Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(sin2phi / alphay))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.024000000208616257)) tmp = u0 / (((cos2phi / alphax) / alphax) + t_0); else tmp = alphay * ((u0 - (u0 * (u0 * single(-0.5)))) / (sin2phi / alphay)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.024000000208616257:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{sin2phi}{alphay}}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.0240000002Initial program 54.7%
Taylor expanded in u0 around 0 73.1%
unpow273.1%
unpow273.1%
Simplified73.1%
associate-/r*73.2%
div-inv73.2%
Applied egg-rr73.2%
div-inv73.2%
Applied egg-rr73.2%
if 0.0240000002 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 66.0%
Taylor expanded in cos2phi around 0 66.4%
mul-1-neg66.4%
unpow266.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in alphay around 0 66.4%
*-rgt-identity66.4%
times-frac66.4%
unpow266.4%
associate-/l*66.0%
times-frac66.0%
*-commutative66.0%
times-frac66.0%
/-rgt-identity66.0%
sub-neg66.0%
log1p-def97.3%
Simplified97.3%
Taylor expanded in u0 around 0 86.7%
+-commutative86.9%
neg-mul-186.9%
unsub-neg86.9%
*-commutative86.9%
unpow286.9%
associate-*l*86.9%
Simplified86.7%
Final simplification80.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.024000000208616257)
(/ u0 (+ (/ (/ cos2phi alphax) alphax) t_0))
(/ (* (* alphay alphay) (- u0 (* -0.5 (* u0 u0)))) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 0.024000000208616257f) {
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0);
} else {
tmp = ((alphay * alphay) * (u0 - (-0.5f * (u0 * 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) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.024000000208616257e0) then
tmp = u0 / (((cos2phi / alphax) / alphax) + t_0)
else
tmp = ((alphay * alphay) * (u0 - ((-0.5e0) * (u0 * u0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.024000000208616257)) tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0)); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(-0.5) * Float32(u0 * u0)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.024000000208616257)) tmp = u0 / (((cos2phi / alphax) / alphax) + t_0); else tmp = ((alphay * alphay) * (u0 - (single(-0.5) * (u0 * u0)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.024000000208616257:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - -0.5 \cdot \left(u0 \cdot u0\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.0240000002Initial program 54.7%
Taylor expanded in u0 around 0 73.1%
unpow273.1%
unpow273.1%
Simplified73.1%
associate-/r*73.2%
div-inv73.2%
Applied egg-rr73.2%
div-inv73.2%
Applied egg-rr73.2%
if 0.0240000002 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 66.0%
Taylor expanded in cos2phi around 0 66.4%
mul-1-neg66.4%
unpow266.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in u0 around 0 86.9%
+-commutative86.9%
associate-*r*86.9%
neg-mul-186.9%
associate-*r*86.9%
distribute-rgt-out87.0%
unpow287.0%
unpow287.0%
Simplified87.0%
Final simplification81.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 0.024000000208616257) (/ u0 (+ (/ (/ cos2phi alphax) alphax) (/ (/ sin2phi alphay) alphay))) (/ (* (* alphay alphay) (- u0 (* -0.5 (* u0 u0)))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 0.024000000208616257f) {
tmp = u0 / (((cos2phi / alphax) / alphax) + ((sin2phi / alphay) / alphay));
} else {
tmp = ((alphay * alphay) * (u0 - (-0.5f * (u0 * u0)))) / sin2phi;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if ((sin2phi / (alphay * alphay)) <= 0.024000000208616257e0) then
tmp = u0 / (((cos2phi / alphax) / alphax) + ((sin2phi / alphay) / alphay))
else
tmp = ((alphay * alphay) * (u0 - ((-0.5e0) * (u0 * u0)))) / sin2phi
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.024000000208616257)) tmp = Float32(u0 / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32(Float32(sin2phi / alphay) / alphay))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(Float32(-0.5) * Float32(u0 * u0)))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(0.024000000208616257)) tmp = u0 / (((cos2phi / alphax) / alphax) + ((sin2phi / alphay) / alphay)); else tmp = ((alphay * alphay) * (u0 - (single(-0.5) * (u0 * u0)))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.024000000208616257:\\
\;\;\;\;\frac{u0}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - -0.5 \cdot \left(u0 \cdot u0\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.0240000002Initial program 54.7%
neg-sub054.7%
div-sub54.7%
--rgt-identity54.7%
div-sub54.7%
--rgt-identity54.7%
sub-neg54.7%
+-commutative54.7%
neg-sub054.7%
associate-+l-54.7%
sub0-neg54.7%
neg-mul-154.7%
log-prod-0.0%
associate--r+-0.0%
Simplified98.5%
associate-/r*98.8%
div-inv98.5%
Applied egg-rr98.5%
un-div-inv98.8%
Applied egg-rr98.8%
Taylor expanded in u0 around 0 73.2%
neg-mul-173.2%
Simplified73.2%
if 0.0240000002 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 66.0%
Taylor expanded in cos2phi around 0 66.4%
mul-1-neg66.4%
unpow266.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in u0 around 0 86.9%
+-commutative86.9%
associate-*r*86.9%
neg-mul-186.9%
associate-*r*86.9%
distribute-rgt-out87.0%
unpow287.0%
unpow287.0%
Simplified87.0%
Final simplification81.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (+ u0 (* 0.5 (* u0 u0))) (+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 + (0.5f * (u0 * 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 + (0.5e0 * (u0 * u0))) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(u0 + Float32(Float32(0.5) * Float32(u0 * u0))) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 + (single(0.5) * (u0 * u0))) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax))); end
\begin{array}{l}
\\
\frac{u0 + 0.5 \cdot \left(u0 \cdot u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}
\end{array}
Initial program 61.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
sub-neg61.1%
+-commutative61.1%
neg-sub061.1%
associate-+l-61.1%
sub0-neg61.1%
neg-mul-161.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.0%
associate-/r*98.2%
div-inv98.0%
Applied egg-rr98.0%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in u0 around 0 86.0%
+-commutative86.0%
neg-mul-186.0%
unsub-neg86.0%
*-commutative86.0%
unpow286.0%
associate-*l*86.0%
Simplified86.0%
*-un-lft-identity86.0%
associate-/r*85.9%
+-commutative85.9%
associate-/r*86.0%
associate-/r*85.9%
Applied egg-rr85.9%
*-lft-identity85.9%
neg-sub085.9%
metadata-eval85.9%
associate--r-85.9%
metadata-eval85.9%
neg-sub085.9%
associate-*r*85.9%
unpow285.9%
*-commutative85.9%
distribute-lft-neg-in85.9%
metadata-eval85.9%
unpow285.9%
+-commutative85.9%
associate-/l/85.9%
Simplified85.9%
Final simplification85.9%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- u0 (* u0 (* u0 -0.5))) (+ (/ (/ cos2phi alphax) alphax) (/ (/ sin2phi alphay) alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (u0 - (u0 * (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 - (u0 * (u0 * (-0.5e0)))) / (((cos2phi / alphax) / alphax) + ((sin2phi / alphay) / alphay))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(cos2phi / alphax) / alphax) + Float32(Float32(sin2phi / alphay) / alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (u0 - (u0 * (u0 * single(-0.5)))) / (((cos2phi / alphax) / alphax) + ((sin2phi / alphay) / alphay)); end
\begin{array}{l}
\\
\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}
\end{array}
Initial program 61.1%
neg-sub061.1%
div-sub61.1%
--rgt-identity61.1%
div-sub61.1%
--rgt-identity61.1%
sub-neg61.1%
+-commutative61.1%
neg-sub061.1%
associate-+l-61.1%
sub0-neg61.1%
neg-mul-161.1%
log-prod-0.0%
associate--r+-0.0%
Simplified98.0%
associate-/r*98.2%
div-inv98.0%
Applied egg-rr98.0%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in u0 around 0 86.0%
+-commutative86.0%
neg-mul-186.0%
unsub-neg86.0%
*-commutative86.0%
unpow286.0%
associate-*l*86.0%
Simplified86.0%
Final simplification86.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.99999996490334e-13) (/ u0 (/ (- (/ cos2phi alphax)) (- alphax))) (* alphay (* alphay (/ u0 sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.99999996490334e-13f) {
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 / (alphay * alphay)) <= 1.99999996490334e-13) 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.99999996490334e-13)) tmp = Float32(u0 / Float32(Float32(-Float32(cos2phi / alphax)) / Float32(-alphax))); else tmp = Float32(alphay * Float32(alphay * Float32(u0 / sin2phi))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(1.99999996490334e-13)) tmp = u0 / (-(cos2phi / alphax) / -alphax); else tmp = alphay * (alphay * (u0 / sin2phi)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.99999996490334 \cdot 10^{-13}:\\
\;\;\;\;\frac{u0}{\frac{-\frac{cos2phi}{alphax}}{-alphax}}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \left(alphay \cdot \frac{u0}{sin2phi}\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999996e-13Initial program 52.8%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 54.0%
associate-/l*54.2%
unpow254.2%
Simplified54.2%
associate-/r*54.3%
frac-2neg54.3%
distribute-frac-neg54.3%
Applied egg-rr54.3%
if 1.99999996e-13 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 64.7%
Taylor expanded in cos2phi around 0 61.6%
mul-1-neg61.6%
unpow261.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in alphay around 0 61.6%
*-rgt-identity61.6%
times-frac61.6%
unpow261.6%
associate-/l*61.2%
times-frac61.3%
*-commutative61.3%
times-frac61.2%
/-rgt-identity61.2%
sub-neg61.2%
log1p-def91.4%
Simplified91.4%
Taylor expanded in u0 around 0 70.0%
mul-1-neg70.0%
*-commutative70.0%
associate-*r/69.9%
*-commutative69.9%
distribute-rgt-neg-in69.9%
Simplified69.9%
Final simplification65.2%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.99999996490334e-13) (/ u0 (/ (- (/ cos2phi alphax)) (- alphax))) (* alphay (/ (* u0 alphay) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.99999996490334e-13f) {
tmp = u0 / (-(cos2phi / alphax) / -alphax);
} else {
tmp = alphay * ((u0 * alphay) / sin2phi);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
real(4) :: tmp
if ((sin2phi / (alphay * alphay)) <= 1.99999996490334e-13) then
tmp = u0 / (-(cos2phi / alphax) / -alphax)
else
tmp = alphay * ((u0 * alphay) / sin2phi)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.99999996490334e-13)) tmp = Float32(u0 / Float32(Float32(-Float32(cos2phi / alphax)) / Float32(-alphax))); else tmp = Float32(alphay * Float32(Float32(u0 * alphay) / sin2phi)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(1.99999996490334e-13)) tmp = u0 / (-(cos2phi / alphax) / -alphax); else tmp = alphay * ((u0 * alphay) / sin2phi); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.99999996490334 \cdot 10^{-13}:\\
\;\;\;\;\frac{u0}{\frac{-\frac{cos2phi}{alphax}}{-alphax}}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \frac{u0 \cdot alphay}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999996e-13Initial program 52.8%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 54.0%
associate-/l*54.2%
unpow254.2%
Simplified54.2%
associate-/r*54.3%
frac-2neg54.3%
distribute-frac-neg54.3%
Applied egg-rr54.3%
if 1.99999996e-13 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 64.7%
Taylor expanded in cos2phi around 0 61.6%
mul-1-neg61.6%
unpow261.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in alphay around 0 61.6%
*-rgt-identity61.6%
times-frac61.6%
unpow261.6%
associate-/l*61.2%
times-frac61.3%
*-commutative61.3%
times-frac61.2%
/-rgt-identity61.2%
sub-neg61.2%
log1p-def91.4%
Simplified91.4%
Taylor expanded in u0 around 0 70.0%
Final simplification65.2%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.99999996490334e-13) (/ u0 (/ cos2phi (* alphax alphax))) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.99999996490334e-13f) {
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 / (alphay * alphay)) <= 1.99999996490334e-13) 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.99999996490334e-13)) 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 / (alphay * alphay)) <= single(1.99999996490334e-13)) tmp = u0 / (cos2phi / (alphax * alphax)); else tmp = (alphay * alphay) * (u0 / sin2phi); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.99999996490334 \cdot 10^{-13}:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999996e-13Initial program 52.8%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 54.0%
associate-/l*54.2%
unpow254.2%
Simplified54.2%
if 1.99999996e-13 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 64.7%
Taylor expanded in u0 around 0 72.9%
unpow272.9%
unpow272.9%
Simplified72.9%
Taylor expanded in cos2phi around 0 69.8%
*-commutative69.8%
*-lft-identity69.8%
times-frac69.8%
/-rgt-identity69.8%
unpow269.8%
Simplified69.8%
Final simplification65.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.99999996490334e-13) (/ u0 (/ cos2phi (* alphax alphax))) (* alphay (* alphay (/ u0 sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.99999996490334e-13f) {
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 / (alphay * alphay)) <= 1.99999996490334e-13) 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.99999996490334e-13)) tmp = Float32(u0 / Float32(cos2phi / Float32(alphax * alphax))); else tmp = Float32(alphay * Float32(alphay * Float32(u0 / sin2phi))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(1.99999996490334e-13)) tmp = u0 / (cos2phi / (alphax * alphax)); else tmp = alphay * (alphay * (u0 / sin2phi)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.99999996490334 \cdot 10^{-13}:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;alphay \cdot \left(alphay \cdot \frac{u0}{sin2phi}\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999996e-13Initial program 52.8%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 54.0%
associate-/l*54.2%
unpow254.2%
Simplified54.2%
if 1.99999996e-13 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 64.7%
Taylor expanded in cos2phi around 0 61.6%
mul-1-neg61.6%
unpow261.6%
*-commutative61.6%
Simplified61.6%
Taylor expanded in alphay around 0 61.6%
*-rgt-identity61.6%
times-frac61.6%
unpow261.6%
associate-/l*61.2%
times-frac61.3%
*-commutative61.3%
times-frac61.2%
/-rgt-identity61.2%
sub-neg61.2%
log1p-def91.4%
Simplified91.4%
Taylor expanded in u0 around 0 70.0%
mul-1-neg70.0%
*-commutative70.0%
associate-*r/69.9%
*-commutative69.9%
distribute-rgt-neg-in69.9%
Simplified69.9%
Final simplification65.1%
(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.1%
Taylor expanded in u0 around 0 73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
Final simplification73.5%
(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(Float32(cos2phi / 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{\frac{cos2phi}{alphax}}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 61.1%
Taylor expanded in u0 around 0 73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
associate-/r*73.6%
div-inv73.6%
Applied egg-rr73.6%
div-inv73.6%
Applied egg-rr73.6%
Final simplification73.6%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= sin2phi 1.0000000168623835e-16) (* (* alphax alphax) (/ u0 cos2phi)) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.0000000168623835e-16f) {
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 <= 1.0000000168623835e-16) 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(1.0000000168623835e-16)) 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(1.0000000168623835e-16)) 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 1.0000000168623835 \cdot 10^{-16}:\\
\;\;\;\;\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 < 1.00000002e-16Initial program 52.3%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 53.5%
associate-/l*53.7%
unpow253.7%
Simplified53.7%
associate-/r/53.5%
Applied egg-rr53.5%
if 1.00000002e-16 < sin2phi Initial program 65.2%
Taylor expanded in u0 around 0 72.9%
unpow272.9%
unpow272.9%
Simplified72.9%
Taylor expanded in cos2phi around 0 70.2%
*-commutative70.2%
*-lft-identity70.2%
times-frac70.3%
/-rgt-identity70.3%
unpow270.3%
Simplified70.3%
Final simplification65.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.1%
Taylor expanded in u0 around 0 73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
Taylor expanded in cos2phi around 0 55.8%
*-commutative55.8%
*-lft-identity55.8%
times-frac55.8%
/-rgt-identity55.8%
unpow255.8%
Simplified55.8%
Final simplification55.8%
herbie shell --seed 2023240
(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)))))