
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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)))))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)
use fmin_fmax_functions
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
\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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)))))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)
use fmin_fmax_functions
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
\frac{-\log \left(1 - u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(*
(/
(- (log1p (- u0)))
(fma (* alphay alphay) (/ cos2phi (* alphax alphax)) sin2phi))
(* alphay alphay)))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return (-log1pf(-u0) / fmaf((alphay * alphay), (cos2phi / (alphax * alphax)), sin2phi)) * (alphay * alphay);
}
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(Float32(-log1p(Float32(-u0))) / fma(Float32(alphay * alphay), Float32(cos2phi / Float32(alphax * alphax)), sin2phi)) * Float32(alphay * alphay)) end
\frac{-\mathsf{log1p}\left(-u0\right)}{\mathsf{fma}\left(alphay \cdot alphay, \frac{cos2phi}{alphax \cdot alphax}, sin2phi\right)} \cdot \left(alphay \cdot alphay\right)
Initial program 61.0%
Applied rewrites61.4%
Applied rewrites98.8%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(/
(- (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(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))) end
\frac{-\mathsf{log1p}\left(-u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}
Initial program 61.0%
Applied rewrites98.4%
Applied rewrites98.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (/ sin2phi (* alphay alphay))))
(if (<= (- 1.0 u0) 0.996399998664856)
(/ (- (log (- 1.0 u0))) (- t_0 (/ (- (/ cos2phi alphax)) alphax)))
(/ (fma (* 0.5 u0) u0 u0) (+ (/ cos2phi (* alphax alphax)) t_0)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = sin2phi / (alphay * alphay);
float tmp;
if ((1.0f - u0) <= 0.996399998664856f) {
tmp = -logf((1.0f - u0)) / (t_0 - (-(cos2phi / alphax) / alphax));
} else {
tmp = fmaf((0.5f * u0), u0, u0) / ((cos2phi / (alphax * alphax)) + t_0);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(sin2phi / Float32(alphay * alphay)) tmp = Float32(0.0) if (Float32(Float32(1.0) - u0) <= Float32(0.996399998664856)) tmp = Float32(Float32(-log(Float32(Float32(1.0) - u0))) / Float32(t_0 - Float32(Float32(-Float32(cos2phi / alphax)) / alphax))); else tmp = Float32(fma(Float32(Float32(0.5) * u0), u0, u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + t_0)); end return tmp end
\begin{array}{l}
t_0 := \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;1 - u0 \leq 0.996399998664856:\\
\;\;\;\;\frac{-\log \left(1 - u0\right)}{t\_0 - \frac{-\frac{cos2phi}{alphax}}{alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + t\_0}\\
\end{array}
if (-.f32 #s(literal 1 binary32) u0) < 0.996399999Initial program 61.0%
Applied rewrites61.0%
Applied rewrites61.0%
if 0.996399999 < (-.f32 #s(literal 1 binary32) u0) Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites87.4%
Applied rewrites87.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0
(+
(/ cos2phi (* alphax alphax))
(/ sin2phi (* alphay alphay)))))
(if (<= (- 1.0 u0) 0.996399998664856)
(/ (- (log (- 1.0 u0))) t_0)
(/ (fma (* 0.5 u0) u0 u0) t_0))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = (cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay));
float tmp;
if ((1.0f - u0) <= 0.996399998664856f) {
tmp = -logf((1.0f - u0)) / t_0;
} else {
tmp = fmaf((0.5f * u0), u0, u0) / t_0;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay))) tmp = Float32(0.0) if (Float32(Float32(1.0) - u0) <= Float32(0.996399998664856)) tmp = Float32(Float32(-log(Float32(Float32(1.0) - u0))) / t_0); else tmp = Float32(fma(Float32(Float32(0.5) * u0), u0, u0) / t_0); end return tmp end
\begin{array}{l}
t_0 := \frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}\\
\mathbf{if}\;1 - u0 \leq 0.996399998664856:\\
\;\;\;\;\frac{-\log \left(1 - u0\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)}{t\_0}\\
\end{array}
if (-.f32 #s(literal 1 binary32) u0) < 0.996399999Initial program 61.0%
if 0.996399999 < (-.f32 #s(literal 1 binary32) u0) Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites87.4%
Applied rewrites87.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 7.659865514142439e-5)
(/
(fma (* 0.5 u0) u0 u0)
(+ (/ cos2phi (* alphax alphax)) (/ sin2phi (* alphay alphay))))
(* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 7.659865514142439e-5f) {
tmp = fmaf((0.5f * u0), u0, u0) / ((cos2phi / (alphax * alphax)) + (sin2phi / (alphay * alphay)));
} else {
tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(7.659865514142439e-5)) tmp = Float32(fma(Float32(Float32(0.5) * u0), u0, u0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) + Float32(sin2phi / Float32(alphay * alphay)))); else tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 7.659865514142439 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)}{\frac{cos2phi}{alphax \cdot alphax} + \frac{sin2phi}{alphay \cdot alphay}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 7.65986551e-5Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites87.4%
Applied rewrites87.5%
if 7.65986551e-5 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 7.659865514142439e-5)
(*
(/
(fma 0.5 u0 1.0)
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))
u0)
(* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 7.659865514142439e-5f) {
tmp = (fmaf(0.5f, u0, 1.0f) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)))) * u0;
} else {
tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(7.659865514142439e-5)) tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))) * u0); else tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 7.659865514142439 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}} \cdot u0\\
\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 7.65986551e-5Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites87.4%
Applied rewrites87.4%
if 7.65986551e-5 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.234215751821921e-8)
(/
1.0
(/
(-
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))
(- u0)))
(* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.234215751821921e-8f) {
tmp = 1.0f / (-((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax))) / -u0);
} else {
tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.234215751821921e-8)) tmp = Float32(Float32(1.0) / Float32(Float32(-Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))) / Float32(-u0))); else tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.234215751821921 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\frac{-\left(\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}\right)}{-u0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.23421575e-8Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites73.6%
if 1.23421575e-8 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.234215751821921e-8)
(/
(- (- u0))
(fma
cos2phi
(/ 1.0 (* alphax alphax))
(/ sin2phi (* alphay alphay))))
(* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.234215751821921e-8f) {
tmp = -(-u0) / fmaf(cos2phi, (1.0f / (alphax * alphax)), (sin2phi / (alphay * alphay)));
} else {
tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.234215751821921e-8)) tmp = Float32(Float32(-Float32(-u0)) / fma(cos2phi, Float32(Float32(1.0) / Float32(alphax * alphax)), Float32(sin2phi / Float32(alphay * alphay)))); else tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.234215751821921 \cdot 10^{-8}:\\
\;\;\;\;\frac{-\left(-u0\right)}{\mathsf{fma}\left(cos2phi, \frac{1}{alphax \cdot alphax}, \frac{sin2phi}{alphay \cdot alphay}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.23421575e-8Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
Applied rewrites75.6%
if 1.23421575e-8 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.234215751821921e-8)
(/
(- (- u0))
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))
(* (/ (- (log1p (- u0))) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.234215751821921e-8f) {
tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
} else {
tmp = (-log1pf(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.234215751821921e-8)) tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))); else tmp = Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.234215751821921 \cdot 10^{-8}:\\
\;\;\;\;\frac{-\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.23421575e-8Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
if 1.23421575e-8 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.234215751821921e-8)
(/
(- (- u0))
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))
(* (* (/ (- (log1p (- u0))) sin2phi) alphay) alphay)))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.234215751821921e-8f) {
tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
} else {
tmp = ((-log1pf(-u0) / sin2phi) * alphay) * alphay;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.234215751821921e-8)) tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))); else tmp = Float32(Float32(Float32(Float32(-log1p(Float32(-u0))) / sin2phi) * alphay) * alphay); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.234215751821921 \cdot 10^{-8}:\\
\;\;\;\;\frac{-\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{-\mathsf{log1p}\left(-u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
\end{array}
if sin2phi < 1.23421575e-8Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
if 1.23421575e-8 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.234215751821921e-8)
(/
(- (- u0))
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))
(* (- (log1p (- u0))) (/ (* alphay alphay) sin2phi))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.234215751821921e-8f) {
tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
} else {
tmp = -log1pf(-u0) * ((alphay * alphay) / sin2phi);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.234215751821921e-8)) tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))); else tmp = Float32(Float32(-log1p(Float32(-u0))) * Float32(Float32(alphay * alphay) / sin2phi)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.234215751821921 \cdot 10^{-8}:\\
\;\;\;\;\frac{-\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\left(-\mathsf{log1p}\left(-u0\right)\right) \cdot \frac{alphay \cdot alphay}{sin2phi}\\
\end{array}
if sin2phi < 1.23421575e-8Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
if 1.23421575e-8 < sin2phi Initial program 61.0%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites73.9%
Applied rewrites49.1%
Applied rewrites73.9%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= (- 1.0 u0) 0.9983999729156494)
(* (* (/ (- (log (- 1.0 u0))) sin2phi) alphay) alphay)
(/
(- (- u0))
(+ (/ sin2phi (* alphay alphay)) (/ cos2phi (* alphax alphax))))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if ((1.0f - u0) <= 0.9983999729156494f) {
tmp = ((-logf((1.0f - u0)) / sin2phi) * alphay) * alphay;
} else {
tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)));
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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 ((1.0e0 - u0) <= 0.9983999729156494e0) then
tmp = ((-log((1.0e0 - u0)) / sin2phi) * alphay) * alphay
else
tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax)))
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (Float32(Float32(1.0) - u0) <= Float32(0.9983999729156494)) tmp = Float32(Float32(Float32(Float32(-log(Float32(Float32(1.0) - u0))) / sin2phi) * alphay) * alphay); else tmp = Float32(Float32(-Float32(-u0)) / Float32(Float32(sin2phi / Float32(alphay * alphay)) + Float32(cos2phi / Float32(alphax * alphax)))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if ((single(1.0) - u0) <= single(0.9983999729156494)) tmp = ((-log((single(1.0) - u0)) / sin2phi) * alphay) * alphay; else tmp = -(-u0) / ((sin2phi / (alphay * alphay)) + (cos2phi / (alphax * alphax))); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;1 - u0 \leq 0.9983999729156494:\\
\;\;\;\;\left(\frac{-\log \left(1 - u0\right)}{sin2phi} \cdot alphay\right) \cdot alphay\\
\mathbf{else}:\\
\;\;\;\;\frac{-\left(-u0\right)}{\frac{sin2phi}{alphay \cdot alphay} + \frac{cos2phi}{alphax \cdot alphax}}\\
\end{array}
if (-.f32 #s(literal 1 binary32) u0) < 0.998399973Initial program 61.0%
Applied rewrites61.4%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
if 0.998399973 < (-.f32 #s(literal 1 binary32) u0) Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (fma (* 0.5 u0) u0 u0)))
(if (<= sin2phi 1.030062684406026e-18)
(/ t_0 (* cos2phi (/ 1.0 (* alphax alphax))))
(* (/ t_0 sin2phi) (* alphay alphay)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = fmaf((0.5f * u0), u0, u0);
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = t_0 / (cos2phi * (1.0f / (alphax * alphax)));
} else {
tmp = (t_0 / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = fma(Float32(Float32(0.5) * u0), u0, u0) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(t_0 / Float32(cos2phi * Float32(Float32(1.0) / Float32(alphax * alphax)))); else tmp = Float32(Float32(t_0 / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)\\
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{t\_0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(/ (* (fma 0.5 u0 1.0) u0) (* cos2phi (/ 1.0 (* alphax alphax))))
(* (/ (fma (* 0.5 u0) u0 u0) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = (fmaf(0.5f, u0, 1.0f) * u0) / (cos2phi * (1.0f / (alphax * alphax)));
} else {
tmp = (fmaf((0.5f * u0), u0, u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) / Float32(cos2phi * Float32(Float32(1.0) / Float32(alphax * alphax)))); else tmp = Float32(Float32(fma(Float32(Float32(0.5) * u0), u0, u0) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(* (* (fma 0.5 u0 1.0) u0) (/ (* alphax alphax) cos2phi))
(* (/ (fma (* 0.5 u0) u0 u0) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = (fmaf(0.5f, u0, 1.0f) * u0) * ((alphax * alphax) / cos2phi);
} else {
tmp = (fmaf((0.5f * u0), u0, u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) * Float32(Float32(alphax * alphax) / cos2phi)); else tmp = Float32(Float32(fma(Float32(Float32(0.5) * u0), u0, u0) / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \frac{alphax \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5 \cdot u0, u0, u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.5%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (* (fma 0.5 u0 1.0) u0)))
(if (<= sin2phi 1.030062684406026e-18)
(* t_0 (/ (* alphax alphax) cos2phi))
(* (/ t_0 sin2phi) (* alphay alphay)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = fmaf(0.5f, u0, 1.0f) * u0;
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = t_0 * ((alphax * alphax) / cos2phi);
} else {
tmp = (t_0 / sin2phi) * (alphay * alphay);
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(t_0 * Float32(Float32(alphax * alphax) / cos2phi)); else tmp = Float32(Float32(t_0 / sin2phi) * Float32(alphay * alphay)); end return tmp end
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\\
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;t\_0 \cdot \frac{alphax \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (* (fma 0.5 u0 1.0) u0)))
(if (<= sin2phi 1.030062684406026e-18)
(* t_0 (/ (* alphax alphax) cos2phi))
(* (* (/ t_0 sin2phi) alphay) alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = fmaf(0.5f, u0, 1.0f) * u0;
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = t_0 * ((alphax * alphax) / cos2phi);
} else {
tmp = ((t_0 / sin2phi) * alphay) * alphay;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(t_0 * Float32(Float32(alphax * alphax) / cos2phi)); else tmp = Float32(Float32(Float32(t_0 / sin2phi) * alphay) * alphay); end return tmp end
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\\
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;t\_0 \cdot \frac{alphax \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_0}{sin2phi} \cdot alphay\right) \cdot alphay\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (* (fma 0.5 u0 1.0) u0)))
(if (<= sin2phi 1.030062684406026e-18)
(* t_0 (/ (* alphax alphax) cos2phi))
(/ (* t_0 (* alphay alphay)) sin2phi))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = fmaf(0.5f, u0, 1.0f) * u0;
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = t_0 * ((alphax * alphax) / cos2phi);
} else {
tmp = (t_0 * (alphay * alphay)) / sin2phi;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(t_0 * Float32(Float32(alphax * alphax) / cos2phi)); else tmp = Float32(Float32(t_0 * Float32(alphay * alphay)) / sin2phi); end return tmp end
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\\
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;t\_0 \cdot \frac{alphax \cdot alphax}{cos2phi}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot \left(alphay \cdot alphay\right)}{sin2phi}\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites26.4%
Applied rewrites26.4%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(/ 1.0 (/ (/ cos2phi (* alphax alphax)) (- (- u0))))
(/ (* (* (fma 0.5 u0 1.0) u0) (* alphay alphay)) sin2phi)))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = 1.0f / ((cos2phi / (alphax * alphax)) / -(-u0));
} else {
tmp = ((fmaf(0.5f, u0, 1.0f) * u0) * (alphay * alphay)) / sin2phi;
}
return tmp;
}
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(1.0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) / Float32(-Float32(-u0)))); else tmp = Float32(Float32(Float32(fma(Float32(0.5), u0, Float32(1.0)) * u0) * Float32(alphay * alphay)) / sin2phi); end return tmp end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{\frac{\frac{cos2phi}{alphax \cdot alphax}}{-\left(-u0\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(0.5, u0, 1\right) \cdot u0\right) \cdot \left(alphay \cdot alphay\right)}{sin2phi}\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites66.4%
Applied rewrites66.4%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(/ 1.0 (/ (/ cos2phi (* alphax alphax)) (- (- u0))))
(* -1.0 (* (* -1.0 u0) (* (/ alphay sin2phi) alphay)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = 1.0f / ((cos2phi / (alphax * alphax)) / -(-u0));
} else {
tmp = -1.0f * ((-1.0f * u0) * ((alphay / sin2phi) * alphay));
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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.030062684406026e-18) then
tmp = 1.0e0 / ((cos2phi / (alphax * alphax)) / -(-u0))
else
tmp = (-1.0e0) * (((-1.0e0) * u0) * ((alphay / sin2phi) * alphay))
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(1.0) / Float32(Float32(cos2phi / Float32(alphax * alphax)) / Float32(-Float32(-u0)))); else tmp = Float32(Float32(-1.0) * Float32(Float32(Float32(-1.0) * u0) * Float32(Float32(alphay / sin2phi) * alphay))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.030062684406026e-18)) tmp = single(1.0) / ((cos2phi / (alphax * alphax)) / -(-u0)); else tmp = single(-1.0) * ((single(-1.0) * u0) * ((alphay / sin2phi) * alphay)); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{1}{\frac{\frac{cos2phi}{alphax \cdot alphax}}{-\left(-u0\right)}}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\left(-1 \cdot u0\right) \cdot \left(\frac{alphay}{sin2phi} \cdot alphay\right)\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites58.6%
Applied rewrites58.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(/ (- (- u0)) (* cos2phi (/ 1.0 (* alphax alphax))))
(* -1.0 (* (* -1.0 u0) (* (/ alphay sin2phi) alphay)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = -(-u0) / (cos2phi * (1.0f / (alphax * alphax)));
} else {
tmp = -1.0f * ((-1.0f * u0) * ((alphay / sin2phi) * alphay));
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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.030062684406026e-18) then
tmp = -(-u0) / (cos2phi * (1.0e0 / (alphax * alphax)))
else
tmp = (-1.0e0) * (((-1.0e0) * u0) * ((alphay / sin2phi) * alphay))
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(-Float32(-u0)) / Float32(cos2phi * Float32(Float32(1.0) / Float32(alphax * alphax)))); else tmp = Float32(Float32(-1.0) * Float32(Float32(Float32(-1.0) * u0) * Float32(Float32(alphay / sin2phi) * alphay))); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.030062684406026e-18)) tmp = -(-u0) / (cos2phi * (single(1.0) / (alphax * alphax))); else tmp = single(-1.0) * ((single(-1.0) * u0) * ((alphay / sin2phi) * alphay)); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{-\left(-u0\right)}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\left(-1 \cdot u0\right) \cdot \left(\frac{alphay}{sin2phi} \cdot alphay\right)\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites58.6%
Applied rewrites58.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(let* ((t_0 (- (- u0))))
(if (<= sin2phi 1.030062684406026e-18)
(/ t_0 (* cos2phi (/ 1.0 (* alphax alphax))))
(* (/ t_0 sin2phi) (* alphay alphay)))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float t_0 = -(-u0);
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = t_0 / (cos2phi * (1.0f / (alphax * alphax)));
} else {
tmp = (t_0 / sin2phi) * (alphay * alphay);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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 = -(-u0)
if (sin2phi <= 1.030062684406026e-18) then
tmp = t_0 / (cos2phi * (1.0e0 / (alphax * alphax)))
else
tmp = (t_0 / sin2phi) * (alphay * alphay)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = Float32(-Float32(-u0)) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(t_0 / Float32(cos2phi * Float32(Float32(1.0) / Float32(alphax * alphax)))); else tmp = Float32(Float32(t_0 / sin2phi) * Float32(alphay * alphay)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) t_0 = -(-u0); tmp = single(0.0); if (sin2phi <= single(1.030062684406026e-18)) tmp = t_0 / (cos2phi * (single(1.0) / (alphax * alphax))); else tmp = (t_0 / sin2phi) * (alphay * alphay); end tmp_2 = tmp; end
\begin{array}{l}
t_0 := -\left(-u0\right)\\
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{t\_0}{cos2phi \cdot \frac{1}{alphax \cdot alphax}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Applied rewrites60.9%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.9%
Taylor expanded in alphax around inf
Applied rewrites58.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(* (/ u0 cos2phi) (* alphax alphax))
(* (/ (- (- u0)) sin2phi) (* alphay alphay))))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = (u0 / cos2phi) * (alphax * alphax);
} else {
tmp = (-(-u0) / sin2phi) * (alphay * alphay);
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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.030062684406026e-18) then
tmp = (u0 / cos2phi) * (alphax * alphax)
else
tmp = (-(-u0) / sin2phi) * (alphay * alphay)
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(u0 / cos2phi) * Float32(alphax * alphax)); else tmp = Float32(Float32(Float32(-Float32(-u0)) / sin2phi) * Float32(alphay * alphay)); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.030062684406026e-18)) tmp = (u0 / cos2phi) * (alphax * alphax); else tmp = (-(-u0) / sin2phi) * (alphay * alphay); end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{u0}{cos2phi} \cdot \left(alphax \cdot alphax\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\left(-u0\right)}{sin2phi} \cdot \left(alphay \cdot alphay\right)\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.9%
Taylor expanded in alphax around inf
Applied rewrites58.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(if (<= sin2phi 1.030062684406026e-18)
(* (/ u0 cos2phi) (* alphax alphax))
(* (/ (* alphay u0) sin2phi) alphay)))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
float tmp;
if (sin2phi <= 1.030062684406026e-18f) {
tmp = (u0 / cos2phi) * (alphax * alphax);
} else {
tmp = ((alphay * u0) / sin2phi) * alphay;
}
return tmp;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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.030062684406026e-18) then
tmp = (u0 / cos2phi) * (alphax * alphax)
else
tmp = ((alphay * u0) / sin2phi) * alphay
end if
code = tmp
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) tmp = Float32(0.0) if (sin2phi <= Float32(1.030062684406026e-18)) tmp = Float32(Float32(u0 / cos2phi) * Float32(alphax * alphax)); else tmp = Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay); end return tmp end
function tmp_2 = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = single(0.0); if (sin2phi <= single(1.030062684406026e-18)) tmp = (u0 / cos2phi) * (alphax * alphax); else tmp = ((alphay * u0) / sin2phi) * alphay; end tmp_2 = tmp; end
\begin{array}{l}
\mathbf{if}\;sin2phi \leq 1.030062684406026 \cdot 10^{-18}:\\
\;\;\;\;\frac{u0}{cos2phi} \cdot \left(alphax \cdot alphax\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{alphay \cdot u0}{sin2phi} \cdot alphay\\
\end{array}
if sin2phi < 1.03006268e-18Initial program 61.0%
Taylor expanded in u0 around 0
Applied rewrites75.6%
Applied rewrites75.6%
Taylor expanded in alphax around 0
Applied rewrites22.6%
Taylor expanded in u0 around 0
Applied rewrites23.8%
if 1.03006268e-18 < sin2phi Initial program 61.0%
Applied rewrites61.4%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites58.6%
(FPCore (alphax alphay u0 cos2phi sin2phi)
: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))
(* (/ (* alphay u0) sin2phi) alphay))float code(float alphax, float alphay, float u0, float cos2phi, float sin2phi) {
return ((alphay * u0) / sin2phi) * alphay;
}
real(4) function code(alphax, alphay, u0, cos2phi, sin2phi)
use fmin_fmax_functions
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 * u0) / sin2phi) * alphay
end function
function code(alphax, alphay, u0, cos2phi, sin2phi) return Float32(Float32(Float32(alphay * u0) / sin2phi) * alphay) end
function tmp = code(alphax, alphay, u0, cos2phi, sin2phi) tmp = ((alphay * u0) / sin2phi) * alphay; end
\frac{alphay \cdot u0}{sin2phi} \cdot alphay
Initial program 61.0%
Applied rewrites61.4%
Applied rewrites61.4%
Taylor expanded in alphax around inf
Applied rewrites49.1%
Taylor expanded in u0 around 0
Applied rewrites58.6%
herbie shell --seed 2026070
(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)))))