
(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))
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay)))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return log1pf(-u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(log1p(Float32(-u0)) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))) end
\begin{array}{l}
\\
\mathsf{log1p}\left(-u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)
\end{array}
Initial program 59.8%
neg-sub059.8%
div-sub59.8%
--rgt-identity59.8%
div-sub59.8%
--rgt-identity59.8%
neg-sub059.8%
sub-neg59.8%
log1p-def98.3%
Simplified98.3%
+-commutative98.3%
associate-/r*98.1%
associate-/r*98.1%
frac-2neg98.1%
frac-add98.1%
distribute-neg-frac98.1%
Applied egg-rr98.1%
+-commutative98.1%
distribute-rgt-neg-out98.1%
unsub-neg98.1%
associate-*l/98.1%
associate-/l*98.1%
*-commutative98.1%
distribute-lft-neg-out98.1%
distribute-rgt-neg-in98.1%
Simplified98.1%
div-inv97.8%
associate-/r/97.9%
distribute-rgt-neg-out97.9%
Applied egg-rr97.9%
associate-/r/98.1%
associate-*l/98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Simplified98.4%
associate-*l/98.6%
*-un-lft-identity98.6%
associate-/l*98.5%
Applied egg-rr98.5%
associate-/l*98.4%
associate-/r/98.7%
associate-/r/98.7%
*-commutative98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- (log1p (- u0))) (+ (* (/ cos2phi alphax) (/ 1.0 alphax)) (/ sin2phi (* alphay alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / (((cos2phi / alphax) * (1.0f / alphax)) + (sin2phi / (alphay * alphay)));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(Float32(cos2phi / alphax) * Float32(Float32(1.0) / alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax} \cdot \frac{1}{alphax} + \frac{sin2phi}{alphay \cdot alphay}}
\end{array}
Initial program 59.8%
neg-sub059.8%
div-sub59.8%
--rgt-identity59.8%
div-sub59.8%
--rgt-identity59.8%
sub-neg59.8%
+-commutative59.8%
neg-sub059.8%
associate-+l-59.8%
sub0-neg59.8%
neg-mul-159.8%
log-prod-0.0%
associate--r+-0.0%
Simplified98.3%
div-inv98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
(*
(- (* -0.5 (* u0 u0)) u0)
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
(* (log1p (- u0)) (/ (- alphay) (/ sin2phi alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
} else {
tmp = log1pf(-u0) * (-alphay / (sin2phi / alphay));
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929)) tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))); else tmp = Float32(log1p(Float32(-u0)) * Float32(Float32(-alphay) / Float32(sin2phi / alphay))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\
\;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(-u0\right) \cdot \frac{-alphay}{\frac{sin2phi}{alphay}}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
neg-sub056.0%
div-sub56.0%
--rgt-identity56.0%
div-sub56.0%
--rgt-identity56.0%
neg-sub056.0%
sub-neg56.0%
log1p-def98.6%
Simplified98.6%
+-commutative98.6%
associate-/r*98.6%
associate-/r*98.6%
frac-2neg98.6%
frac-add98.6%
distribute-neg-frac98.6%
Applied egg-rr98.6%
+-commutative98.6%
distribute-rgt-neg-out98.6%
unsub-neg98.6%
associate-*l/98.6%
associate-/l*98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
div-inv98.3%
associate-/r/98.4%
distribute-rgt-neg-out98.4%
Applied egg-rr98.4%
associate-/r/98.3%
associate-*l/98.2%
*-commutative98.2%
distribute-rgt-neg-in98.2%
Simplified98.2%
associate-*l/98.3%
*-un-lft-identity98.3%
associate-/l*98.3%
Applied egg-rr98.3%
associate-/l*98.3%
associate-/r/98.5%
associate-/r/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
unpow287.9%
Simplified87.9%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in alphay around 0 97.0%
unpow297.0%
associate-/l*96.4%
Simplified96.4%
Final simplification92.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
(*
(- (* -0.5 (* u0 u0)) u0)
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
(* (log1p (- u0)) (/ (* alphay (- alphay)) sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
} else {
tmp = log1pf(-u0) * ((alphay * -alphay) / sin2phi);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929)) tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))); else tmp = Float32(log1p(Float32(-u0)) * Float32(Float32(alphay * Float32(-alphay)) / sin2phi)); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\
\;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(-u0\right) \cdot \frac{alphay \cdot \left(-alphay\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
neg-sub056.0%
div-sub56.0%
--rgt-identity56.0%
div-sub56.0%
--rgt-identity56.0%
neg-sub056.0%
sub-neg56.0%
log1p-def98.6%
Simplified98.6%
+-commutative98.6%
associate-/r*98.6%
associate-/r*98.6%
frac-2neg98.6%
frac-add98.6%
distribute-neg-frac98.6%
Applied egg-rr98.6%
+-commutative98.6%
distribute-rgt-neg-out98.6%
unsub-neg98.6%
associate-*l/98.6%
associate-/l*98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
div-inv98.3%
associate-/r/98.4%
distribute-rgt-neg-out98.4%
Applied egg-rr98.4%
associate-/r/98.3%
associate-*l/98.2%
*-commutative98.2%
distribute-rgt-neg-in98.2%
Simplified98.2%
associate-*l/98.3%
*-un-lft-identity98.3%
associate-/l*98.3%
Applied egg-rr98.3%
associate-/l*98.3%
associate-/r/98.5%
associate-/r/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
unpow287.9%
Simplified87.9%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in alphay around 0 97.0%
unpow297.0%
Simplified97.0%
Final simplification92.8%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
(*
(- (* -0.5 (* u0 u0)) u0)
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
(* (/ (log1p (- u0)) sin2phi) (* alphay (- alphay)))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
} else {
tmp = (log1pf(-u0) / sin2phi) * (alphay * -alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929)) tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))); else tmp = Float32(Float32(log1p(Float32(-u0)) / sin2phi) * Float32(alphay * Float32(-alphay))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\
\;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot \left(-alphay\right)\right)\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
neg-sub056.0%
div-sub56.0%
--rgt-identity56.0%
div-sub56.0%
--rgt-identity56.0%
neg-sub056.0%
sub-neg56.0%
log1p-def98.6%
Simplified98.6%
+-commutative98.6%
associate-/r*98.6%
associate-/r*98.6%
frac-2neg98.6%
frac-add98.6%
distribute-neg-frac98.6%
Applied egg-rr98.6%
+-commutative98.6%
distribute-rgt-neg-out98.6%
unsub-neg98.6%
associate-*l/98.6%
associate-/l*98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
div-inv98.3%
associate-/r/98.4%
distribute-rgt-neg-out98.4%
Applied egg-rr98.4%
associate-/r/98.3%
associate-*l/98.2%
*-commutative98.2%
distribute-rgt-neg-in98.2%
Simplified98.2%
associate-*l/98.3%
*-un-lft-identity98.3%
associate-/l*98.3%
Applied egg-rr98.3%
associate-/l*98.3%
associate-/r/98.5%
associate-/r/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
unpow287.9%
Simplified87.9%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
associate-*l/98.8%
*-un-lft-identity98.8%
associate-/l*98.7%
Applied egg-rr98.7%
associate-/l*98.5%
associate-/r/99.0%
associate-/r/98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in alphax around inf 62.8%
associate-*r/62.8%
mul-1-neg62.8%
sub-neg62.8%
log1p-def97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*l/97.1%
*-commutative97.1%
unpow297.1%
Simplified97.1%
Final simplification92.8%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(if (<= (/ sin2phi (* alphay alphay)) 0.550000011920929)
(*
(- (* -0.5 (* u0 u0)) u0)
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay))))))
(/ (* alphay (* (log1p (- u0)) (- alphay))) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 0.550000011920929f) {
tmp = ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))));
} else {
tmp = (alphay * (log1pf(-u0) * -alphay)) / sin2phi;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(0.550000011920929)) tmp = Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))); else tmp = Float32(Float32(alphay * Float32(log1p(Float32(-u0)) * Float32(-alphay))) / sin2phi); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{sin2phi}{alphay \cdot alphay} \leq 0.550000011920929:\\
\;\;\;\;\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{alphay \cdot \left(\mathsf{log1p}\left(-u0\right) \cdot \left(-alphay\right)\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
neg-sub056.0%
div-sub56.0%
--rgt-identity56.0%
div-sub56.0%
--rgt-identity56.0%
neg-sub056.0%
sub-neg56.0%
log1p-def98.6%
Simplified98.6%
+-commutative98.6%
associate-/r*98.6%
associate-/r*98.6%
frac-2neg98.6%
frac-add98.6%
distribute-neg-frac98.6%
Applied egg-rr98.6%
+-commutative98.6%
distribute-rgt-neg-out98.6%
unsub-neg98.6%
associate-*l/98.6%
associate-/l*98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
div-inv98.3%
associate-/r/98.4%
distribute-rgt-neg-out98.4%
Applied egg-rr98.4%
associate-/r/98.3%
associate-*l/98.2%
*-commutative98.2%
distribute-rgt-neg-in98.2%
Simplified98.2%
associate-*l/98.3%
*-un-lft-identity98.3%
associate-/l*98.3%
Applied egg-rr98.3%
associate-/l*98.3%
associate-/r/98.5%
associate-/r/98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in u0 around 0 87.9%
+-commutative87.9%
neg-mul-187.9%
unsub-neg87.9%
unpow287.9%
Simplified87.9%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in alphay around 0 62.8%
associate-*r/62.8%
*-commutative62.8%
associate-*r*62.8%
sub-neg62.8%
log1p-def97.1%
neg-mul-197.1%
unpow297.1%
Simplified97.1%
Taylor expanded in alphay around 0 62.8%
mul-1-neg62.8%
distribute-rgt-neg-in62.8%
sub-neg62.8%
log1p-def97.1%
unpow297.1%
associate-*l*97.2%
Simplified97.2%
Final simplification92.8%
(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 59.8%
neg-sub059.8%
div-sub59.8%
--rgt-identity59.8%
div-sub59.8%
--rgt-identity59.8%
neg-sub059.8%
sub-neg59.8%
log1p-def98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (/ (- (log1p (- u0))) (+ (/ sin2phi (* alphay alphay)) (/ (/ cos2phi alphax) alphax))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return -log1pf(-u0) / ((sin2phi / (alphay * alphay)) + ((cos2phi / alphax) / alphax));
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(-log1p(Float32(-u0))) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(Float32(cos2phi / alphax) / alphax))) end
\begin{array}{l}
\\
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{\frac{cos2phi}{alphax}}{alphax}}
\end{array}
Initial program 59.8%
neg-sub059.8%
div-sub59.8%
--rgt-identity59.8%
div-sub59.8%
--rgt-identity59.8%
sub-neg59.8%
+-commutative59.8%
neg-sub059.8%
associate-+l-59.8%
sub0-neg59.8%
neg-mul-159.8%
log-prod-0.0%
associate--r+-0.0%
Simplified98.3%
Final simplification98.3%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(*
(- (* -0.5 (* u0 u0)) u0)
(*
alphay
(/
alphax
(- (* alphay (/ (- cos2phi) alphax)) (* sin2phi (/ alphax alphay)))))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return ((-0.5f * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (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 = (((-0.5e0) * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay)))))
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(Float32(Float32(-0.5) * Float32(u0 * u0)) - u0) * Float32(alphay * Float32(alphax / Float32(Float32(alphay * Float32(Float32(-cos2phi) / alphax)) - Float32(sin2phi * Float32(alphax / alphay)))))) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = ((single(-0.5) * (u0 * u0)) - u0) * (alphay * (alphax / ((alphay * (-cos2phi / alphax)) - (sin2phi * (alphax / alphay))))); end
\begin{array}{l}
\\
\left(-0.5 \cdot \left(u0 \cdot u0\right) - u0\right) \cdot \left(alphay \cdot \frac{alphax}{alphay \cdot \frac{-cos2phi}{alphax} - sin2phi \cdot \frac{alphax}{alphay}}\right)
\end{array}
Initial program 59.8%
neg-sub059.8%
div-sub59.8%
--rgt-identity59.8%
div-sub59.8%
--rgt-identity59.8%
neg-sub059.8%
sub-neg59.8%
log1p-def98.3%
Simplified98.3%
+-commutative98.3%
associate-/r*98.1%
associate-/r*98.1%
frac-2neg98.1%
frac-add98.1%
distribute-neg-frac98.1%
Applied egg-rr98.1%
+-commutative98.1%
distribute-rgt-neg-out98.1%
unsub-neg98.1%
associate-*l/98.1%
associate-/l*98.1%
*-commutative98.1%
distribute-lft-neg-out98.1%
distribute-rgt-neg-in98.1%
Simplified98.1%
div-inv97.8%
associate-/r/97.9%
distribute-rgt-neg-out97.9%
Applied egg-rr97.9%
associate-/r/98.1%
associate-*l/98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Simplified98.4%
associate-*l/98.6%
*-un-lft-identity98.6%
associate-/l*98.5%
Applied egg-rr98.5%
associate-/l*98.4%
associate-/r/98.7%
associate-/r/98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in u0 around 0 88.4%
+-commutative88.4%
neg-mul-188.4%
unsub-neg88.4%
unpow288.4%
Simplified88.4%
Final simplification88.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.550000011920929)
(/ u0 (+ t_0 (* cos2phi (/ 1.0 (* alphax alphax)))))
(/ (* (* alphay alphay) (+ u0 (* (* u0 u0) 0.5))) 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.550000011920929f) {
tmp = u0 / (t_0 + (cos2phi * (1.0f / (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) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.550000011920929e0) then
tmp = u0 / (t_0 + (cos2phi * (1.0e0 / (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) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.550000011920929)) tmp = Float32(u0 / Float32(t_0 + Float32(cos2phi * Float32(Float32(1.0) / 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) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.550000011920929)) tmp = u0 / (t_0 + (cos2phi * (single(1.0) / (alphax * alphax)))); else tmp = ((alphay * alphay) * (u0 + ((u0 * u0) * single(0.5)))) / 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.550000011920929:\\
\;\;\;\;\frac{u0}{t_0 + cos2phi \cdot \frac{1}{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 (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
associate-/r*56.0%
Simplified56.0%
Taylor expanded in u0 around 0 75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
div-inv75.1%
Applied egg-rr75.1%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in alphay around 0 62.8%
associate-*r/62.8%
*-commutative62.8%
associate-*r*62.8%
sub-neg62.8%
log1p-def97.1%
neg-mul-197.1%
unpow297.1%
Simplified97.1%
Taylor expanded in u0 around 0 87.9%
associate-*r*87.9%
distribute-rgt-out88.0%
unpow288.0%
*-commutative88.0%
unpow288.0%
Simplified88.0%
Final simplification82.0%
(FPCore (alphax alphay u0 cos2phi sin2phi)
:precision binary32
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= t_0 0.550000011920929)
(/ u0 (+ t_0 (/ cos2phi (* alphax alphax))))
(/ (* (* alphay alphay) (+ u0 (* (* u0 u0) 0.5))) 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.550000011920929f) {
tmp = u0 / (t_0 + (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) :: t_0
real(4) :: tmp
t_0 = sin2phi / (alphay * alphay)
if (t_0 <= 0.550000011920929e0) then
tmp = u0 / (t_0 + (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) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (t_0 <= Float32(0.550000011920929)) tmp = Float32(u0 / Float32(t_0 + 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) t_0 = sin2phi / (alphay * alphay); tmp = single(0.0); if (t_0 <= single(0.550000011920929)) tmp = u0 / (t_0 + (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}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;t_0 \leq 0.550000011920929:\\
\;\;\;\;\frac{u0}{t_0 + \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 (/.f32 sin2phi (*.f32 alphay alphay)) < 0.550000012Initial program 56.0%
associate-/r*56.0%
Simplified56.0%
Taylor expanded in u0 around 0 75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
if 0.550000012 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 63.0%
neg-sub063.0%
div-sub63.0%
--rgt-identity63.0%
div-sub63.0%
--rgt-identity63.0%
neg-sub063.0%
sub-neg63.0%
log1p-def98.0%
Simplified98.0%
+-commutative98.0%
associate-/r*97.8%
associate-/r*97.7%
frac-2neg97.7%
frac-add97.6%
distribute-neg-frac97.6%
Applied egg-rr97.6%
+-commutative97.6%
distribute-rgt-neg-out97.6%
unsub-neg97.6%
associate-*l/97.7%
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%
distribute-rgt-neg-out97.4%
Applied egg-rr97.4%
associate-/r/97.9%
associate-*l/98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in alphay around 0 62.8%
associate-*r/62.8%
*-commutative62.8%
associate-*r*62.8%
sub-neg62.8%
log1p-def97.1%
neg-mul-197.1%
unpow297.1%
Simplified97.1%
Taylor expanded in u0 around 0 87.9%
associate-*r*87.9%
distribute-rgt-out88.0%
unpow288.0%
*-commutative88.0%
unpow288.0%
Simplified88.0%
Final simplification82.0%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 2.0000000072549875e-15) (* alphax (/ (* u0 alphax) cos2phi)) (* (* alphay alphay) (/ u0 sin2phi))))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 2.0000000072549875e-15f) {
tmp = alphax * ((u0 * 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 / (alphay * alphay)) <= 2.0000000072549875e-15) then
tmp = alphax * ((u0 * 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(2.0000000072549875e-15)) tmp = Float32(alphax * Float32(Float32(u0 * 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 / (alphay * alphay)) <= single(2.0000000072549875e-15)) tmp = alphax * ((u0 * alphax) / cos2phi); 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 2.0000000072549875 \cdot 10^{-15}:\\
\;\;\;\;alphax \cdot \frac{u0 \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\left(alphay \cdot alphay\right) \cdot \frac{u0}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 2.00000001e-15Initial program 57.7%
associate-/r*57.7%
Simplified57.7%
Taylor expanded in u0 around 0 74.8%
unpow274.8%
unpow274.8%
Simplified74.8%
Taylor expanded in cos2phi around inf 58.6%
pow258.6%
*-commutative58.6%
associate-*r/58.5%
associate-*l*58.5%
Applied egg-rr58.5%
Taylor expanded in alphax around 0 58.6%
if 2.00000001e-15 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 60.4%
associate-/r*60.4%
Simplified60.4%
Taylor expanded in u0 around 0 76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
Taylor expanded in cos2phi around 0 70.4%
unpow270.4%
*-commutative70.4%
*-lft-identity70.4%
times-frac70.3%
/-rgt-identity70.3%
Simplified70.3%
Final simplification67.5%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (if (<= (/ sin2phi (* alphay alphay)) 2.0000000072549875e-15) (* alphax (/ (* u0 alphax) cos2phi)) (/ (* u0 (* alphay alphay)) sin2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((sin2phi / (alphay * alphay)) <= 2.0000000072549875e-15f) {
tmp = alphax * ((u0 * 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 / (alphay * alphay)) <= 2.0000000072549875e-15) then
tmp = alphax * ((u0 * 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 (Float32(sin2phi / Float32(alphay * alphay)) <= Float32(2.0000000072549875e-15)) tmp = Float32(alphax * Float32(Float32(u0 * 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 / (alphay * alphay)) <= single(2.0000000072549875e-15)) tmp = alphax * ((u0 * alphax) / 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 2.0000000072549875 \cdot 10^{-15}:\\
\;\;\;\;alphax \cdot \frac{u0 \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\frac{u0 \cdot \left(alphay \cdot alphay\right)}{sin2phi}\\
\end{array}
\end{array}
if (/.f32 sin2phi (*.f32 alphay alphay)) < 2.00000001e-15Initial program 57.7%
associate-/r*57.7%
Simplified57.7%
Taylor expanded in u0 around 0 74.8%
unpow274.8%
unpow274.8%
Simplified74.8%
Taylor expanded in cos2phi around inf 58.6%
pow258.6%
*-commutative58.6%
associate-*r/58.5%
associate-*l*58.5%
Applied egg-rr58.5%
Taylor expanded in alphax around 0 58.6%
if 2.00000001e-15 < (/.f32 sin2phi (*.f32 alphay alphay)) Initial program 60.4%
associate-/r*60.4%
Simplified60.4%
Taylor expanded in u0 around 0 76.7%
unpow276.7%
unpow276.7%
Simplified76.7%
+-commutative76.7%
associate-/r*76.6%
frac-add76.6%
Applied egg-rr76.6%
Taylor expanded in sin2phi around inf 70.4%
*-commutative70.4%
unpow270.4%
Simplified70.4%
Final simplification67.5%
(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 59.8%
associate-/r*59.8%
Simplified59.8%
Taylor expanded in u0 around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Final simplification76.2%
(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 59.8%
associate-/r*59.8%
Simplified59.8%
Taylor expanded in u0 around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Taylor expanded in cos2phi around inf 24.8%
pow224.8%
*-commutative24.8%
associate-*r/24.8%
associate-*l*24.8%
Applied egg-rr24.8%
Final simplification24.8%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* alphax (/ (* u0 alphax) cos2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return alphax * ((u0 * alphax) / 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 * ((u0 * alphax) / cos2phi)
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(alphax * Float32(Float32(u0 * alphax) / cos2phi)) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = alphax * ((u0 * alphax) / cos2phi); end
\begin{array}{l}
\\
alphax \cdot \frac{u0 \cdot alphax}{cos2phi}
\end{array}
Initial program 59.8%
associate-/r*59.8%
Simplified59.8%
Taylor expanded in u0 around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Taylor expanded in cos2phi around inf 24.8%
pow224.8%
*-commutative24.8%
associate-*r/24.8%
associate-*l*24.8%
Applied egg-rr24.8%
Taylor expanded in alphax around 0 24.8%
Final simplification24.8%
(FPCore (alphax alphay u0 cos2phi sin2phi) :precision binary32 (* u0 (/ (* alphax alphax) cos2phi)))
float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return u0 * ((alphax * alphax) / 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 = u0 * ((alphax * alphax) / cos2phi)
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(u0 * Float32(Float32(alphax * alphax) / cos2phi)) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = u0 * ((alphax * alphax) / cos2phi); end
\begin{array}{l}
\\
u0 \cdot \frac{alphax \cdot alphax}{cos2phi}
\end{array}
Initial program 59.8%
associate-/r*59.8%
Simplified59.8%
Taylor expanded in u0 around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Taylor expanded in cos2phi around inf 24.8%
*-commutative24.8%
*-lft-identity24.8%
times-frac24.8%
/-rgt-identity24.8%
unpow224.8%
Simplified24.8%
Taylor expanded in alphax around 0 24.8%
unpow224.8%
associate-*r/24.8%
Simplified24.8%
Final simplification24.8%
herbie shell --seed 2023228
(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)))))