
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 26 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 92.7%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6
Applied egg-rr99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0)))
(if (<= t_1 2e-5)
(*
(sin th)
(/
(sin ky)
(hypot
(sin ky)
(*
kx
(fma
(* kx kx)
(fma 0.008333333333333333 (* kx kx) -0.16666666666666666)
1.0)))))
(if (<= t_1 0.12)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(/ (sin th) (/ (sqrt (fma -0.5 (cos (* kx -2.0)) 0.5)) (sin ky)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double tmp;
if (t_1 <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), (kx * fma((kx * kx), fma(0.008333333333333333, (kx * kx), -0.16666666666666666), 1.0))));
} else if (t_1 <= 0.12) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else {
tmp = sin(th) / (sqrt(fma(-0.5, cos((kx * -2.0)), 0.5)) / sin(ky));
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 tmp = 0.0 if (t_1 <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), Float64(kx * fma(Float64(kx * kx), fma(0.008333333333333333, Float64(kx * kx), -0.16666666666666666), 1.0))))); elseif (t_1 <= 0.12) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); else tmp = Float64(sin(th) / Float64(sqrt(fma(-0.5, cos(Float64(kx * -2.0)), 0.5)) / sin(ky))); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[(kx * N[(N[(kx * kx), $MachinePrecision] * N[(0.008333333333333333 * N[(kx * kx), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.12], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx \cdot \mathsf{fma}\left(kx \cdot kx, \mathsf{fma}\left(0.008333333333333333, kx \cdot kx, -0.16666666666666666\right), 1\right)\right)}\\
\mathbf{elif}\;t\_1 \leq 0.12:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}{\sin ky}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6499.8
Simplified99.8%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 0.12Initial program 99.4%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5
Applied egg-rr99.5%
Taylor expanded in th around 0
Simplified67.7%
if 0.12 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in ky around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6459.3
Simplified59.3%
Final simplification80.8%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0)))
(if (<= t_1 2e-5)
(*
(sin th)
(/
(sin ky)
(hypot (sin ky) (* kx (fma -0.16666666666666666 (* kx kx) 1.0)))))
(if (<= t_1 0.12)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(/ (sin th) (/ (sqrt (fma -0.5 (cos (* kx -2.0)) 0.5)) (sin ky)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double tmp;
if (t_1 <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), (kx * fma(-0.16666666666666666, (kx * kx), 1.0))));
} else if (t_1 <= 0.12) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else {
tmp = sin(th) / (sqrt(fma(-0.5, cos((kx * -2.0)), 0.5)) / sin(ky));
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 tmp = 0.0 if (t_1 <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), Float64(kx * fma(-0.16666666666666666, Float64(kx * kx), 1.0))))); elseif (t_1 <= 0.12) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); else tmp = Float64(sin(th) / Float64(sqrt(fma(-0.5, cos(Float64(kx * -2.0)), 0.5)) / sin(ky))); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[(kx * N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.12], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx \cdot \mathsf{fma}\left(-0.16666666666666666, kx \cdot kx, 1\right)\right)}\\
\mathbf{elif}\;t\_1 \leq 0.12:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}{\sin ky}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6499.8
Simplified99.8%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 0.12Initial program 99.4%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5
Applied egg-rr99.5%
Taylor expanded in th around 0
Simplified67.7%
if 0.12 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in ky around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6459.3
Simplified59.3%
Final simplification80.8%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0)))
(if (<= t_1 2e-5)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (<= t_1 0.12)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(/ (sin th) (/ (sqrt (fma -0.5 (cos (* kx -2.0)) 0.5)) (sin ky)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double tmp;
if (t_1 <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if (t_1 <= 0.12) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else {
tmp = sin(th) / (sqrt(fma(-0.5, cos((kx * -2.0)), 0.5)) / sin(ky));
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 tmp = 0.0 if (t_1 <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (t_1 <= 0.12) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); else tmp = Float64(sin(th) / Float64(sqrt(fma(-0.5, cos(Float64(kx * -2.0)), 0.5)) / sin(ky))); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.12], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;t\_1 \leq 0.12:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}{\sin ky}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
Simplified99.5%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 0.12Initial program 99.4%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5
Applied egg-rr99.5%
Taylor expanded in th around 0
Simplified67.7%
if 0.12 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in ky around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6459.3
Simplified59.3%
Final simplification80.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(* (* (sin ky) th) (sqrt (/ 2.0 (- 1.0 (cos (* ky -2.0))))))
(if (<= (sin ky) 5e-164)
(* (sin th) (* ky (/ 1.0 (sin kx))))
(if (<= (sin ky) 1e-54)
(/
(sin th)
(/
(sqrt
(fma
(*
(* ky ky)
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.006349206349206349 0.08888888888888889)
-0.6666666666666666)
2.0))
0.5
(* kx kx)))
(sin ky)))
(if (<= (sin ky) 2e-23)
(* (* ky (sin th)) (sqrt (/ 1.0 (fma -0.5 (cos (* kx -2.0)) 0.5))))
(sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0)))));
} else if (sin(ky) <= 5e-164) {
tmp = sin(th) * (ky * (1.0 / sin(kx)));
} else if (sin(ky) <= 1e-54) {
tmp = sin(th) / (sqrt(fma(((ky * ky) * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, (kx * kx))) / sin(ky));
} else if (sin(ky) <= 2e-23) {
tmp = (ky * sin(th)) * sqrt((1.0 / fma(-0.5, cos((kx * -2.0)), 0.5)));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(ky * -2.0)))))); elseif (sin(ky) <= 5e-164) tmp = Float64(sin(th) * Float64(ky * Float64(1.0 / sin(kx)))); elseif (sin(ky) <= 1e-54) tmp = Float64(sin(th) / Float64(sqrt(fma(Float64(Float64(ky * ky) * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, Float64(kx * kx))) / sin(ky))); elseif (sin(ky) <= 2e-23) tmp = Float64(Float64(ky * sin(th)) * sqrt(Float64(1.0 / fma(-0.5, cos(Float64(kx * -2.0)), 0.5)))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-164], N[(N[Sin[th], $MachinePrecision] * N[(ky * N[(1.0 / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-54], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] + -0.6666666666666666), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(kx * kx), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-23], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{2}{1 - \cos \left(ky \cdot -2\right)}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-164}:\\
\;\;\;\;\sin th \cdot \left(ky \cdot \frac{1}{\sin kx}\right)\\
\mathbf{elif}\;\sin ky \leq 10^{-54}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\left(ky \cdot ky\right) \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.006349206349206349, 0.08888888888888889\right), -0.6666666666666666\right), 2\right), 0.5, kx \cdot kx\right)}}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-23}:\\
\;\;\;\;\left(ky \cdot \sin th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified53.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6430.4
Simplified30.4%
if -0.0200000000000000004 < (sin.f64 ky) < 4.99999999999999962e-164Initial program 82.9%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
Simplified40.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6443.5
Simplified43.5%
if 4.99999999999999962e-164 < (sin.f64 ky) < 1e-54Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr57.2%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6494.0
Simplified94.0%
Taylor expanded in kx around 0
unpow2N/A
*-lowering-*.f6453.4
Simplified53.4%
if 1e-54 < (sin.f64 ky) < 1.99999999999999992e-23Initial program 98.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr49.3%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6449.3
Simplified49.3%
if 1.99999999999999992e-23 < (sin.f64 ky) Initial program 99.8%
Taylor expanded in kx around 0
sin-lowering-sin.f6459.6
Simplified59.6%
Final simplification44.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (pow (sin kx) 2.0) 2e-5)
(*
(sin th)
(/
(sin ky)
(hypot
(sin ky)
(*
kx
(fma
(* kx kx)
(fma 0.008333333333333333 (* kx kx) -0.16666666666666666)
1.0)))))
(*
(sin th)
(*
(sin ky)
(sqrt
(/
1.0
(fma (- 1.0 (cos (+ ky ky))) 0.5 (+ 0.5 (* -0.5 (cos (+ kx kx)))))))))))
double code(double kx, double ky, double th) {
double tmp;
if (pow(sin(kx), 2.0) <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), (kx * fma((kx * kx), fma(0.008333333333333333, (kx * kx), -0.16666666666666666), 1.0))));
} else {
tmp = sin(th) * (sin(ky) * sqrt((1.0 / fma((1.0 - cos((ky + ky))), 0.5, (0.5 + (-0.5 * cos((kx + kx))))))));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if ((sin(kx) ^ 2.0) <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), Float64(kx * fma(Float64(kx * kx), fma(0.008333333333333333, Float64(kx * kx), -0.16666666666666666), 1.0))))); else tmp = Float64(sin(th) * Float64(sin(ky) * sqrt(Float64(1.0 / fma(Float64(1.0 - cos(Float64(ky + ky))), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx))))))))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[(kx * N[(N[(kx * kx), $MachinePrecision] * N[(0.008333333333333333 * N[(kx * kx), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(1.0 - N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\sin kx}^{2} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx \cdot \mathsf{fma}\left(kx \cdot kx, \mathsf{fma}\left(0.008333333333333333, kx \cdot kx, -0.16666666666666666\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \sqrt{\frac{1}{\mathsf{fma}\left(1 - \cos \left(ky + ky\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}\right)\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6499.8
Simplified99.8%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr99.3%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (pow (sin kx) 2.0) 2e-5)
(*
(sin th)
(/
(sin ky)
(hypot
(sin ky)
(*
kx
(fma
(* kx kx)
(fma 0.008333333333333333 (* kx kx) -0.16666666666666666)
1.0)))))
(/
(* (sin ky) (sin th))
(sqrt
(fma (- 1.0 (cos (+ ky ky))) 0.5 (+ 0.5 (* -0.5 (cos (+ kx kx)))))))))
double code(double kx, double ky, double th) {
double tmp;
if (pow(sin(kx), 2.0) <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), (kx * fma((kx * kx), fma(0.008333333333333333, (kx * kx), -0.16666666666666666), 1.0))));
} else {
tmp = (sin(ky) * sin(th)) / sqrt(fma((1.0 - cos((ky + ky))), 0.5, (0.5 + (-0.5 * cos((kx + kx))))));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if ((sin(kx) ^ 2.0) <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), Float64(kx * fma(Float64(kx * kx), fma(0.008333333333333333, Float64(kx * kx), -0.16666666666666666), 1.0))))); else tmp = Float64(Float64(sin(ky) * sin(th)) / sqrt(fma(Float64(1.0 - cos(Float64(ky + ky))), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx))))))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[(kx * N[(N[(kx * kx), $MachinePrecision] * N[(0.008333333333333333 * N[(kx * kx), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(1.0 - N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\sin kx}^{2} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx \cdot \mathsf{fma}\left(kx \cdot kx, \mathsf{fma}\left(0.008333333333333333, kx \cdot kx, -0.16666666666666666\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sqrt{\mathsf{fma}\left(1 - \cos \left(ky + ky\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6499.8
Simplified99.8%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
sin-multN/A
div-invN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.2%
Final simplification99.5%
(FPCore (kx ky th)
:precision binary64
(if (<= (pow (sin kx) 2.0) 2e-5)
(*
(sin th)
(/
(sin ky)
(hypot
(sin ky)
(*
kx
(fma
(* kx kx)
(fma 0.008333333333333333 (* kx kx) -0.16666666666666666)
1.0)))))
(*
(sin th)
(/
(sin ky)
(sqrt
(fma (- 1.0 (cos (+ ky ky))) 0.5 (+ 0.5 (* -0.5 (cos (+ kx kx))))))))))
double code(double kx, double ky, double th) {
double tmp;
if (pow(sin(kx), 2.0) <= 2e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), (kx * fma((kx * kx), fma(0.008333333333333333, (kx * kx), -0.16666666666666666), 1.0))));
} else {
tmp = sin(th) * (sin(ky) / sqrt(fma((1.0 - cos((ky + ky))), 0.5, (0.5 + (-0.5 * cos((kx + kx)))))));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if ((sin(kx) ^ 2.0) <= 2e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), Float64(kx * fma(Float64(kx * kx), fma(0.008333333333333333, Float64(kx * kx), -0.16666666666666666), 1.0))))); else tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(fma(Float64(1.0 - cos(Float64(ky + ky))), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx)))))))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 2e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[(kx * N[(N[(kx * kx), $MachinePrecision] * N[(0.008333333333333333 * N[(kx * kx), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[(1.0 - N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\sin kx}^{2} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx \cdot \mathsf{fma}\left(kx \cdot kx, \mathsf{fma}\left(0.008333333333333333, kx \cdot kx, -0.16666666666666666\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(1 - \cos \left(ky + ky\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 2.00000000000000016e-5Initial program 86.2%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8
Applied egg-rr99.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6499.8
Simplified99.8%
if 2.00000000000000016e-5 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
sin-multN/A
div-invN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
count-2N/A
+-inversesN/A
cos-0N/A
--lowering--.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
unpow2N/A
sqr-sin-aN/A
cancel-sign-sub-invN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f6499.2
Applied egg-rr99.2%
Final simplification99.5%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(* (* (sin ky) th) (sqrt (/ 2.0 (- 1.0 (cos (* ky -2.0))))))
(if (<= (sin ky) 2e-170)
(* (sin th) (/ (sin ky) (sin kx)))
(if (<= (sin ky) 1e-7)
(/
(sin th)
(/
(sqrt
(fma
(*
(* ky ky)
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.006349206349206349 0.08888888888888889)
-0.6666666666666666)
2.0))
0.5
(+ 0.5 (* -0.5 (cos (+ kx kx))))))
(* ky (fma (* ky ky) -0.16666666666666666 1.0))))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0)))));
} else if (sin(ky) <= 2e-170) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if (sin(ky) <= 1e-7) {
tmp = sin(th) / (sqrt(fma(((ky * ky) * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, (0.5 + (-0.5 * cos((kx + kx)))))) / (ky * fma((ky * ky), -0.16666666666666666, 1.0)));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(ky * -2.0)))))); elseif (sin(ky) <= 2e-170) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif (sin(ky) <= 1e-7) tmp = Float64(sin(th) / Float64(sqrt(fma(Float64(Float64(ky * ky) * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx)))))) / Float64(ky * fma(Float64(ky * ky), -0.16666666666666666, 1.0)))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-170], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] + -0.6666666666666666), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(ky * N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{2}{1 - \cos \left(ky \cdot -2\right)}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\left(ky \cdot ky\right) \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.006349206349206349, 0.08888888888888889\right), -0.6666666666666666\right), 2\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}{ky \cdot \mathsf{fma}\left(ky \cdot ky, -0.16666666666666666, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified53.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6430.4
Simplified30.4%
if -0.0200000000000000004 < (sin.f64 ky) < 1.99999999999999997e-170Initial program 82.9%
Taylor expanded in ky around 0
sin-lowering-sin.f6443.6
Simplified43.6%
if 1.99999999999999997e-170 < (sin.f64 ky) < 9.9999999999999995e-8Initial program 99.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr50.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
if 9.9999999999999995e-8 < (sin.f64 ky) Initial program 99.8%
Taylor expanded in kx around 0
sin-lowering-sin.f6458.4
Simplified58.4%
Final simplification48.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(* (* (sin ky) th) (sqrt (/ 2.0 (- 1.0 (cos (* ky -2.0))))))
(if (<= (sin ky) 2e-170)
(* (sin th) (/ ky (sin kx)))
(if (<= (sin ky) 1e-7)
(/
(sin th)
(/
(sqrt
(fma
(*
(* ky ky)
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.006349206349206349 0.08888888888888889)
-0.6666666666666666)
2.0))
0.5
(+ 0.5 (* -0.5 (cos (+ kx kx))))))
(* ky (fma (* ky ky) -0.16666666666666666 1.0))))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0)))));
} else if (sin(ky) <= 2e-170) {
tmp = sin(th) * (ky / sin(kx));
} else if (sin(ky) <= 1e-7) {
tmp = sin(th) / (sqrt(fma(((ky * ky) * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, (0.5 + (-0.5 * cos((kx + kx)))))) / (ky * fma((ky * ky), -0.16666666666666666, 1.0)));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(ky * -2.0)))))); elseif (sin(ky) <= 2e-170) tmp = Float64(sin(th) * Float64(ky / sin(kx))); elseif (sin(ky) <= 1e-7) tmp = Float64(sin(th) / Float64(sqrt(fma(Float64(Float64(ky * ky) * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx)))))) / Float64(ky * fma(Float64(ky * ky), -0.16666666666666666, 1.0)))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-170], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] + -0.6666666666666666), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(ky * N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{2}{1 - \cos \left(ky \cdot -2\right)}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\left(ky \cdot ky\right) \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.006349206349206349, 0.08888888888888889\right), -0.6666666666666666\right), 2\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}{ky \cdot \mathsf{fma}\left(ky \cdot ky, -0.16666666666666666, 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified53.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6430.4
Simplified30.4%
if -0.0200000000000000004 < (sin.f64 ky) < 1.99999999999999997e-170Initial program 82.9%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6443.5
Simplified43.5%
if 1.99999999999999997e-170 < (sin.f64 ky) < 9.9999999999999995e-8Initial program 99.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr50.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
if 9.9999999999999995e-8 < (sin.f64 ky) Initial program 99.8%
Taylor expanded in kx around 0
sin-lowering-sin.f6458.4
Simplified58.4%
Final simplification48.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(* (* (sin ky) th) (sqrt (/ 2.0 (- 1.0 (cos (* ky -2.0))))))
(if (<= (sin ky) 2e-170)
(* (sin th) (/ ky (sin kx)))
(if (<= (sin ky) 1e-7)
(/
(sin th)
(/
(sqrt
(fma
(*
(* ky ky)
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.006349206349206349 0.08888888888888889)
-0.6666666666666666)
2.0))
0.5
(+ 0.5 (* -0.5 (cos (+ kx kx))))))
ky))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0)))));
} else if (sin(ky) <= 2e-170) {
tmp = sin(th) * (ky / sin(kx));
} else if (sin(ky) <= 1e-7) {
tmp = sin(th) / (sqrt(fma(((ky * ky) * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, (0.5 + (-0.5 * cos((kx + kx)))))) / ky);
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(ky * -2.0)))))); elseif (sin(ky) <= 2e-170) tmp = Float64(sin(th) * Float64(ky / sin(kx))); elseif (sin(ky) <= 1e-7) tmp = Float64(sin(th) / Float64(sqrt(fma(Float64(Float64(ky * ky) * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx)))))) / ky)); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-170], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] + -0.6666666666666666), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{2}{1 - \cos \left(ky \cdot -2\right)}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\left(ky \cdot ky\right) \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.006349206349206349, 0.08888888888888889\right), -0.6666666666666666\right), 2\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified53.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6430.4
Simplified30.4%
if -0.0200000000000000004 < (sin.f64 ky) < 1.99999999999999997e-170Initial program 82.9%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6443.5
Simplified43.5%
if 1.99999999999999997e-170 < (sin.f64 ky) < 9.9999999999999995e-8Initial program 99.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr50.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
Taylor expanded in ky around 0
Simplified93.4%
if 9.9999999999999995e-8 < (sin.f64 ky) Initial program 99.8%
Taylor expanded in kx around 0
sin-lowering-sin.f6458.4
Simplified58.4%
Final simplification48.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (* (* (sin ky) th) (sqrt (/ 2.0 (- 1.0 (cos (* ky -2.0)))))) (if (<= (sin ky) 5e-184) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0)))));
} else if (sin(ky) <= 5e-184) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = (sin(ky) * th) * sqrt((2.0d0 / (1.0d0 - cos((ky * (-2.0d0))))))
else if (sin(ky) <= 5d-184) then
tmp = sin(th) * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = (Math.sin(ky) * th) * Math.sqrt((2.0 / (1.0 - Math.cos((ky * -2.0)))));
} else if (Math.sin(ky) <= 5e-184) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = (math.sin(ky) * th) * math.sqrt((2.0 / (1.0 - math.cos((ky * -2.0))))) elif math.sin(ky) <= 5e-184: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(ky * -2.0)))))); elseif (sin(ky) <= 5e-184) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = (sin(ky) * th) * sqrt((2.0 / (1.0 - cos((ky * -2.0))))); elseif (sin(ky) <= 5e-184) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-184], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{2}{1 - \cos \left(ky \cdot -2\right)}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-184}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified53.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6430.4
Simplified30.4%
if -0.0200000000000000004 < (sin.f64 ky) < 5.00000000000000003e-184Initial program 84.1%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6444.1
Simplified44.1%
if 5.00000000000000003e-184 < (sin.f64 ky) Initial program 97.4%
Taylor expanded in kx around 0
sin-lowering-sin.f6455.1
Simplified55.1%
Final simplification44.2%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.12) (* (sin th) (/ (sin ky) (hypot (sin ky) kx))) (/ (sin th) (/ (sqrt (fma -0.5 (cos (* kx -2.0)) 0.5)) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.12) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = sin(th) / (sqrt(fma(-0.5, cos((kx * -2.0)), 0.5)) / sin(ky));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.12) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(sin(th) / Float64(sqrt(fma(-0.5, cos(Float64(kx * -2.0)), 0.5)) / sin(ky))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.12], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.12:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}{\sin ky}}\\
\end{array}
\end{array}
if kx < 1.1200000000000001Initial program 90.6%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7
Applied egg-rr99.7%
Taylor expanded in kx around 0
Simplified71.4%
if 1.1200000000000001 < kx Initial program 99.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.2%
Taylor expanded in ky around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6459.7
Simplified59.7%
Final simplification68.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 0.4) (* (sin th) (/ (sin ky) (hypot ky (sin kx)))) (/ (sin th) (/ (sqrt (* 0.5 (- 1.0 (cos (* ky -2.0))))) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.4) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = sin(th) / (sqrt((0.5 * (1.0 - cos((ky * -2.0))))) / sin(ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.4) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th) / (Math.sqrt((0.5 * (1.0 - Math.cos((ky * -2.0))))) / Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.4: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) / (math.sqrt((0.5 * (1.0 - math.cos((ky * -2.0))))) / math.sin(ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.4) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(sin(th) / Float64(sqrt(Float64(0.5 * Float64(1.0 - cos(Float64(ky * -2.0))))) / sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.4) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = sin(th) / (sqrt((0.5 * (1.0 - cos((ky * -2.0))))) / sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.4], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(0.5 * N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.4:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{0.5 \cdot \left(1 - \cos \left(ky \cdot -2\right)\right)}}{\sin ky}}\\
\end{array}
\end{array}
if ky < 0.40000000000000002Initial program 90.5%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6
Applied egg-rr99.6%
Taylor expanded in ky around 0
Simplified68.0%
if 0.40000000000000002 < ky Initial program 99.8%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.1%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
--lowering--.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6450.5
Simplified50.5%
Final simplification63.8%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 1.92e-168)
(* (sin th) (/ ky (sin kx)))
(if (<= ky 0.44)
(/
(sin th)
(/
(sqrt
(fma
(*
(* ky ky)
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.006349206349206349 0.08888888888888889)
-0.6666666666666666)
2.0))
0.5
(+ 0.5 (* -0.5 (cos (+ kx kx))))))
(*
ky
(fma
(* ky ky)
(fma
(* ky ky)
(fma (* ky ky) -0.0001984126984126984 0.008333333333333333)
-0.16666666666666666)
1.0))))
(/ (sin th) (/ (sqrt (* 0.5 (- 1.0 (cos (* ky -2.0))))) (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.92e-168) {
tmp = sin(th) * (ky / sin(kx));
} else if (ky <= 0.44) {
tmp = sin(th) / (sqrt(fma(((ky * ky) * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, (0.5 + (-0.5 * cos((kx + kx)))))) / (ky * fma((ky * ky), fma((ky * ky), fma((ky * ky), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0)));
} else {
tmp = sin(th) / (sqrt((0.5 * (1.0 - cos((ky * -2.0))))) / sin(ky));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.92e-168) tmp = Float64(sin(th) * Float64(ky / sin(kx))); elseif (ky <= 0.44) tmp = Float64(sin(th) / Float64(sqrt(fma(Float64(Float64(ky * ky) * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.006349206349206349, 0.08888888888888889), -0.6666666666666666), 2.0)), 0.5, Float64(0.5 + Float64(-0.5 * cos(Float64(kx + kx)))))) / Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), fma(Float64(ky * ky), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0)))); else tmp = Float64(sin(th) / Float64(sqrt(Float64(0.5 * Float64(1.0 - cos(Float64(ky * -2.0))))) / sin(ky))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.92e-168], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 0.44], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] + -0.6666666666666666), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(-0.5 * N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(0.5 * N[(1.0 - N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.92 \cdot 10^{-168}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;ky \leq 0.44:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\left(ky \cdot ky\right) \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.006349206349206349, 0.08888888888888889\right), -0.6666666666666666\right), 2\right), 0.5, 0.5 + -0.5 \cdot \cos \left(kx + kx\right)\right)}}{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{0.5 \cdot \left(1 - \cos \left(ky \cdot -2\right)\right)}}{\sin ky}}\\
\end{array}
\end{array}
if ky < 1.92000000000000009e-168Initial program 89.2%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6428.1
Simplified28.1%
if 1.92000000000000009e-168 < ky < 0.440000000000000002Initial program 99.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr50.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6493.4
Simplified93.4%
if 0.440000000000000002 < ky Initial program 99.8%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.1%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
--lowering--.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6450.5
Simplified50.5%
Final simplification39.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-184) (* (sin ky) (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-184) {
tmp = sin(ky) * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= 5d-184) then
tmp = sin(ky) * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 5e-184) {
tmp = Math.sin(ky) * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 5e-184: tmp = math.sin(ky) * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-184) tmp = Float64(sin(ky) * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 5e-184) tmp = sin(ky) * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-184], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-184}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 5.00000000000000003e-184Initial program 90.3%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6
Applied egg-rr99.6%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6460.4
Simplified60.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6418.3
Simplified18.3%
Taylor expanded in kx around 0
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6418.4
Simplified18.4%
if 5.00000000000000003e-184 < (sin.f64 ky) Initial program 97.4%
Taylor expanded in kx around 0
sin-lowering-sin.f6455.1
Simplified55.1%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 2.2e-45)
(sin th)
(if (<= kx 1.12)
(/ (* (* (sin ky) (sin th)) (fma 0.16666666666666666 (* kx kx) 1.0)) kx)
(*
(sin th)
(* (sqrt (/ 1.0 (- 1.0 (cos (* kx -2.0))))) (* ky (sqrt 2.0)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.2e-45) {
tmp = sin(th);
} else if (kx <= 1.12) {
tmp = ((sin(ky) * sin(th)) * fma(0.16666666666666666, (kx * kx), 1.0)) / kx;
} else {
tmp = sin(th) * (sqrt((1.0 / (1.0 - cos((kx * -2.0))))) * (ky * sqrt(2.0)));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.2e-45) tmp = sin(th); elseif (kx <= 1.12) tmp = Float64(Float64(Float64(sin(ky) * sin(th)) * fma(0.16666666666666666, Float64(kx * kx), 1.0)) / kx); else tmp = Float64(sin(th) * Float64(sqrt(Float64(1.0 / Float64(1.0 - cos(Float64(kx * -2.0))))) * Float64(ky * sqrt(2.0)))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.2e-45], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 1.12], N[(N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 * N[(kx * kx), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(ky * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.2 \cdot 10^{-45}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 1.12:\\
\;\;\;\;\frac{\left(\sin ky \cdot \sin th\right) \cdot \mathsf{fma}\left(0.16666666666666666, kx \cdot kx, 1\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(\sqrt{\frac{1}{1 - \cos \left(kx \cdot -2\right)}} \cdot \left(ky \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if kx < 2.19999999999999993e-45Initial program 90.2%
Taylor expanded in kx around 0
sin-lowering-sin.f6426.3
Simplified26.3%
if 2.19999999999999993e-45 < kx < 1.1200000000000001Initial program 99.5%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.3
Applied egg-rr99.3%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6485.4
Simplified85.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6451.9
Simplified51.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6452.1
Simplified52.1%
if 1.1200000000000001 < kx Initial program 99.4%
unpow2N/A
sin-multN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-diffN/A
cos-sin-sumN/A
--lowering--.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f6499.1
Applied egg-rr99.1%
Taylor expanded in ky around 0
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
--lowering--.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6451.4
Simplified51.4%
Final simplification33.1%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 2.25e-45)
(sin th)
(if (<= kx 1.12)
(/ (* (* (sin ky) (sin th)) (fma 0.16666666666666666 (* kx kx) 1.0)) kx)
(/ (sin th) (/ (sqrt (fma (cos (* kx -2.0)) -0.5 0.5)) ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.25e-45) {
tmp = sin(th);
} else if (kx <= 1.12) {
tmp = ((sin(ky) * sin(th)) * fma(0.16666666666666666, (kx * kx), 1.0)) / kx;
} else {
tmp = sin(th) / (sqrt(fma(cos((kx * -2.0)), -0.5, 0.5)) / ky);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.25e-45) tmp = sin(th); elseif (kx <= 1.12) tmp = Float64(Float64(Float64(sin(ky) * sin(th)) * fma(0.16666666666666666, Float64(kx * kx), 1.0)) / kx); else tmp = Float64(sin(th) / Float64(sqrt(fma(cos(Float64(kx * -2.0)), -0.5, 0.5)) / ky)); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.25e-45], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 1.12], N[(N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 * N[(kx * kx), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[(N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.25 \cdot 10^{-45}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 1.12:\\
\;\;\;\;\frac{\left(\sin ky \cdot \sin th\right) \cdot \mathsf{fma}\left(0.16666666666666666, kx \cdot kx, 1\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sqrt{\mathsf{fma}\left(\cos \left(kx \cdot -2\right), -0.5, 0.5\right)}}{ky}}\\
\end{array}
\end{array}
if kx < 2.2499999999999999e-45Initial program 90.2%
Taylor expanded in kx around 0
sin-lowering-sin.f6426.3
Simplified26.3%
if 2.2499999999999999e-45 < kx < 1.1200000000000001Initial program 99.5%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.3
Applied egg-rr99.3%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6485.4
Simplified85.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6451.9
Simplified51.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6452.1
Simplified52.1%
if 1.1200000000000001 < kx Initial program 99.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.2%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6450.4
Simplified50.4%
Taylor expanded in ky around 0
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6451.4
Simplified51.4%
Final simplification33.1%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 2e-45)
(sin th)
(if (<= kx 1.12)
(/ (* (* (sin ky) (sin th)) (fma 0.16666666666666666 (* kx kx) 1.0)) kx)
(* (* ky (sin th)) (sqrt (/ 1.0 (fma -0.5 (cos (* kx -2.0)) 0.5)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2e-45) {
tmp = sin(th);
} else if (kx <= 1.12) {
tmp = ((sin(ky) * sin(th)) * fma(0.16666666666666666, (kx * kx), 1.0)) / kx;
} else {
tmp = (ky * sin(th)) * sqrt((1.0 / fma(-0.5, cos((kx * -2.0)), 0.5)));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (kx <= 2e-45) tmp = sin(th); elseif (kx <= 1.12) tmp = Float64(Float64(Float64(sin(ky) * sin(th)) * fma(0.16666666666666666, Float64(kx * kx), 1.0)) / kx); else tmp = Float64(Float64(ky * sin(th)) * sqrt(Float64(1.0 / fma(-0.5, cos(Float64(kx * -2.0)), 0.5)))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[kx, 2e-45], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 1.12], N[(N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 * N[(kx * kx), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(-0.5 * N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2 \cdot 10^{-45}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 1.12:\\
\;\;\;\;\frac{\left(\sin ky \cdot \sin th\right) \cdot \mathsf{fma}\left(0.16666666666666666, kx \cdot kx, 1\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;\left(ky \cdot \sin th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(-0.5, \cos \left(kx \cdot -2\right), 0.5\right)}}\\
\end{array}
\end{array}
if kx < 1.99999999999999997e-45Initial program 90.2%
Taylor expanded in kx around 0
sin-lowering-sin.f6426.3
Simplified26.3%
if 1.99999999999999997e-45 < kx < 1.1200000000000001Initial program 99.5%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.3
Applied egg-rr99.3%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6485.4
Simplified85.4%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6451.9
Simplified51.9%
Taylor expanded in kx around 0
/-lowering-/.f64N/A
associate-*r*N/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6452.1
Simplified52.1%
if 1.1200000000000001 < kx Initial program 99.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
Applied egg-rr99.2%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
cos-negN/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f6451.4
Simplified51.4%
Final simplification33.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-184) (* (sin th) (/ ky (* kx (fma -0.16666666666666666 (* kx kx) 1.0)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-184) {
tmp = sin(th) * (ky / (kx * fma(-0.16666666666666666, (kx * kx), 1.0)));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-184) tmp = Float64(sin(th) * Float64(ky / Float64(kx * fma(-0.16666666666666666, Float64(kx * kx), 1.0)))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-184], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[(kx * N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-184}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx \cdot \mathsf{fma}\left(-0.16666666666666666, kx \cdot kx, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 5.00000000000000003e-184Initial program 90.3%
+-commutativeN/A
unpow2N/A
unpow2N/A
accelerator-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6
Applied egg-rr99.6%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6460.4
Simplified60.4%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6418.0
Simplified18.0%
if 5.00000000000000003e-184 < (sin.f64 ky) Initial program 97.4%
Taylor expanded in kx around 0
sin-lowering-sin.f6455.1
Simplified55.1%
Final simplification30.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.05e-183) (* (sin th) (/ ky (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.05e-183) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.05d-183) then
tmp = sin(th) * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.05e-183) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.05e-183: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.05e-183) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.05e-183) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.05e-183], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.05 \cdot 10^{-183}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.0500000000000001e-183Initial program 90.1%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6428.1
Simplified28.1%
if 1.0500000000000001e-183 < ky Initial program 97.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6432.3
Simplified32.3%
Final simplification29.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 8e-213) (* 2.0 (/ (* (sin th) (* ky ky)) (* kx kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8e-213) {
tmp = 2.0 * ((sin(th) * (ky * ky)) / (kx * kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 8d-213) then
tmp = 2.0d0 * ((sin(th) * (ky * ky)) / (kx * kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8e-213) {
tmp = 2.0 * ((Math.sin(th) * (ky * ky)) / (kx * kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 8e-213: tmp = 2.0 * ((math.sin(th) * (ky * ky)) / (kx * kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 8e-213) tmp = Float64(2.0 * Float64(Float64(sin(th) * Float64(ky * ky)) / Float64(kx * kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 8e-213) tmp = 2.0 * ((sin(th) * (ky * ky)) / (kx * kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 8e-213], N[(2.0 * N[(N[(N[Sin[th], $MachinePrecision] * N[(ky * ky), $MachinePrecision]), $MachinePrecision] / N[(kx * kx), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 8 \cdot 10^{-213}:\\
\;\;\;\;2 \cdot \frac{\sin th \cdot \left(ky \cdot ky\right)}{kx \cdot kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 7.9999999999999996e-213Initial program 90.8%
Taylor expanded in kx around 0
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
unpow2N/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6422.1
Simplified22.1%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6410.5
Simplified10.5%
if 7.9999999999999996e-213 < ky Initial program 95.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.6
Simplified30.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 7e-213) (* th (* -0.16666666666666666 (* th th))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-213) {
tmp = th * (-0.16666666666666666 * (th * th));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 7d-213) then
tmp = th * ((-0.16666666666666666d0) * (th * th))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-213) {
tmp = th * (-0.16666666666666666 * (th * th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 7e-213: tmp = th * (-0.16666666666666666 * (th * th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 7e-213) tmp = Float64(th * Float64(-0.16666666666666666 * Float64(th * th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 7e-213) tmp = th * (-0.16666666666666666 * (th * th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 7e-213], N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 7 \cdot 10^{-213}:\\
\;\;\;\;th \cdot \left(-0.16666666666666666 \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 7.00000000000000034e-213Initial program 90.8%
Taylor expanded in kx around 0
sin-lowering-sin.f6415.4
Simplified15.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f6410.0
Simplified10.0%
Taylor expanded in th around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6411.4
Simplified11.4%
if 7.00000000000000034e-213 < ky Initial program 95.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.6
Simplified30.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.05e-183) (* th (* -0.16666666666666666 (* th th))) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.05e-183) {
tmp = th * (-0.16666666666666666 * (th * th));
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.05d-183) then
tmp = th * ((-0.16666666666666666d0) * (th * th))
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.05e-183) {
tmp = th * (-0.16666666666666666 * (th * th));
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.05e-183: tmp = th * (-0.16666666666666666 * (th * th)) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.05e-183) tmp = Float64(th * Float64(-0.16666666666666666 * Float64(th * th))); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.05e-183) tmp = th * (-0.16666666666666666 * (th * th)); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.05e-183], N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.05 \cdot 10^{-183}:\\
\;\;\;\;th \cdot \left(-0.16666666666666666 \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 1.0500000000000001e-183Initial program 90.1%
Taylor expanded in kx around 0
sin-lowering-sin.f6415.4
Simplified15.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f649.7
Simplified9.7%
Taylor expanded in th around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1
Simplified12.1%
if 1.0500000000000001e-183 < ky Initial program 97.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6432.3
Simplified32.3%
Taylor expanded in th around 0
Simplified16.3%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.2e-184) (* -0.16666666666666666 (* th (* th th))) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.2e-184) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4.2d-184) then
tmp = (-0.16666666666666666d0) * (th * (th * th))
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.2e-184) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.2e-184: tmp = -0.16666666666666666 * (th * (th * th)) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.2e-184) tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.2e-184) tmp = -0.16666666666666666 * (th * (th * th)); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.2e-184], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.2 \cdot 10^{-184}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 4.1999999999999998e-184Initial program 90.1%
Taylor expanded in kx around 0
sin-lowering-sin.f6415.4
Simplified15.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f649.7
Simplified9.7%
Taylor expanded in th around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.1
Simplified12.1%
if 4.1999999999999998e-184 < ky Initial program 97.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6432.3
Simplified32.3%
Taylor expanded in th around 0
Simplified16.3%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 92.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6421.2
Simplified21.2%
Taylor expanded in th around 0
Simplified12.0%
herbie shell --seed 2024197
(FPCore (kx ky th)
:name "Toniolo and Linder, Equation (3b), real"
:precision binary64
(* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))