
(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 93.6%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f6499.7
Applied rewrites99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5)))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
(*
(/ (sin ky) (hypot (sin ky) (sin kx)))
(fma th (* -0.16666666666666666 (* th th)) th))
(if (<= t_2 2e-7)
(*
(sin th)
(/
(*
ky
(fma
(* ky ky)
(fma (* ky ky) 0.008333333333333333 -0.16666666666666666)
1.0))
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842)
(*
(* (sin ky) th)
(sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3))))
(if (<= t_2 2.0)
(sin th)
(* (sin th) (/ (sin ky) (hypot (sin kx) ky))))))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * fma(th, (-0.16666666666666666 * (th * th)), th);
} else if (t_2 <= 2e-7) {
tmp = sin(th) * ((ky * fma((ky * ky), fma((ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
} else if (t_2 <= 2.0) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * fma(th, Float64(-0.16666666666666666 * Float64(th * th)), th)); elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3)))); elseif (t_2 <= 2.0) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2.0], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \mathsf{fma}\left(th, -0.16666666666666666 \cdot \left(th \cdot th\right), th\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, 0.008333333333333333, -0.16666666666666666\right), 1\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{elif}\;t\_2 \leq 2:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f6499.6
Applied rewrites99.6%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.3
Applied rewrites36.3%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 2Initial program 100.0%
Taylor expanded in kx around 0
lower-sin.f64100.0
Applied rewrites100.0%
if 2 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 2.8%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f642.8
Applied rewrites2.8%
lift-sin.f64N/A
pow2N/A
lower-hypot.f6499.8
Applied rewrites99.8%
Final simplification81.9%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5)))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
(*
(fma th (* -0.16666666666666666 (* th th)) th)
(*
(sin ky)
(sqrt
(/
1.0
(fma
(- 1.0 (cos (+ kx kx)))
0.5
(+ 0.5 (* (cos (+ ky ky)) -0.5)))))))
(if (<= t_2 2e-7)
(*
(sin th)
(/
(*
ky
(fma
(* ky ky)
(fma (* ky ky) 0.008333333333333333 -0.16666666666666666)
1.0))
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842)
(*
(* (sin ky) th)
(sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3))))
(if (<= t_2 2.0)
(sin th)
(* (sin th) (/ (sin ky) (hypot (sin kx) ky))))))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = fma(th, (-0.16666666666666666 * (th * th)), th) * (sin(ky) * sqrt((1.0 / fma((1.0 - cos((kx + kx))), 0.5, (0.5 + (cos((ky + ky)) * -0.5))))));
} else if (t_2 <= 2e-7) {
tmp = sin(th) * ((ky * fma((ky * ky), fma((ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
} else if (t_2 <= 2.0) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = Float64(fma(th, Float64(-0.16666666666666666 * Float64(th * th)), th) * Float64(sin(ky) * sqrt(Float64(1.0 / fma(Float64(1.0 - cos(Float64(kx + kx))), 0.5, Float64(0.5 + Float64(cos(Float64(ky + ky)) * -0.5))))))); elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3)))); elseif (t_2 <= 2.0) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], N[(N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(1.0 - N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2.0], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(th, -0.16666666666666666 \cdot \left(th \cdot th\right), th\right) \cdot \left(\sin ky \cdot \sqrt{\frac{1}{\mathsf{fma}\left(1 - \cos \left(kx + kx\right), 0.5, 0.5 + \cos \left(ky + ky\right) \cdot -0.5\right)}}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, 0.008333333333333333, -0.16666666666666666\right), 1\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{elif}\;t\_2 \leq 2:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
Applied rewrites99.2%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.3
Applied rewrites36.3%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 2Initial program 100.0%
Taylor expanded in kx around 0
lower-sin.f64100.0
Applied rewrites100.0%
if 2 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 2.8%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f642.8
Applied rewrites2.8%
lift-sin.f64N/A
pow2N/A
lower-hypot.f6499.8
Applied rewrites99.8%
Final simplification81.9%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1
(*
(sin th)
(/
(sin ky)
(hypot (sin ky) (fma kx (* -0.16666666666666666 (* kx kx)) kx)))))
(t_2 (pow (sin kx) 2.0))
(t_3 (/ (sin ky) (sqrt (+ t_2 (pow (sin ky) 2.0))))))
(if (<= t_3 -1.0)
t_1
(if (<= t_3 -0.01)
(*
(/ (sin ky) (hypot (sin ky) (sin kx)))
(fma th (* -0.16666666666666666 (* th th)) th))
(if (<= t_3 2e-7)
(*
(sin th)
(/
(*
ky
(fma
(* ky ky)
(fma (* ky ky) 0.008333333333333333 -0.16666666666666666)
1.0))
(sqrt (+ t_2 (* ky ky)))))
(if (<= t_3 0.9981109276908842)
(*
(* (sin ky) th)
(sqrt
(/
1.0
(fma
0.5
(- 1.0 (cos (* kx -2.0)))
(fma -0.5 (cos (* ky -2.0)) 0.5)))))
t_1))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) * (sin(ky) / hypot(sin(ky), fma(kx, (-0.16666666666666666 * (kx * kx)), kx)));
double t_2 = pow(sin(kx), 2.0);
double t_3 = sin(ky) / sqrt((t_2 + pow(sin(ky), 2.0)));
double tmp;
if (t_3 <= -1.0) {
tmp = t_1;
} else if (t_3 <= -0.01) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * fma(th, (-0.16666666666666666 * (th * th)), th);
} else if (t_3 <= 2e-7) {
tmp = sin(th) * ((ky * fma((ky * ky), fma((ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt((t_2 + (ky * ky))));
} else if (t_3 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), fma(-0.5, cos((ky * -2.0)), 0.5))));
} else {
tmp = t_1;
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), fma(kx, Float64(-0.16666666666666666 * Float64(kx * kx)), kx)))) t_2 = sin(kx) ^ 2.0 t_3 = Float64(sin(ky) / sqrt(Float64(t_2 + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_3 <= -1.0) tmp = t_1; elseif (t_3 <= -0.01) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * fma(th, Float64(-0.16666666666666666 * Float64(th * th)), th)); elseif (t_3 <= 2e-7) tmp = Float64(sin(th) * Float64(Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt(Float64(t_2 + Float64(ky * ky))))); elseif (t_3 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), fma(-0.5, cos(Float64(ky * -2.0)), 0.5))))); else tmp = t_1; end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]), $MachinePrecision] + kx), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1.0], t$95$1, If[LessEqual[t$95$3, -0.01], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \mathsf{fma}\left(kx, -0.16666666666666666 \cdot \left(kx \cdot kx\right), kx\right)\right)}\\
t_2 := {\sin kx}^{2}\\
t_3 := \frac{\sin ky}{\sqrt{t\_2 + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_3 \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -0.01:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \mathsf{fma}\left(th, -0.16666666666666666 \cdot \left(th \cdot th\right), th\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, 0.008333333333333333, -0.16666666666666666\right), 1\right)}{\sqrt{t\_2 + ky \cdot ky}}\\
\mathbf{elif}\;t\_3 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1 or 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.1%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f64100.0
Applied rewrites100.0%
Taylor expanded in kx around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f6499.6
Applied rewrites99.6%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.3
Applied rewrites36.3%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
Final simplification87.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5)))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
(*
(fma th (* -0.16666666666666666 (* th th)) th)
(*
(sin ky)
(sqrt
(/
1.0
(fma
(- 1.0 (cos (+ kx kx)))
0.5
(+ 0.5 (* (cos (+ ky ky)) -0.5)))))))
(if (<= t_2 2e-7)
(*
(sin th)
(/
(*
ky
(fma
(* ky ky)
(fma (* ky ky) 0.008333333333333333 -0.16666666666666666)
1.0))
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842)
(*
(* (sin ky) th)
(sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3))))
(sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = fma(th, (-0.16666666666666666 * (th * th)), th) * (sin(ky) * sqrt((1.0 / fma((1.0 - cos((kx + kx))), 0.5, (0.5 + (cos((ky + ky)) * -0.5))))));
} else if (t_2 <= 2e-7) {
tmp = sin(th) * ((ky * fma((ky * ky), fma((ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = Float64(fma(th, Float64(-0.16666666666666666 * Float64(th * th)), th) * Float64(sin(ky) * sqrt(Float64(1.0 / fma(Float64(1.0 - cos(Float64(kx + kx))), 0.5, Float64(0.5 + Float64(cos(Float64(ky + ky)) * -0.5))))))); elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3)))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], N[(N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(1.0 - N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(th, -0.16666666666666666 \cdot \left(th \cdot th\right), th\right) \cdot \left(\sin ky \cdot \sqrt{\frac{1}{\mathsf{fma}\left(1 - \cos \left(kx + kx\right), 0.5, 0.5 + \cos \left(ky + ky\right) \cdot -0.5\right)}}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, 0.008333333333333333, -0.16666666666666666\right), 1\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
Applied rewrites99.2%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.3
Applied rewrites36.3%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification80.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5))
(t_4 (sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3)))))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
(* (sin ky) (* th t_4))
(if (<= t_2 2e-7)
(*
(sin th)
(/
(*
ky
(fma
(* ky ky)
(fma (* ky ky) 0.008333333333333333 -0.16666666666666666)
1.0))
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842) (* (* (sin ky) th) t_4) (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double t_4 = sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = sin(ky) * (th * t_4);
} else if (t_2 <= 2e-7) {
tmp = sin(th) * ((ky * fma((ky * ky), fma((ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * t_4;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) t_4 = sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3))) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = Float64(sin(ky) * Float64(th * t_4)); elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(Float64(ky * fma(Float64(ky * ky), fma(Float64(ky * ky), 0.008333333333333333, -0.16666666666666666), 1.0)) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * t_4); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], N[(N[Sin[ky], $MachinePrecision] * N[(th * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(N[(ky * ky), $MachinePrecision] * N[(N[(ky * ky), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * t$95$4), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
t_4 := \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;\sin ky \cdot \left(th \cdot t\_4\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \mathsf{fma}\left(ky \cdot ky, \mathsf{fma}\left(ky \cdot ky, 0.008333333333333333, -0.16666666666666666\right), 1\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot t\_4\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
Applied rewrites99.3%
Taylor expanded in th around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites35.6%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification80.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5))
(t_4 (sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3)))))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
(* (sin ky) (* th t_4))
(if (<= t_2 2e-7)
(*
(sin th)
(/
(fma ky (* -0.16666666666666666 (* ky ky)) ky)
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842) (* (* (sin ky) th) t_4) (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double t_4 = sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = sin(ky) * (th * t_4);
} else if (t_2 <= 2e-7) {
tmp = sin(th) * (fma(ky, (-0.16666666666666666 * (ky * ky)), ky) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = (sin(ky) * th) * t_4;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) t_4 = sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3))) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = Float64(sin(ky) * Float64(th * t_4)); elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(fma(ky, Float64(-0.16666666666666666 * Float64(ky * ky)), ky) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = Float64(Float64(sin(ky) * th) * t_4); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], N[(N[Sin[ky], $MachinePrecision] * N[(th * t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(-0.16666666666666666 * N[(ky * ky), $MachinePrecision]), $MachinePrecision] + ky), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * t$95$4), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
t_4 := \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;\sin ky \cdot \left(th \cdot t\_4\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\mathsf{fma}\left(ky, -0.16666666666666666 \cdot \left(ky \cdot ky\right), ky\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot t\_4\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 99.5%
Applied rewrites99.3%
Taylor expanded in th around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
Applied rewrites35.6%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.6%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification80.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5))
(t_4
(*
(* (sin ky) th)
(sqrt (/ 1.0 (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3))))))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
t_4
(if (<= t_2 2e-7)
(*
(sin th)
(/
(fma ky (* -0.16666666666666666 (* ky ky)) ky)
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842) t_4 (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double t_4 = (sin(ky) * th) * sqrt((1.0 / fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = t_4;
} else if (t_2 <= 2e-7) {
tmp = sin(th) * (fma(ky, (-0.16666666666666666 * (ky * ky)), ky) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = t_4;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) t_4 = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3)))) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = t_4; elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(fma(ky, Float64(-0.16666666666666666 * Float64(ky * ky)), ky) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = t_4; else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], t$95$4, If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(-0.16666666666666666 * N[(ky * ky), $MachinePrecision]), $MachinePrecision] + ky), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], t$95$4, N[Sin[th], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
t_4 := \left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\mathsf{fma}\left(ky, -0.16666666666666666 \cdot \left(ky \cdot ky\right), ky\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002 or 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.4%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites51.1%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification80.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (pow (sin kx) 2.0))
(t_2 (/ (sin ky) (sqrt (+ t_1 (pow (sin ky) 2.0)))))
(t_3 (fma -0.5 (cos (* ky -2.0)) 0.5))
(t_4
(* th (/ (sin ky) (sqrt (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_3))))))
(if (<= t_2 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_3)))
(if (<= t_2 -0.01)
t_4
(if (<= t_2 2e-7)
(*
(sin th)
(/
(fma ky (* -0.16666666666666666 (* ky ky)) ky)
(sqrt (+ t_1 (* ky ky)))))
(if (<= t_2 0.9981109276908842) t_4 (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = pow(sin(kx), 2.0);
double t_2 = sin(ky) / sqrt((t_1 + pow(sin(ky), 2.0)));
double t_3 = fma(-0.5, cos((ky * -2.0)), 0.5);
double t_4 = th * (sin(ky) / sqrt(fma(0.5, (1.0 - cos((kx * -2.0))), t_3)));
double tmp;
if (t_2 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_3));
} else if (t_2 <= -0.01) {
tmp = t_4;
} else if (t_2 <= 2e-7) {
tmp = sin(th) * (fma(ky, (-0.16666666666666666 * (ky * ky)), ky) / sqrt((t_1 + (ky * ky))));
} else if (t_2 <= 0.9981109276908842) {
tmp = t_4;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = sin(kx) ^ 2.0 t_2 = Float64(sin(ky) / sqrt(Float64(t_1 + (sin(ky) ^ 2.0)))) t_3 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) t_4 = Float64(th * Float64(sin(ky) / sqrt(fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_3)))) tmp = 0.0 if (t_2 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_3))); elseif (t_2 <= -0.01) tmp = t_4; elseif (t_2 <= 2e-7) tmp = Float64(sin(th) * Float64(fma(ky, Float64(-0.16666666666666666 * Float64(ky * ky)), ky) / sqrt(Float64(t_1 + Float64(ky * ky))))); elseif (t_2 <= 0.9981109276908842) tmp = t_4; else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, Block[{t$95$4 = N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.01], t$95$4, If[LessEqual[t$95$2, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(-0.16666666666666666 * N[(ky * ky), $MachinePrecision]), $MachinePrecision] + ky), $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.9981109276908842], t$95$4, N[Sin[th], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin kx}^{2}\\
t_2 := \frac{\sin ky}{\sqrt{t\_1 + {\sin ky}^{2}}}\\
t_3 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
t_4 := th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_3\right)}}\\
\mathbf{if}\;t\_2 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_3}}\\
\mathbf{elif}\;t\_2 \leq -0.01:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\mathsf{fma}\left(ky, -0.16666666666666666 \cdot \left(ky \cdot ky\right), ky\right)}{\sqrt{t\_1 + ky \cdot ky}}\\
\mathbf{elif}\;t\_2 \leq 0.9981109276908842:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002 or 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.4%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites51.1%
lift-sin.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
Applied rewrites51.0%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
Taylor expanded in ky around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.5
Applied rewrites99.5%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification80.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))))
(t_2 (fma -0.5 (cos (* ky -2.0)) 0.5))
(t_3
(* th (/ (sin ky) (sqrt (fma 0.5 (- 1.0 (cos (* kx -2.0))) t_2))))))
(if (<= t_1 -1.0)
(* (sin th) (/ (sin ky) (sqrt t_2)))
(if (<= t_1 -0.01)
t_3
(if (<= t_1 2e-7)
(* (sin th) (/ (sin ky) (sin kx)))
(if (<= t_1 0.9981109276908842) t_3 (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double t_2 = fma(-0.5, cos((ky * -2.0)), 0.5);
double t_3 = th * (sin(ky) / sqrt(fma(0.5, (1.0 - cos((kx * -2.0))), t_2)));
double tmp;
if (t_1 <= -1.0) {
tmp = sin(th) * (sin(ky) / sqrt(t_2));
} else if (t_1 <= -0.01) {
tmp = t_3;
} else if (t_1 <= 2e-7) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if (t_1 <= 0.9981109276908842) {
tmp = t_3;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) t_2 = fma(-0.5, cos(Float64(ky * -2.0)), 0.5) t_3 = Float64(th * Float64(sin(ky) / sqrt(fma(0.5, Float64(1.0 - cos(Float64(kx * -2.0))), t_2)))) tmp = 0.0 if (t_1 <= -1.0) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(t_2))); elseif (t_1 <= -0.01) tmp = t_3; elseif (t_1 <= 2e-7) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif (t_1 <= 0.9981109276908842) tmp = t_3; else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]}, Block[{t$95$3 = N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(0.5 * N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.0], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.01], t$95$3, If[LessEqual[t$95$1, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.9981109276908842], t$95$3, N[Sin[th], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
t_2 := \mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)\\
t_3 := th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(0.5, 1 - \cos \left(kx \cdot -2\right), t\_2\right)}}\\
\mathbf{if}\;t\_1 \leq -1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{t\_2}}\\
\mathbf{elif}\;t\_1 \leq -0.01:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;t\_1 \leq 0.9981109276908842:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -1Initial program 83.8%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6483.8
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites69.1%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
if -1 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002 or 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.99811092769088416Initial program 99.4%
Applied rewrites99.4%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites51.1%
lift-sin.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
Applied rewrites51.0%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
lower-sin.f6463.7
Applied rewrites63.7%
if 0.99811092769088416 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 84.5%
Taylor expanded in kx around 0
lower-sin.f6492.7
Applied rewrites92.7%
Final simplification67.2%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
(if (<= t_1 -0.707)
(* (sin th) (/ (sin ky) (sqrt (fma -0.5 (cos (* ky -2.0)) 0.5))))
(if (<= t_1 5e-277)
(* (sin th) (* (sin ky) (sqrt (/ 2.0 (- 1.0 (cos (* kx -2.0)))))))
(if (<= t_1 0.2) (* (sin th) (/ (sin ky) (sin kx))) (sin th))))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double tmp;
if (t_1 <= -0.707) {
tmp = sin(th) * (sin(ky) / sqrt(fma(-0.5, cos((ky * -2.0)), 0.5)));
} else if (t_1 <= 5e-277) {
tmp = sin(th) * (sin(ky) * sqrt((2.0 / (1.0 - cos((kx * -2.0))))));
} else if (t_1 <= 0.2) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_1 <= -0.707) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(fma(-0.5, cos(Float64(ky * -2.0)), 0.5)))); elseif (t_1 <= 5e-277) tmp = Float64(sin(th) * Float64(sin(ky) * sqrt(Float64(2.0 / Float64(1.0 - cos(Float64(kx * -2.0))))))); elseif (t_1 <= 0.2) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.707], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-277], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[Sqrt[N[(2.0 / N[(1.0 - N[Cos[N[(kx * -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_1 \leq -0.707:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-277}:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \sqrt{\frac{2}{1 - \cos \left(kx \cdot -2\right)}}\right)\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.706999999999999962Initial program 86.9%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6486.9
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites75.2%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6459.8
Applied rewrites59.8%
if -0.706999999999999962 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 5e-277Initial program 99.5%
Applied rewrites79.3%
Taylor expanded in ky around 0
lower-/.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6458.8
Applied rewrites58.8%
if 5e-277 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.20000000000000001Initial program 99.5%
Taylor expanded in ky around 0
lower-sin.f6461.3
Applied rewrites61.3%
if 0.20000000000000001 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 89.9%
Taylor expanded in kx around 0
lower-sin.f6466.5
Applied rewrites66.5%
Final simplification61.8%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
(if (<= t_1 -0.1)
(* (sin th) (/ (sin ky) (sqrt (fma -0.5 (cos (* ky -2.0)) 0.5))))
(if (<= t_1 0.2) (* (sin th) (/ (sin ky) (sin kx))) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double tmp;
if (t_1 <= -0.1) {
tmp = sin(th) * (sin(ky) / sqrt(fma(-0.5, cos((ky * -2.0)), 0.5)));
} else if (t_1 <= 0.2) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_1 <= -0.1) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(fma(-0.5, cos(Float64(ky * -2.0)), 0.5)))); elseif (t_1 <= 0.2) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.1], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_1 \leq -0.1:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}}\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.10000000000000001Initial program 89.9%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6489.9
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites81.0%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6449.9
Applied rewrites49.9%
if -0.10000000000000001 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.20000000000000001Initial program 99.5%
Taylor expanded in ky around 0
lower-sin.f6462.1
Applied rewrites62.1%
if 0.20000000000000001 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 89.9%
Taylor expanded in kx around 0
lower-sin.f6466.5
Applied rewrites66.5%
Final simplification59.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
(if (<= t_1 -0.77)
(*
(sqrt (/ 1.0 (fma -0.5 (cos (* ky -2.0)) 0.5)))
(* (sin ky) (fma -0.16666666666666666 (* th (* th th)) th)))
(if (<= t_1 0.2) (* (sin th) (/ (sin ky) (sin kx))) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double tmp;
if (t_1 <= -0.77) {
tmp = sqrt((1.0 / fma(-0.5, cos((ky * -2.0)), 0.5))) * (sin(ky) * fma(-0.16666666666666666, (th * (th * th)), th));
} else if (t_1 <= 0.2) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_1 <= -0.77) tmp = Float64(sqrt(Float64(1.0 / fma(-0.5, cos(Float64(ky * -2.0)), 0.5))) * Float64(sin(ky) * fma(-0.16666666666666666, Float64(th * Float64(th * th)), th))); elseif (t_1 <= 0.2) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.77], N[(N[Sqrt[N[(1.0 / N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_1 \leq -0.77:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}} \cdot \left(\sin ky \cdot \mathsf{fma}\left(-0.16666666666666666, th \cdot \left(th \cdot th\right), th\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.77000000000000002Initial program 86.0%
Applied rewrites73.3%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.3
Applied rewrites30.3%
Taylor expanded in kx around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites27.5%
if -0.77000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 0.20000000000000001Initial program 99.5%
Taylor expanded in ky around 0
lower-sin.f6452.5
Applied rewrites52.5%
if 0.20000000000000001 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 89.9%
Taylor expanded in kx around 0
lower-sin.f6466.5
Applied rewrites66.5%
Final simplification51.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
(if (<= t_1 -0.01)
(*
(sqrt (/ 1.0 (fma -0.5 (cos (* ky -2.0)) 0.5)))
(* (sin ky) (fma -0.16666666666666666 (* th (* th th)) th)))
(if (<= t_1 2e-7) (* (sin th) (/ ky (sin kx))) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double tmp;
if (t_1 <= -0.01) {
tmp = sqrt((1.0 / fma(-0.5, cos((ky * -2.0)), 0.5))) * (sin(ky) * fma(-0.16666666666666666, (th * (th * th)), th));
} else if (t_1 <= 2e-7) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_1 <= -0.01) tmp = Float64(sqrt(Float64(1.0 / fma(-0.5, cos(Float64(ky * -2.0)), 0.5))) * Float64(sin(ky) * fma(-0.16666666666666666, Float64(th * Float64(th * th)), th))); elseif (t_1 <= 2e-7) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.01], N[(N[Sqrt[N[(1.0 / N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_1 \leq -0.01:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}} \cdot \left(\sin ky \cdot \mathsf{fma}\left(-0.16666666666666666, th \cdot \left(th \cdot th\right), th\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 90.0%
Applied rewrites81.0%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.9
Applied rewrites32.9%
Taylor expanded in kx around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites21.9%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
lower-/.f64N/A
lower-sin.f6463.7
Applied rewrites63.7%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.3%
Taylor expanded in kx around 0
lower-sin.f6464.7
Applied rewrites64.7%
Final simplification51.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))
(if (<= t_1 -0.01)
(* (* (sin ky) th) (sqrt (/ 1.0 (fma -0.5 (cos (* ky -2.0)) 0.5))))
(if (<= t_1 2e-7) (* (sin th) (/ ky (sin kx))) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)));
double tmp;
if (t_1 <= -0.01) {
tmp = (sin(ky) * th) * sqrt((1.0 / fma(-0.5, cos((ky * -2.0)), 0.5)));
} else if (t_1 <= 2e-7) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) t_1 = Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) tmp = 0.0 if (t_1 <= -0.01) tmp = Float64(Float64(sin(ky) * th) * sqrt(Float64(1.0 / fma(-0.5, cos(Float64(ky * -2.0)), 0.5)))); elseif (t_1 <= 2e-7) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -0.01], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-7], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}}\\
\mathbf{if}\;t\_1 \leq -0.01:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < -0.0100000000000000002Initial program 90.0%
Applied rewrites81.0%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites32.5%
Taylor expanded in kx around 0
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6421.6
Applied rewrites21.6%
if -0.0100000000000000002 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 99.5%
Taylor expanded in ky around 0
lower-/.f64N/A
lower-sin.f6463.7
Applied rewrites63.7%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.3%
Taylor expanded in kx around 0
lower-sin.f6464.7
Applied rewrites64.7%
Final simplification50.9%
(FPCore (kx ky th) :precision binary64 (if (<= (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) 2e-7) (* (sin th) (/ ky (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) <= 2e-7) {
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) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) <= 2d-7) 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) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) <= 2e-7) {
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) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) <= 2e-7: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 2e-7) 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) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 2e-7) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[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], 2e-7], 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}\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 1.9999999999999999e-7Initial program 95.2%
Taylor expanded in ky around 0
lower-/.f64N/A
lower-sin.f6436.9
Applied rewrites36.9%
if 1.9999999999999999e-7 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.3%
Taylor expanded in kx around 0
lower-sin.f6464.7
Applied rewrites64.7%
Final simplification45.8%
(FPCore (kx ky th)
:precision binary64
(if (<=
(*
(sin th)
(/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))))
1e-309)
(* -0.16666666666666666 (* th (* th th)))
(fma
th
(* (* th th) (fma 0.008333333333333333 (* th th) -0.16666666666666666))
th)))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(th) * (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0))))) <= 1e-309) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = fma(th, ((th * th) * fma(0.008333333333333333, (th * th), -0.16666666666666666)), th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(th) * Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))) <= 1e-309) tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); else tmp = fma(th, Float64(Float64(th * th) * fma(0.008333333333333333, Float64(th * th), -0.16666666666666666)), th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[(N[Sin[th], $MachinePrecision] * 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]), $MachinePrecision], 1e-309], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(th * N[(N[(th * th), $MachinePrecision] * N[(0.008333333333333333 * N[(th * th), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin th \cdot \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 10^{-309}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(th, \left(th \cdot th\right) \cdot \mathsf{fma}\left(0.008333333333333333, th \cdot th, -0.16666666666666666\right), th\right)\\
\end{array}
\end{array}
if (*.f64 (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) (sin.f64 th)) < 1.000000000000002e-309Initial program 96.7%
Taylor expanded in kx around 0
lower-sin.f6421.6
Applied rewrites21.6%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6410.1
Applied rewrites10.1%
Taylor expanded in th around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6423.6
Applied rewrites23.6%
if 1.000000000000002e-309 < (*.f64 (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) (sin.f64 th)) Initial program 90.3%
Taylor expanded in kx around 0
lower-sin.f6424.8
Applied rewrites24.8%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6415.4
Applied rewrites15.4%
Final simplification19.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (pow (sin kx) 2.0) 1e-12)
(*
(sin th)
(/
(sin ky)
(hypot (sin ky) (fma kx (* -0.16666666666666666 (* kx kx)) kx))))
(*
(sin th)
(*
(sin ky)
(sqrt
(/
1.0
(fma (- 1.0 (cos (+ kx kx))) 0.5 (fma (cos (+ ky ky)) -0.5 0.5))))))))
double code(double kx, double ky, double th) {
double tmp;
if (pow(sin(kx), 2.0) <= 1e-12) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), fma(kx, (-0.16666666666666666 * (kx * kx)), kx)));
} else {
tmp = sin(th) * (sin(ky) * sqrt((1.0 / fma((1.0 - cos((kx + kx))), 0.5, fma(cos((ky + ky)), -0.5, 0.5)))));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if ((sin(kx) ^ 2.0) <= 1e-12) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), fma(kx, Float64(-0.16666666666666666 * Float64(kx * kx)), kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) * sqrt(Float64(1.0 / fma(Float64(1.0 - cos(Float64(kx + kx))), 0.5, fma(cos(Float64(ky + ky)), -0.5, 0.5)))))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 1e-12], 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]), $MachinePrecision] + kx), $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[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\sin kx}^{2} \leq 10^{-12}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \mathsf{fma}\left(kx, -0.16666666666666666 \cdot \left(kx \cdot kx\right), kx\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \sqrt{\frac{1}{\mathsf{fma}\left(1 - \cos \left(kx + kx\right), 0.5, \mathsf{fma}\left(\cos \left(ky + ky\right), -0.5, 0.5\right)\right)}}\right)\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 9.9999999999999998e-13Initial program 87.3%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f6499.9
Applied rewrites99.9%
Taylor expanded in kx around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
if 9.9999999999999998e-13 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
Applied rewrites99.4%
lift-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
flip-+N/A
lift-*.f64N/A
lift-*.f64N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lift-+.f64N/A
lower-fma.f6434.2
Applied rewrites99.4%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (pow (sin kx) 2.0) 1e-12)
(*
(sin th)
(/
(sin ky)
(hypot (sin ky) (fma kx (* -0.16666666666666666 (* kx kx)) kx))))
(*
(sin th)
(/
(sin ky)
(sqrt
(fma (- 1.0 (cos (+ kx kx))) 0.5 (+ 0.5 (* (cos (+ ky ky)) -0.5))))))))
double code(double kx, double ky, double th) {
double tmp;
if (pow(sin(kx), 2.0) <= 1e-12) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), fma(kx, (-0.16666666666666666 * (kx * kx)), kx)));
} else {
tmp = sin(th) * (sin(ky) / sqrt(fma((1.0 - cos((kx + kx))), 0.5, (0.5 + (cos((ky + ky)) * -0.5)))));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if ((sin(kx) ^ 2.0) <= 1e-12) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), fma(kx, Float64(-0.16666666666666666 * Float64(kx * kx)), kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(fma(Float64(1.0 - cos(Float64(kx + kx))), 0.5, Float64(0.5 + Float64(cos(Float64(ky + ky)) * -0.5)))))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 1e-12], 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]), $MachinePrecision] + kx), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[(1.0 - N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(0.5 + N[(N[Cos[N[(ky + ky), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\sin kx}^{2} \leq 10^{-12}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \mathsf{fma}\left(kx, -0.16666666666666666 \cdot \left(kx \cdot kx\right), kx\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(1 - \cos \left(kx + kx\right), 0.5, 0.5 + \cos \left(ky + ky\right) \cdot -0.5\right)}}\\
\end{array}
\end{array}
if (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 9.9999999999999998e-13Initial program 87.3%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
lower-hypot.f6499.9
Applied rewrites99.9%
Taylor expanded in kx around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
if 9.9999999999999998e-13 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.5%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6499.5
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.3%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<=
(*
(sin th)
(/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))))
1e-309)
(* -0.16666666666666666 (* th (* th th)))
(* th (fma th (* th -0.16666666666666666) 1.0))))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(th) * (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0))))) <= 1e-309) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = th * fma(th, (th * -0.16666666666666666), 1.0);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(th) * Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))) <= 1e-309) tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); else tmp = Float64(th * fma(th, Float64(th * -0.16666666666666666), 1.0)); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[(N[Sin[th], $MachinePrecision] * 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]), $MachinePrecision], 1e-309], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(th * N[(th * N[(th * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin th \cdot \frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 10^{-309}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th \cdot \mathsf{fma}\left(th, th \cdot -0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (*.f64 (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) (sin.f64 th)) < 1.000000000000002e-309Initial program 96.7%
Taylor expanded in kx around 0
lower-sin.f6421.6
Applied rewrites21.6%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6410.1
Applied rewrites10.1%
Taylor expanded in th around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6423.6
Applied rewrites23.6%
if 1.000000000000002e-309 < (*.f64 (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) (sin.f64 th)) Initial program 90.3%
Taylor expanded in kx around 0
lower-sin.f6424.8
Applied rewrites24.8%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6415.1
Applied rewrites15.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft1-inN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6415.1
Applied rewrites15.1%
Final simplification19.5%
(FPCore (kx ky th) :precision binary64 (if (<= (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) 5e-16) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) <= 5e-16) {
tmp = ky * (th / 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) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) <= 5d-16) then
tmp = ky * (th / 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) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) <= 5e-16) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) <= 5e-16: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 5e-16) tmp = Float64(ky * Float64(th / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if ((sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 5e-16) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[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], 5e-16], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 5 \cdot 10^{-16}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 5.0000000000000004e-16Initial program 95.1%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6459.8
Applied rewrites59.8%
Taylor expanded in th around 0
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
lower-pow.f64N/A
lower-sin.f6432.6
Applied rewrites32.6%
Taylor expanded in ky around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f6425.5
Applied rewrites25.5%
if 5.0000000000000004e-16 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.4%
Taylor expanded in kx around 0
lower-sin.f6464.0
Applied rewrites64.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) 5e-16)
(/
(*
ky
(*
(sqrt 0.5)
(* (fma -0.16666666666666666 (* th (* th th)) th) (sqrt 2.0))))
kx)
(sin th)))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) <= 5e-16) {
tmp = (ky * (sqrt(0.5) * (fma(-0.16666666666666666, (th * (th * th)), th) * sqrt(2.0)))) / kx;
} else {
tmp = sin(th);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 5e-16) tmp = Float64(Float64(ky * Float64(sqrt(0.5) * Float64(fma(-0.16666666666666666, Float64(th * Float64(th * th)), th) * sqrt(2.0)))) / kx); else tmp = sin(th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[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], 5e-16], N[(N[(ky * N[(N[Sqrt[0.5], $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 5 \cdot 10^{-16}:\\
\;\;\;\;\frac{ky \cdot \left(\sqrt{0.5} \cdot \left(\mathsf{fma}\left(-0.16666666666666666, th \cdot \left(th \cdot th\right), th\right) \cdot \sqrt{2}\right)\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 5.0000000000000004e-16Initial program 95.1%
Applied rewrites76.7%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Taylor expanded in ky around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.0%
Taylor expanded in kx around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.2
Applied rewrites21.2%
if 5.0000000000000004e-16 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.4%
Taylor expanded in kx around 0
lower-sin.f6464.0
Applied rewrites64.0%
Final simplification35.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) 1e-7)
(/
(*
ky
(*
(sqrt 0.5)
(* (fma -0.16666666666666666 (* th (* th th)) th) (sqrt 2.0))))
kx)
(* th (fma th (* th -0.16666666666666666) 1.0))))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) <= 1e-7) {
tmp = (ky * (sqrt(0.5) * (fma(-0.16666666666666666, (th * (th * th)), th) * sqrt(2.0)))) / kx;
} else {
tmp = th * fma(th, (th * -0.16666666666666666), 1.0);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 1e-7) tmp = Float64(Float64(ky * Float64(sqrt(0.5) * Float64(fma(-0.16666666666666666, Float64(th * Float64(th * th)), th) * sqrt(2.0)))) / kx); else tmp = Float64(th * fma(th, Float64(th * -0.16666666666666666), 1.0)); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[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], 1e-7], N[(N[(ky * N[(N[Sqrt[0.5], $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision], N[(th * N[(th * N[(th * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 10^{-7}:\\
\;\;\;\;\frac{ky \cdot \left(\sqrt{0.5} \cdot \left(\mathsf{fma}\left(-0.16666666666666666, th \cdot \left(th \cdot th\right), th\right) \cdot \sqrt{2}\right)\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;th \cdot \mathsf{fma}\left(th, th \cdot -0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 9.9999999999999995e-8Initial program 95.1%
Applied rewrites76.7%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Taylor expanded in ky around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.0%
Taylor expanded in kx around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.2
Applied rewrites21.2%
if 9.9999999999999995e-8 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.4%
Taylor expanded in kx around 0
lower-sin.f6464.0
Applied rewrites64.0%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft1-inN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6432.0
Applied rewrites32.0%
Final simplification24.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) 1e-7)
(*
(/ (sqrt 0.5) kx)
(* ky (* (fma -0.16666666666666666 (* th (* th th)) th) (sqrt 2.0))))
(* th (fma th (* th -0.16666666666666666) 1.0))))
double code(double kx, double ky, double th) {
double tmp;
if ((sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) <= 1e-7) {
tmp = (sqrt(0.5) / kx) * (ky * (fma(-0.16666666666666666, (th * (th * th)), th) * sqrt(2.0)));
} else {
tmp = th * fma(th, (th * -0.16666666666666666), 1.0);
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) <= 1e-7) tmp = Float64(Float64(sqrt(0.5) / kx) * Float64(ky * Float64(fma(-0.16666666666666666, Float64(th * Float64(th * th)), th) * sqrt(2.0)))); else tmp = Float64(th * fma(th, Float64(th * -0.16666666666666666), 1.0)); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[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], 1e-7], N[(N[(N[Sqrt[0.5], $MachinePrecision] / kx), $MachinePrecision] * N[(ky * N[(N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision] + th), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(th * N[(th * N[(th * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \leq 10^{-7}:\\
\;\;\;\;\frac{\sqrt{0.5}}{kx} \cdot \left(ky \cdot \left(\mathsf{fma}\left(-0.16666666666666666, th \cdot \left(th \cdot th\right), th\right) \cdot \sqrt{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th \cdot \mathsf{fma}\left(th, th \cdot -0.16666666666666666, 1\right)\\
\end{array}
\end{array}
if (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) < 9.9999999999999995e-8Initial program 95.1%
Applied rewrites76.7%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Taylor expanded in ky around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower--.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.0%
Taylor expanded in kx around 0
lower-/.f64N/A
lower-sqrt.f6421.2
Applied rewrites21.2%
if 9.9999999999999995e-8 < (/.f64 (sin.f64 ky) (sqrt.f64 (+.f64 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) (pow.f64 (sin.f64 ky) #s(literal 2 binary64))))) Initial program 90.4%
Taylor expanded in kx around 0
lower-sin.f6464.0
Applied rewrites64.0%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.0
Applied rewrites32.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft1-inN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6432.0
Applied rewrites32.0%
Final simplification24.7%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 1.05e-183)
(* (sin th) (/ ky (sin kx)))
(if (<= ky 0.0076)
(*
(sin ky)
(/ (sin th) (sqrt (fma (- 1.0 (cos (+ kx kx))) 0.5 (* ky ky)))))
(* (sin th) (/ (sin ky) (sqrt (fma -0.5 (cos (* ky -2.0)) 0.5)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.05e-183) {
tmp = sin(th) * (ky / sin(kx));
} else if (ky <= 0.0076) {
tmp = sin(ky) * (sin(th) / sqrt(fma((1.0 - cos((kx + kx))), 0.5, (ky * ky))));
} else {
tmp = sin(th) * (sin(ky) / sqrt(fma(-0.5, cos((ky * -2.0)), 0.5)));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.05e-183) tmp = Float64(sin(th) * Float64(ky / sin(kx))); elseif (ky <= 0.0076) tmp = Float64(sin(ky) * Float64(sin(th) / sqrt(fma(Float64(1.0 - cos(Float64(kx + kx))), 0.5, Float64(ky * ky))))); else tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(fma(-0.5, cos(Float64(ky * -2.0)), 0.5)))); end return 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], If[LessEqual[ky, 0.0076], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[(N[(1.0 - N[Cos[N[(kx + kx), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5 + N[(ky * ky), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(-0.5 * N[Cos[N[(ky * -2.0), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.05 \cdot 10^{-183}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;ky \leq 0.0076:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sqrt{\mathsf{fma}\left(1 - \cos \left(kx + kx\right), 0.5, ky \cdot ky\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{\mathsf{fma}\left(-0.5, \cos \left(ky \cdot -2\right), 0.5\right)}}\\
\end{array}
\end{array}
if ky < 1.0500000000000001e-183Initial program 91.5%
Taylor expanded in ky around 0
lower-/.f64N/A
lower-sin.f6433.3
Applied rewrites33.3%
if 1.0500000000000001e-183 < ky < 0.00759999999999999998Initial program 93.1%
Applied rewrites64.1%
Taylor expanded in ky around 0
unpow2N/A
lower-*.f6487.0
Applied rewrites87.0%
if 0.00759999999999999998 < ky Initial program 99.7%
lift-sin.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-sqrt.f6499.7
lift-+.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-sin.f64N/A
lift-sin.f64N/A
sin-multN/A
div-invN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in kx around 0
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
cos-negN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6455.4
Applied rewrites55.4%
Final simplification44.7%
(FPCore (kx ky th) :precision binary64 (* -0.16666666666666666 (* th (* th th))))
double code(double kx, double ky, double th) {
return -0.16666666666666666 * (th * (th * th));
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (-0.16666666666666666d0) * (th * (th * th))
end function
public static double code(double kx, double ky, double th) {
return -0.16666666666666666 * (th * (th * th));
}
def code(kx, ky, th): return -0.16666666666666666 * (th * (th * th))
function code(kx, ky, th) return Float64(-0.16666666666666666 * Float64(th * Float64(th * th))) end
function tmp = code(kx, ky, th) tmp = -0.16666666666666666 * (th * (th * th)); end
code[kx_, ky_, th_] := N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)
\end{array}
Initial program 93.6%
Taylor expanded in kx around 0
lower-sin.f6423.2
Applied rewrites23.2%
Taylor expanded in th around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6412.5
Applied rewrites12.5%
Taylor expanded in th around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6413.8
Applied rewrites13.8%
herbie shell --seed 2024214
(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)))