
(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 18 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)) (- (/ (* alphax (- (* alphax sin2phi))) alphay) (* alphay cos2phi))) (* alphax (* alphax alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (log1pf(-u0) / (((alphax * -(alphax * sin2phi)) / alphay) - (alphay * cos2phi))) * (alphax * (alphax * alphay));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(log1p(Float32(-u0)) / Float32(Float32(Float32(alphax * Float32(-Float32(alphax * sin2phi))) / alphay) - Float32(alphay * cos2phi))) * Float32(alphax * Float32(alphax * alphay))) end
\begin{array}{l}
\\
\frac{\mathsf{log1p}\left(-u0\right)}{\frac{alphax \cdot \left(-alphax \cdot sin2phi\right)}{alphay} - alphay \cdot cos2phi} \cdot \left(alphax \cdot \left(alphax \cdot alphay\right)\right)
\end{array}
Initial program 57.9%
neg-sub057.9%
div-sub57.9%
--rgt-identity57.9%
div-sub57.9%
--rgt-identity57.9%
neg-sub057.9%
sub-neg57.9%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*98.0%
frac-2neg98.0%
frac-add97.6%
distribute-rgt-neg-in97.6%
distribute-rgt-neg-in97.6%
Applied egg-rr97.6%
*-commutative97.6%
associate-*l*97.6%
*-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*r/97.4%
distribute-rgt-neg-out97.4%
distribute-lft-neg-in97.4%
distribute-rgt-neg-out97.4%
*-commutative97.4%
associate-/l*97.6%
*-commutative97.6%
distribute-lft-neg-out97.6%
distribute-rgt-neg-in97.6%
Simplified97.6%
div-inv97.4%
associate-/r*97.4%
Applied egg-rr97.4%
associate-*r/97.5%
*-rgt-identity97.5%
distribute-neg-frac97.5%
associate-/r/98.4%
distribute-lft-neg-in98.4%
distribute-frac-neg98.4%
*-commutative98.4%
distribute-rgt-neg-out98.4%
distribute-lft-neg-in98.4%
Simplified98.3%
Final simplification98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 100000.0)
(/ (- u0 (* u0 (* u0 -0.5))) (+ (/ (/ cos2phi alphax) alphax) t_0))
(/ (* alphay (* alphay (- (log1p (- 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 <= 100000.0f) {
tmp = (u0 - (u0 * (u0 * -0.5f))) / (((cos2phi / alphax) / alphax) + t_0);
} else {
tmp = (alphay * (alphay * -log1pf(-u0))) / sin2phi;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(100000.0)) tmp = Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(cos2phi / alphax) / alphax) + t_0)); else tmp = Float32(Float32(alphay * Float32(alphay * Float32(-log1p(Float32(-u0))))) / sin2phi); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 100000:\\
\;\;\;\;\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{alphay \cdot \left(alphay \cdot \left(-\mathsf{log1p}\left(-u0\right)\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1e5Initial program 54.0%
associate-/r*54.0%
Simplified54.0%
Taylor expanded in u0 around 0 88.0%
+-commutative46.3%
mul-1-neg46.3%
unsub-neg46.3%
unpow246.3%
associate-*r*46.3%
Simplified88.0%
if 1e5 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.6%
associate-/r*61.6%
Simplified61.6%
Taylor expanded in cos2phi around 0 63.2%
mul-1-neg63.2%
unpow263.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in alphay around 0 63.2%
unpow263.2%
sub-neg63.2%
log1p-def98.7%
Simplified98.7%
Taylor expanded in alphay around 0 63.2%
unpow263.2%
sub-neg63.2%
log1p-def98.7%
associate-*r*98.8%
Simplified98.8%
Final simplification93.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 100000.0)
(/ (- u0 (* u0 (* u0 -0.5))) (+ (/ (/ cos2phi alphax) alphax) t_0))
(* (log1p (- u0)) (/ (- (* alphay alphay)) sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if (t_0 <= 100000.0f) {
tmp = (u0 - (u0 * (u0 * -0.5f))) / (((cos2phi / alphax) / alphax) + t_0);
} else {
tmp = log1pf(-u0) * (-(alphay * alphay) / sin2phi);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(100000.0)) tmp = Float32(Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5)))) / Float32(Float32(Float32(cos2phi / alphax) / alphax) + 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 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 100000:\\
\;\;\;\;\frac{u0 - u0 \cdot \left(u0 \cdot -0.5\right)}{\frac{\frac{cos2phi}{alphax}}{alphax} + 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)) < 1e5Initial program 54.0%
associate-/r*54.0%
Simplified54.0%
Taylor expanded in u0 around 0 88.0%
+-commutative46.3%
mul-1-neg46.3%
unsub-neg46.3%
unpow246.3%
associate-*r*46.3%
Simplified88.0%
if 1e5 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.6%
neg-sub061.6%
div-sub61.6%
--rgt-identity61.6%
div-sub61.6%
--rgt-identity61.6%
neg-sub061.6%
sub-neg61.6%
log1p-def97.4%
Simplified97.4%
+-commutative97.4%
associate-/r*97.4%
frac-2neg97.4%
frac-add97.0%
distribute-rgt-neg-in97.0%
distribute-rgt-neg-in97.0%
Applied egg-rr97.0%
*-commutative97.0%
associate-*l*96.9%
*-commutative96.9%
distribute-rgt-neg-out96.9%
unsub-neg96.9%
associate-*r/96.7%
distribute-rgt-neg-out96.7%
distribute-lft-neg-in96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-/l*96.9%
*-commutative96.9%
distribute-lft-neg-out96.9%
distribute-rgt-neg-in96.9%
Simplified96.9%
div-inv96.8%
associate-/r*96.8%
Applied egg-rr96.8%
associate-/r/98.3%
distribute-frac-neg98.3%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in sin2phi around inf 98.9%
unpow298.9%
Simplified98.9%
Final simplification93.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(-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 57.9%
neg-sub057.9%
div-sub57.9%
--rgt-identity57.9%
div-sub57.9%
--rgt-identity57.9%
neg-sub057.9%
sub-neg57.9%
log1p-def98.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(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 57.9%
neg-sub057.9%
div-sub57.9%
--rgt-identity57.9%
div-sub57.9%
--rgt-identity57.9%
sub-neg57.9%
+-commutative57.9%
neg-sub057.9%
associate-+l-57.9%
sub0-neg57.9%
neg-mul-157.9%
log-prod-0.0%
associate--r+-0.0%
Simplified98.1%
Final simplification98.1%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* (* alphay (* alphax alphax)) (/ (- (* u0 (* u0 -0.5)) u0) (- (/ (* alphax (- (* alphax sin2phi))) alphay) (* alphay cos2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (alphay * (alphax * alphax)) * (((u0 * (u0 * -0.5f)) - u0) / (((alphax * -(alphax * sin2phi)) / alphay) - (alphay * cos2phi)));
}
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 * alphax)) * (((u0 * (u0 * (-0.5e0))) - u0) / (((alphax * -(alphax * sin2phi)) / alphay) - (alphay * cos2phi)))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(alphay * Float32(alphax * alphax)) * Float32(Float32(Float32(u0 * Float32(u0 * Float32(-0.5))) - u0) / Float32(Float32(Float32(alphax * Float32(-Float32(alphax * sin2phi))) / alphay) - Float32(alphay * cos2phi)))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (alphay * (alphax * alphax)) * (((u0 * (u0 * single(-0.5))) - u0) / (((alphax * -(alphax * sin2phi)) / alphay) - (alphay * cos2phi))); end
\begin{array}{l}
\\
\left(alphay \cdot \left(alphax \cdot alphax\right)\right) \cdot \frac{u0 \cdot \left(u0 \cdot -0.5\right) - u0}{\frac{alphax \cdot \left(-alphax \cdot sin2phi\right)}{alphay} - alphay \cdot cos2phi}
\end{array}
Initial program 57.9%
neg-sub057.9%
div-sub57.9%
--rgt-identity57.9%
div-sub57.9%
--rgt-identity57.9%
neg-sub057.9%
sub-neg57.9%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*98.0%
frac-2neg98.0%
frac-add97.6%
distribute-rgt-neg-in97.6%
distribute-rgt-neg-in97.6%
Applied egg-rr97.6%
*-commutative97.6%
associate-*l*97.6%
*-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*r/97.4%
distribute-rgt-neg-out97.4%
distribute-lft-neg-in97.4%
distribute-rgt-neg-out97.4%
*-commutative97.4%
associate-/l*97.6%
*-commutative97.6%
distribute-lft-neg-out97.6%
distribute-rgt-neg-in97.6%
Simplified97.6%
div-inv97.4%
associate-/r*97.4%
Applied egg-rr97.4%
associate-*r/97.5%
*-rgt-identity97.5%
distribute-neg-frac97.5%
associate-/r/98.4%
distribute-lft-neg-in98.4%
distribute-frac-neg98.4%
*-commutative98.4%
distribute-rgt-neg-out98.4%
distribute-lft-neg-in98.4%
Simplified98.3%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
*-commutative87.9%
unpow287.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in alphax around 0 87.9%
mul-1-neg87.9%
*-commutative87.9%
unpow287.9%
Simplified87.9%
Final simplification87.9%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* (/ (- (* u0 (* u0 -0.5)) u0) (- (/ alphax (/ alphay (- (* alphax sin2phi)))) (* alphay cos2phi))) (* alphax (* alphax alphay))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (((u0 * (u0 * -0.5f)) - u0) / ((alphax / (alphay / -(alphax * sin2phi))) - (alphay * cos2phi))) * (alphax * (alphax * alphay));
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
real(4), intent (in) :: alphax
real(4), intent (in) :: alphay
real(4), intent (in) :: u0
real(4), intent (in) :: cos2phi
real(4), intent (in) :: sin2phi
code = (((u0 * (u0 * (-0.5e0))) - u0) / ((alphax / (alphay / -(alphax * sin2phi))) - (alphay * cos2phi))) * (alphax * (alphax * alphay))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(Float32(Float32(u0 * Float32(u0 * Float32(-0.5))) - u0) / Float32(Float32(alphax / Float32(alphay / Float32(-Float32(alphax * sin2phi)))) - Float32(alphay * cos2phi))) * Float32(alphax * Float32(alphax * alphay))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = (((u0 * (u0 * single(-0.5))) - u0) / ((alphax / (alphay / -(alphax * sin2phi))) - (alphay * cos2phi))) * (alphax * (alphax * alphay)); end
\begin{array}{l}
\\
\frac{u0 \cdot \left(u0 \cdot -0.5\right) - u0}{\frac{alphax}{\frac{alphay}{-alphax \cdot sin2phi}} - alphay \cdot cos2phi} \cdot \left(alphax \cdot \left(alphax \cdot alphay\right)\right)
\end{array}
Initial program 57.9%
neg-sub057.9%
div-sub57.9%
--rgt-identity57.9%
div-sub57.9%
--rgt-identity57.9%
neg-sub057.9%
sub-neg57.9%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*98.0%
frac-2neg98.0%
frac-add97.6%
distribute-rgt-neg-in97.6%
distribute-rgt-neg-in97.6%
Applied egg-rr97.6%
*-commutative97.6%
associate-*l*97.6%
*-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*r/97.4%
distribute-rgt-neg-out97.4%
distribute-lft-neg-in97.4%
distribute-rgt-neg-out97.4%
*-commutative97.4%
associate-/l*97.6%
*-commutative97.6%
distribute-lft-neg-out97.6%
distribute-rgt-neg-in97.6%
Simplified97.6%
div-inv97.4%
associate-/r*97.4%
Applied egg-rr97.4%
associate-*r/97.5%
*-rgt-identity97.5%
distribute-neg-frac97.5%
associate-/r/98.4%
distribute-lft-neg-in98.4%
distribute-frac-neg98.4%
*-commutative98.4%
distribute-rgt-neg-out98.4%
distribute-lft-neg-in98.4%
Simplified98.3%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
*-commutative87.9%
unpow287.9%
associate-*l*87.9%
Simplified87.9%
*-un-lft-identity87.9%
distribute-rgt-neg-in87.9%
*-commutative87.9%
*-commutative87.9%
Applied egg-rr87.9%
*-lft-identity87.9%
associate-/l*88.0%
distribute-rgt-neg-in88.0%
*-commutative88.0%
Simplified88.0%
Final simplification88.0%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 18000.0)
(/
u0
(+ (/ cos2phi (* alphax alphax)) (* (/ sin2phi alphay) (/ 1.0 alphay))))
(-
(* (* alphay alphay) (/ u0 sin2phi))
(* -0.5 (/ (* (* alphay u0) (* alphay u0)) sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 18000.0f) {
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (1.0f / alphay)));
} else {
tmp = ((alphay * alphay) * (u0 / sin2phi)) - (-0.5f * (((alphay * u0) * (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)) <= 18000.0e0) then
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (1.0e0 / alphay)))
else
tmp = ((alphay * alphay) * (u0 / sin2phi)) - ((-0.5e0) * (((alphay * u0) * (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(18000.0)) tmp = Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) * Float32(Float32(1.0) / alphay)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 / sin2phi)) - Float32(Float32(-0.5) * Float32(Float32(Float32(alphay * u0) * Float32(alphay * u0)) / sin2phi))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(18000.0)) tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (single(1.0) / alphay))); else tmp = ((alphay * alphay) * (u0 / sin2phi)) - (single(-0.5) * (((alphay * u0) * (alphay * u0)) / sin2phi)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 18000:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi} - -0.5 \cdot \frac{\left(alphay \cdot u0\right) \cdot \left(alphay \cdot u0\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 18000Initial program 54.1%
associate-/r*54.2%
Simplified54.2%
Taylor expanded in u0 around 0 75.8%
unpow275.8%
unpow275.8%
Simplified75.8%
associate-/r*75.8%
div-inv75.9%
Applied egg-rr75.9%
if 18000 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.3%
associate-/r*61.3%
Simplified61.3%
Taylor expanded in cos2phi around 0 62.7%
mul-1-neg62.7%
unpow262.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in alphay around 0 62.7%
unpow262.7%
sub-neg62.7%
log1p-def98.4%
Simplified98.4%
Taylor expanded in u0 around 0 88.4%
mul-1-neg88.4%
unsub-neg88.4%
*-commutative88.4%
unpow288.4%
unpow288.4%
unswap-sqr88.4%
*-commutative88.4%
*-lft-identity88.4%
times-frac88.4%
/-rgt-identity88.4%
unpow288.4%
Simplified88.4%
Final simplification82.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 18000.0)
(/
u0
(+ (/ cos2phi (* alphax alphax)) (* (/ sin2phi alphay) (/ 1.0 alphay))))
(/ (* (* alphay alphay) (- u0 (* u0 (* u0 -0.5)))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 18000.0f) {
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (1.0f / alphay)));
} 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 / (alphay * alphay)) <= 18000.0e0) then
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (1.0e0 / alphay)))
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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(18000.0)) tmp = Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) * Float32(Float32(1.0) / alphay)))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5))))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(18000.0)) tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) * (single(1.0) / alphay))); else tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * single(-0.5))))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 18000:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay} \cdot \frac{1}{alphay}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 18000Initial program 54.1%
associate-/r*54.2%
Simplified54.2%
Taylor expanded in u0 around 0 75.8%
unpow275.8%
unpow275.8%
Simplified75.8%
associate-/r*75.8%
div-inv75.9%
Applied egg-rr75.9%
if 18000 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.3%
associate-/r*61.3%
Simplified61.3%
Taylor expanded in cos2phi around 0 62.7%
mul-1-neg62.7%
unpow262.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in u0 around 0 88.2%
+-commutative88.2%
mul-1-neg88.2%
unsub-neg88.2%
unpow288.2%
associate-*r*88.2%
Simplified88.2%
Final simplification82.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 18000.0)
(/ u0 (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay)))
(/ (+ 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 <= 18000.0f) {
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
} 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 <= 18000.0e0) then
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
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(18000.0)) tmp = Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))); 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(18000.0)) tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); 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 18000:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
\mathbf{else}:\\
\;\;\;\;\frac{u0 + 0.5 \cdot \left(u0 \cdot u0\right)}{t_0}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 18000Initial program 54.1%
associate-/r*54.2%
Simplified54.2%
Taylor expanded in u0 around 0 75.8%
unpow275.8%
unpow275.8%
Simplified75.8%
associate-/r*75.8%
div-inv75.9%
Applied egg-rr75.9%
un-div-inv75.8%
Applied egg-rr75.8%
if 18000 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.3%
neg-sub061.3%
div-sub61.3%
--rgt-identity61.3%
div-sub61.3%
--rgt-identity61.3%
neg-sub061.3%
sub-neg61.3%
log1p-def97.5%
Simplified97.5%
+-commutative97.5%
associate-/r*97.4%
frac-2neg97.4%
frac-add97.0%
distribute-rgt-neg-in97.0%
distribute-rgt-neg-in97.0%
Applied egg-rr97.0%
*-commutative97.0%
associate-*l*97.0%
*-commutative97.0%
distribute-rgt-neg-out97.0%
unsub-neg97.0%
associate-*r/96.7%
distribute-rgt-neg-out96.7%
distribute-lft-neg-in96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-/l*97.0%
*-commutative97.0%
distribute-lft-neg-out97.0%
distribute-rgt-neg-in97.0%
Simplified97.0%
div-inv96.9%
associate-/r*96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
distribute-neg-frac96.9%
associate-/r/98.6%
distribute-lft-neg-in98.6%
distribute-frac-neg98.6%
*-commutative98.6%
distribute-rgt-neg-out98.6%
distribute-lft-neg-in98.6%
Simplified98.7%
Taylor expanded in u0 around 0 88.7%
+-commutative88.7%
neg-mul-188.7%
unsub-neg88.7%
*-commutative88.7%
unpow288.7%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in alphax around inf 88.2%
associate-/l*87.4%
cancel-sign-sub-inv87.4%
metadata-eval87.4%
unpow287.4%
unpow287.4%
Simplified87.4%
Final simplification82.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 18000.0) (/ u0 (+ (/ cos2phi (* alphax alphax)) (/ (/ sin2phi alphay) alphay))) (/ (* (* alphay alphay) (- u0 (* u0 (* u0 -0.5)))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 18000.0f) {
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay));
} 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 / (alphay * alphay)) <= 18000.0e0) then
tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay))
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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(18000.0)) tmp = Float32(u0 / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(Float32(sin2phi / alphay) / alphay))); else tmp = Float32(Float32(Float32(alphay * alphay) * Float32(u0 - Float32(u0 * Float32(u0 * Float32(-0.5))))) / sin2phi); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((sin2phi / (alphay * alphay)) <= single(18000.0)) tmp = u0 / ((cos2phi / (alphax * alphax)) + ((sin2phi / alphay) / alphay)); else tmp = ((alphay * alphay) * (u0 - (u0 * (u0 * single(-0.5))))) / sin2phi; end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 18000:\\
\;\;\;\;\frac{u0}{\frac{cos2phi}{alphax \cdot alphax} + \frac{\frac{sin2phi}{alphay}}{alphay}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(alphay \cdot alphay\right) \cdot \left(u0 - u0 \cdot \left(u0 \cdot -0.5\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 18000Initial program 54.1%
associate-/r*54.2%
Simplified54.2%
Taylor expanded in u0 around 0 75.8%
unpow275.8%
unpow275.8%
Simplified75.8%
associate-/r*75.8%
div-inv75.9%
Applied egg-rr75.9%
un-div-inv75.8%
Applied egg-rr75.8%
if 18000 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 61.3%
associate-/r*61.3%
Simplified61.3%
Taylor expanded in cos2phi around 0 62.7%
mul-1-neg62.7%
unpow262.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in u0 around 0 88.2%
+-commutative88.2%
mul-1-neg88.2%
unsub-neg88.2%
unpow288.2%
associate-*r*88.2%
Simplified88.2%
Final simplification82.4%
(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(sin2phi / Float32(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{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in u0 around 0 87.8%
+-commutative68.0%
mul-1-neg68.0%
unsub-neg68.0%
unpow268.0%
associate-*r*68.0%
Simplified87.8%
Final simplification87.8%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.9999999920083944e-11) (* alphax (/ (* alphax u0) cos2phi)) (* u0 (* alphay (/ alphay sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.9999999920083944e-11f) {
tmp = alphax * ((alphax * u0) / 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 / (alphay * alphay)) <= 1.9999999920083944e-11) then
tmp = alphax * ((alphax * u0) / 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.9999999920083944e-11)) tmp = Float32(alphax * Float32(Float32(alphax * u0) / cos2phi)); else tmp = Float32(u0 * Float32(alphay * Float32(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.9999999920083944e-11)) tmp = alphax * ((alphax * u0) / cos2phi); else tmp = u0 * (alphay * (alphay / sin2phi)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.9999999920083944 \cdot 10^{-11}:\\
\;\;\;\;alphax \cdot \frac{alphax \cdot u0}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;u0 \cdot \left(alphay \cdot \frac{alphay}{sin2phi}\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999999e-11Initial program 55.0%
associate-/r*55.2%
Simplified55.2%
Taylor expanded in u0 around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
Taylor expanded in cos2phi around inf 54.5%
unpow254.5%
associate-/l*54.3%
associate-/r/54.4%
Simplified54.4%
Taylor expanded in u0 around 0 54.5%
associate-*l/54.4%
*-commutative54.4%
unpow254.4%
associate-*l*54.4%
Simplified54.4%
Taylor expanded in alphax around 0 54.5%
if 1.99999999e-11 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 59.0%
associate-/r*59.0%
Simplified59.0%
Taylor expanded in u0 around 0 76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
div-inv76.7%
+-commutative76.7%
Applied egg-rr76.7%
Taylor expanded in sin2phi around inf 73.1%
unpow273.1%
*-lft-identity73.1%
times-frac73.3%
/-rgt-identity73.3%
Simplified73.3%
Final simplification68.2%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 1.9999999920083944e-11) (/ (* alphax (* alphax u0)) cos2phi) (* u0 (* alphay (/ alphay sin2phi)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 1.9999999920083944e-11f) {
tmp = (alphax * (alphax * u0)) / 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 / (alphay * alphay)) <= 1.9999999920083944e-11) then
tmp = (alphax * (alphax * u0)) / 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(1.9999999920083944e-11)) tmp = Float32(Float32(alphax * Float32(alphax * u0)) / cos2phi); else tmp = Float32(u0 * Float32(alphay * Float32(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.9999999920083944e-11)) tmp = (alphax * (alphax * u0)) / cos2phi; else tmp = u0 * (alphay * (alphay / sin2phi)); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 1.9999999920083944 \cdot 10^{-11}:\\
\;\;\;\;\frac{alphax \cdot \left(alphax \cdot u0\right)}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;u0 \cdot \left(alphay \cdot \frac{alphay}{sin2phi}\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 1.99999999e-11Initial program 55.0%
associate-/r*55.2%
Simplified55.2%
Taylor expanded in cos2phi around inf 41.0%
associate-*r/41.0%
unpow241.0%
*-commutative41.0%
associate-*r*41.0%
neg-mul-141.0%
distribute-rgt-neg-out41.0%
sub-neg41.0%
mul-1-neg41.0%
log1p-def68.8%
mul-1-neg68.8%
Simplified68.8%
Taylor expanded in u0 around 0 54.5%
*-commutative54.5%
unpow254.5%
associate-*l*54.5%
Simplified54.5%
if 1.99999999e-11 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 59.0%
associate-/r*59.0%
Simplified59.0%
Taylor expanded in u0 around 0 76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
div-inv76.7%
+-commutative76.7%
Applied egg-rr76.7%
Taylor expanded in sin2phi around inf 73.1%
unpow273.1%
*-lft-identity73.1%
times-frac73.3%
/-rgt-identity73.3%
Simplified73.3%
Final simplification68.2%
(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 57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in u0 around 0 76.3%
unpow276.3%
unpow276.3%
Simplified76.3%
Final simplification76.3%
(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 57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in u0 around 0 76.3%
unpow276.3%
unpow276.3%
Simplified76.3%
associate-/r*76.3%
div-inv76.3%
Applied egg-rr76.3%
un-div-inv76.3%
Applied egg-rr76.3%
Final simplification76.3%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* alphax (* alphax (/ u0 cos2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return alphax * (alphax * (u0 / cos2phi));
}
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 = alphax * (alphax * (u0 / cos2phi))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(alphax * Float32(alphax * Float32(u0 / cos2phi))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = alphax * (alphax * (u0 / cos2phi)); end
\begin{array}{l}
\\
alphax \cdot \left(alphax \cdot \frac{u0}{cos2phi}\right)
\end{array}
Initial program 57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in u0 around 0 76.3%
unpow276.3%
unpow276.3%
Simplified76.3%
Taylor expanded in cos2phi around inf 22.4%
unpow222.4%
associate-/l*22.4%
associate-/r/22.4%
Simplified22.4%
Taylor expanded in u0 around 0 22.4%
associate-*l/22.4%
*-commutative22.4%
unpow222.4%
associate-*l*22.4%
Simplified22.4%
Final simplification22.4%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* alphax (/ (* alphax u0) cos2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return alphax * ((alphax * u0) / cos2phi);
}
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 = alphax * ((alphax * u0) / cos2phi)
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(alphax * Float32(Float32(alphax * u0) / cos2phi)) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = alphax * ((alphax * u0) / cos2phi); end
\begin{array}{l}
\\
alphax \cdot \frac{alphax \cdot u0}{cos2phi}
\end{array}
Initial program 57.9%
associate-/r*57.9%
Simplified57.9%
Taylor expanded in u0 around 0 76.3%
unpow276.3%
unpow276.3%
Simplified76.3%
Taylor expanded in cos2phi around inf 22.4%
unpow222.4%
associate-/l*22.4%
associate-/r/22.4%
Simplified22.4%
Taylor expanded in u0 around 0 22.4%
associate-*l/22.4%
*-commutative22.4%
unpow222.4%
associate-*l*22.4%
Simplified22.4%
Taylor expanded in alphax around 0 22.4%
Final simplification22.4%
herbie shell --seed 2023222
(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)))))