
(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 14 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.7%
remove-double-neg93.7%
sin-neg93.7%
neg-mul-193.7%
*-commutative93.7%
associate-*l*93.7%
associate-*l/93.2%
associate-/r/93.2%
associate-*l/93.7%
associate-/r/93.7%
sin-neg93.7%
neg-mul-193.7%
associate-/r*93.7%
associate-/r/93.7%
Simplified99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.02) (* (sin th) (fabs (/ ky (sin kx)))) (if (<= (sin kx) 5e-20) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.02) {
tmp = sin(th) * fabs((ky / sin(kx)));
} else if (sin(kx) <= 5e-20) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
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(kx) <= (-0.02d0)) then
tmp = sin(th) * abs((ky / sin(kx)))
else if (sin(kx) <= 5d-20) then
tmp = sin(th)
else
tmp = sin(th) * (sin(ky) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-20) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.02: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) elif math.sin(kx) <= 5e-20: tmp = math.sin(th) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.02) tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); elseif (sin(kx) <= 5e-20) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.02) tmp = sin(th) * abs((ky / sin(kx))); elseif (sin(kx) <= 5e-20) tmp = sin(th); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-20], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-20}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.5%
Taylor expanded in ky around 0 10.9%
add-sqr-sqrt6.5%
sqrt-unprod19.1%
pow219.1%
Applied egg-rr19.1%
unpow219.1%
rem-sqrt-square22.8%
Simplified22.8%
if -0.0200000000000000004 < (sin.f64 kx) < 4.9999999999999999e-20Initial program 87.0%
remove-double-neg87.0%
sin-neg87.0%
neg-mul-187.0%
*-commutative87.0%
associate-*l*87.0%
associate-*l/85.8%
associate-/r/85.8%
associate-*l/87.0%
associate-/r/86.9%
sin-neg86.9%
neg-mul-186.9%
associate-/r*86.9%
associate-/r/87.0%
Simplified99.9%
Taylor expanded in kx around 0 43.5%
if 4.9999999999999999e-20 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 52.0%
Final simplification39.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-53) (* (sin th) (/ (sin ky) (hypot ky (sin kx)))) (/ (* ky (sin th)) (hypot (sin kx) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-53) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = (ky * sin(th)) / hypot(sin(kx), ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 1e-53) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(kx), ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-53: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(kx), ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-53) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(kx), ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-53) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = (ky * sin(th)) / hypot(sin(kx), ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-53], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-53}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if (sin.f64 ky) < 1.00000000000000003e-53Initial program 91.1%
remove-double-neg91.1%
sin-neg91.1%
neg-mul-191.1%
*-commutative91.1%
associate-*l*91.1%
associate-*l/90.3%
associate-/r/90.3%
associate-*l/91.1%
associate-/r/91.1%
sin-neg91.1%
neg-mul-191.1%
associate-/r*91.1%
associate-/r/91.1%
Simplified99.7%
Taylor expanded in ky around 0 59.1%
if 1.00000000000000003e-53 < (sin.f64 ky) Initial program 99.7%
remove-double-neg99.7%
sin-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*l*99.7%
associate-*l/99.6%
associate-/r/99.6%
associate-*l/99.7%
associate-/r/99.6%
sin-neg99.6%
neg-mul-199.6%
associate-/r*99.6%
associate-/r/99.7%
Simplified99.7%
associate-*l/99.6%
hypot-udef99.6%
unpow299.6%
unpow299.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 16.5%
Taylor expanded in ky around 0 36.9%
Final simplification52.3%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.062)
(/
(sin ky)
(* (hypot (sin ky) (sin kx)) (+ (/ 1.0 th) (* th 0.16666666666666666))))
(/ (* ky (sin th)) (hypot (sin kx) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.062) {
tmp = sin(ky) / (hypot(sin(ky), sin(kx)) * ((1.0 / th) + (th * 0.16666666666666666)));
} else {
tmp = (ky * sin(th)) / hypot(sin(kx), ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.062) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), Math.sin(kx)) * ((1.0 / th) + (th * 0.16666666666666666)));
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(kx), ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.062: tmp = math.sin(ky) / (math.hypot(math.sin(ky), math.sin(kx)) * ((1.0 / th) + (th * 0.16666666666666666))) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(kx), ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.062) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), sin(kx)) * Float64(Float64(1.0 / th) + Float64(th * 0.16666666666666666)))); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(kx), ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.062) tmp = sin(ky) / (hypot(sin(ky), sin(kx)) * ((1.0 / th) + (th * 0.16666666666666666))); else tmp = (ky * sin(th)) / hypot(sin(kx), ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.062], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] * N[(N[(1.0 / th), $MachinePrecision] + N[(th * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.062:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right) \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if th < 0.062Initial program 95.0%
remove-double-neg95.0%
sin-neg95.0%
neg-mul-195.0%
*-commutative95.0%
associate-*l*95.0%
associate-*l/94.3%
associate-/r/94.3%
associate-*l/95.0%
associate-/r/95.0%
sin-neg95.0%
neg-mul-195.0%
associate-/r*95.0%
associate-/r/95.0%
Simplified99.7%
associate-*l/97.6%
associate-/l*99.7%
hypot-udef95.0%
unpow295.0%
unpow295.0%
+-commutative95.0%
unpow295.0%
unpow295.0%
hypot-def99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 65.5%
+-commutative65.5%
+-commutative65.5%
unpow265.5%
unpow265.5%
hypot-def67.6%
associate-*r*67.6%
+-commutative67.6%
unpow267.6%
unpow267.6%
hypot-def67.7%
distribute-rgt-out67.6%
Simplified67.6%
if 0.062 < th Initial program 89.3%
remove-double-neg89.3%
sin-neg89.3%
neg-mul-189.3%
*-commutative89.3%
associate-*l*89.3%
associate-*l/89.3%
associate-/r/89.3%
associate-*l/89.3%
associate-/r/89.2%
sin-neg89.2%
neg-mul-189.2%
associate-/r*89.2%
associate-/r/89.3%
Simplified99.6%
associate-*l/99.5%
hypot-udef89.3%
unpow289.3%
unpow289.3%
+-commutative89.3%
unpow289.3%
unpow289.3%
hypot-def99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 48.0%
Taylor expanded in ky around 0 61.9%
Final simplification66.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-252) (* (sin ky) (/ (sin th) (sin kx))) (/ (* ky (sin th)) (hypot (sin kx) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-252) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else {
tmp = (ky * sin(th)) / hypot(sin(kx), ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 5e-252) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(kx), ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 5e-252: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(kx), ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-252) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(kx), ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 5e-252) tmp = sin(ky) * (sin(th) / sin(kx)); else tmp = (ky * sin(th)) / hypot(sin(kx), ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-252], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-252}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if (sin.f64 ky) < 5.00000000000000008e-252Initial program 94.3%
Taylor expanded in ky around 0 24.0%
Taylor expanded in ky around inf 23.4%
*-commutative23.4%
associate-*l/24.0%
Simplified24.0%
if 5.00000000000000008e-252 < (sin.f64 ky) Initial program 93.1%
remove-double-neg93.1%
sin-neg93.1%
neg-mul-193.1%
*-commutative93.1%
associate-*l*93.1%
associate-*l/92.9%
associate-/r/92.9%
associate-*l/93.1%
associate-/r/93.0%
sin-neg93.0%
neg-mul-193.0%
associate-/r*93.0%
associate-/r/93.1%
Simplified99.7%
associate-*l/99.6%
hypot-udef92.9%
unpow292.9%
unpow292.9%
+-commutative92.9%
unpow292.9%
unpow292.9%
hypot-def99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 43.5%
Taylor expanded in ky around 0 57.2%
Final simplification39.2%
(FPCore (kx ky th) :precision binary64 (if (<= th 8.2e-6) (/ (sin ky) (/ (hypot (sin ky) (sin kx)) th)) (/ (* ky (sin th)) (hypot (sin kx) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 8.2e-6) {
tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th);
} else {
tmp = (ky * sin(th)) / hypot(sin(kx), ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 8.2e-6) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / th);
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(kx), ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 8.2e-6: tmp = math.sin(ky) / (math.hypot(math.sin(ky), math.sin(kx)) / th) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(kx), ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 8.2e-6) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), sin(kx)) / th)); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(kx), ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 8.2e-6) tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th); else tmp = (ky * sin(th)) / hypot(sin(kx), ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 8.2e-6], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if th < 8.1999999999999994e-6Initial program 95.0%
remove-double-neg95.0%
sin-neg95.0%
neg-mul-195.0%
*-commutative95.0%
associate-*l*95.0%
associate-*l/94.2%
associate-/r/94.2%
associate-*l/95.0%
associate-/r/94.9%
sin-neg94.9%
neg-mul-194.9%
associate-/r*94.9%
associate-/r/95.0%
Simplified99.7%
associate-*l/97.6%
associate-/l*99.7%
hypot-udef94.9%
unpow294.9%
unpow294.9%
+-commutative94.9%
unpow294.9%
unpow294.9%
hypot-def99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 64.8%
associate-*l/65.0%
+-commutative65.0%
unpow265.0%
unpow265.0%
hypot-def67.0%
*-lft-identity67.0%
Simplified67.0%
if 8.1999999999999994e-6 < th Initial program 89.7%
remove-double-neg89.7%
sin-neg89.7%
neg-mul-189.7%
*-commutative89.7%
associate-*l*89.7%
associate-*l/89.6%
associate-/r/89.6%
associate-*l/89.7%
associate-/r/89.5%
sin-neg89.5%
neg-mul-189.5%
associate-/r*89.5%
associate-/r/89.7%
Simplified99.5%
associate-*l/99.5%
hypot-udef89.6%
unpow289.6%
unpow289.6%
+-commutative89.6%
unpow289.6%
unpow289.6%
hypot-def99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 46.6%
Taylor expanded in ky around 0 61.5%
Final simplification65.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 8.6e-10) (sin th) (* (sin th) (fabs (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 8.6e-10) {
tmp = sin(th);
} else {
tmp = sin(th) * fabs((ky / sin(kx)));
}
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 (kx <= 8.6d-10) then
tmp = sin(th)
else
tmp = sin(th) * abs((ky / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 8.6e-10) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 8.6e-10: tmp = math.sin(th) else: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 8.6e-10) tmp = sin(th); else tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 8.6e-10) tmp = sin(th); else tmp = sin(th) * abs((ky / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 8.6e-10], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 8.6 \cdot 10^{-10}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 8.60000000000000029e-10Initial program 91.6%
remove-double-neg91.6%
sin-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*l*91.6%
associate-*l/90.8%
associate-/r/90.8%
associate-*l/91.6%
associate-/r/91.5%
sin-neg91.5%
neg-mul-191.5%
associate-/r*91.5%
associate-/r/91.6%
Simplified99.8%
Taylor expanded in kx around 0 32.1%
if 8.60000000000000029e-10 < kx Initial program 99.4%
Taylor expanded in ky around 0 31.1%
add-sqr-sqrt18.4%
sqrt-unprod26.5%
pow226.5%
Applied egg-rr26.5%
unpow226.5%
rem-sqrt-square29.2%
Simplified29.2%
Final simplification31.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1e-9) (sin th) (* (sin th) (/ ky (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1e-9) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / sin(kx));
}
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 (kx <= 1d-9) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1e-9) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1e-9: tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1e-9) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1e-9) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1e-9], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 10^{-9}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.00000000000000006e-9Initial program 91.6%
remove-double-neg91.6%
sin-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*l*91.6%
associate-*l/90.8%
associate-/r/90.8%
associate-*l/91.6%
associate-/r/91.5%
sin-neg91.5%
neg-mul-191.5%
associate-/r*91.5%
associate-/r/91.6%
Simplified99.8%
Taylor expanded in kx around 0 32.1%
if 1.00000000000000006e-9 < kx Initial program 99.4%
Taylor expanded in ky around 0 31.1%
Final simplification31.8%
(FPCore (kx ky th) :precision binary64 (if (or (<= ky 1.25e-170) (and (not (<= ky 4.8e-109)) (<= ky 2.45e-88))) (* (sin th) (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if ((ky <= 1.25e-170) || (!(ky <= 4.8e-109) && (ky <= 2.45e-88))) {
tmp = sin(th) * (ky / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if ((ky <= 1.25d-170) .or. (.not. (ky <= 4.8d-109)) .and. (ky <= 2.45d-88)) then
tmp = sin(th) * (ky / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if ((ky <= 1.25e-170) || (!(ky <= 4.8e-109) && (ky <= 2.45e-88))) {
tmp = Math.sin(th) * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if (ky <= 1.25e-170) or (not (ky <= 4.8e-109) and (ky <= 2.45e-88)): tmp = math.sin(th) * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if ((ky <= 1.25e-170) || (!(ky <= 4.8e-109) && (ky <= 2.45e-88))) tmp = Float64(sin(th) * Float64(ky / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if ((ky <= 1.25e-170) || (~((ky <= 4.8e-109)) && (ky <= 2.45e-88))) tmp = sin(th) * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[Or[LessEqual[ky, 1.25e-170], And[N[Not[LessEqual[ky, 4.8e-109]], $MachinePrecision], LessEqual[ky, 2.45e-88]]], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.25 \cdot 10^{-170} \lor \neg \left(ky \leq 4.8 \cdot 10^{-109}\right) \land ky \leq 2.45 \cdot 10^{-88}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.25000000000000003e-170 or 4.79999999999999977e-109 < ky < 2.45000000000000014e-88Initial program 90.5%
Taylor expanded in ky around 0 24.4%
Taylor expanded in kx around 0 18.3%
if 1.25000000000000003e-170 < ky < 4.79999999999999977e-109 or 2.45000000000000014e-88 < ky Initial program 98.7%
remove-double-neg98.7%
sin-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-*l*98.7%
associate-*l/98.6%
associate-/r/98.6%
associate-*l/98.7%
associate-/r/98.7%
sin-neg98.7%
neg-mul-198.7%
associate-/r*98.7%
associate-/r/98.7%
Simplified99.8%
Taylor expanded in kx around 0 34.4%
Final simplification24.6%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 2.4e-169)
(/ ky (/ kx (sin th)))
(if (or (<= ky 1.15e-113) (not (<= ky 9.2e-89)))
(sin th)
(* (sin th) (/ ky kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.4e-169) {
tmp = ky / (kx / sin(th));
} else if ((ky <= 1.15e-113) || !(ky <= 9.2e-89)) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / kx);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 2.4d-169) then
tmp = ky / (kx / sin(th))
else if ((ky <= 1.15d-113) .or. (.not. (ky <= 9.2d-89))) then
tmp = sin(th)
else
tmp = sin(th) * (ky / kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.4e-169) {
tmp = ky / (kx / Math.sin(th));
} else if ((ky <= 1.15e-113) || !(ky <= 9.2e-89)) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.4e-169: tmp = ky / (kx / math.sin(th)) elif (ky <= 1.15e-113) or not (ky <= 9.2e-89): tmp = math.sin(th) else: tmp = math.sin(th) * (ky / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.4e-169) tmp = Float64(ky / Float64(kx / sin(th))); elseif ((ky <= 1.15e-113) || !(ky <= 9.2e-89)) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.4e-169) tmp = ky / (kx / sin(th)); elseif ((ky <= 1.15e-113) || ~((ky <= 9.2e-89))) tmp = sin(th); else tmp = sin(th) * (ky / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.4e-169], N[(ky / N[(kx / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 1.15e-113], N[Not[LessEqual[ky, 9.2e-89]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.4 \cdot 10^{-169}:\\
\;\;\;\;\frac{ky}{\frac{kx}{\sin th}}\\
\mathbf{elif}\;ky \leq 1.15 \cdot 10^{-113} \lor \neg \left(ky \leq 9.2 \cdot 10^{-89}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\end{array}
\end{array}
if ky < 2.40000000000000011e-169Initial program 90.3%
Taylor expanded in ky around 0 23.0%
Taylor expanded in kx around 0 16.9%
associate-/l*17.5%
Simplified17.5%
if 2.40000000000000011e-169 < ky < 1.15000000000000004e-113 or 9.200000000000001e-89 < ky Initial program 98.7%
remove-double-neg98.7%
sin-neg98.7%
neg-mul-198.7%
*-commutative98.7%
associate-*l*98.7%
associate-*l/98.6%
associate-/r/98.6%
associate-*l/98.7%
associate-/r/98.7%
sin-neg98.7%
neg-mul-198.7%
associate-/r*98.7%
associate-/r/98.7%
Simplified99.8%
Taylor expanded in kx around 0 34.4%
if 1.15000000000000004e-113 < ky < 9.200000000000001e-89Initial program 99.6%
Taylor expanded in ky around 0 75.7%
Taylor expanded in kx around 0 52.7%
Final simplification24.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 2.65e-8) (sin th) (/ ky (/ (sin kx) th))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.65e-8) {
tmp = sin(th);
} else {
tmp = ky / (sin(kx) / 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 (kx <= 2.65d-8) then
tmp = sin(th)
else
tmp = ky / (sin(kx) / th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.65e-8) {
tmp = Math.sin(th);
} else {
tmp = ky / (Math.sin(kx) / th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 2.65e-8: tmp = math.sin(th) else: tmp = ky / (math.sin(kx) / th) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.65e-8) tmp = sin(th); else tmp = Float64(ky / Float64(sin(kx) / th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 2.65e-8) tmp = sin(th); else tmp = ky / (sin(kx) / th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.65e-8], N[Sin[th], $MachinePrecision], N[(ky / N[(N[Sin[kx], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.65 \cdot 10^{-8}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\end{array}
\end{array}
if kx < 2.6499999999999999e-8Initial program 91.6%
remove-double-neg91.6%
sin-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*l*91.6%
associate-*l/90.8%
associate-/r/90.8%
associate-*l/91.6%
associate-/r/91.5%
sin-neg91.5%
neg-mul-191.5%
associate-/r*91.5%
associate-/r/91.6%
Simplified99.8%
Taylor expanded in kx around 0 32.1%
if 2.6499999999999999e-8 < kx Initial program 99.4%
Taylor expanded in ky around 0 31.1%
Taylor expanded in th around 0 23.2%
associate-/l*23.2%
Simplified23.2%
Final simplification29.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.1e-8) (sin th) (/ (* ky th) (sin kx))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.1e-8) {
tmp = sin(th);
} else {
tmp = (ky * th) / sin(kx);
}
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 (kx <= 4.1d-8) then
tmp = sin(th)
else
tmp = (ky * th) / sin(kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.1e-8) {
tmp = Math.sin(th);
} else {
tmp = (ky * th) / Math.sin(kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.1e-8: tmp = math.sin(th) else: tmp = (ky * th) / math.sin(kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.1e-8) tmp = sin(th); else tmp = Float64(Float64(ky * th) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.1e-8) tmp = sin(th); else tmp = (ky * th) / sin(kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.1e-8], N[Sin[th], $MachinePrecision], N[(N[(ky * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.1 \cdot 10^{-8}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot th}{\sin kx}\\
\end{array}
\end{array}
if kx < 4.10000000000000032e-8Initial program 91.6%
remove-double-neg91.6%
sin-neg91.6%
neg-mul-191.6%
*-commutative91.6%
associate-*l*91.6%
associate-*l/90.8%
associate-/r/90.8%
associate-*l/91.6%
associate-/r/91.5%
sin-neg91.5%
neg-mul-191.5%
associate-/r*91.5%
associate-/r/91.6%
Simplified99.8%
Taylor expanded in kx around 0 32.1%
if 4.10000000000000032e-8 < kx Initial program 99.4%
Taylor expanded in ky around 0 31.1%
Taylor expanded in th around 0 23.2%
*-commutative23.2%
Simplified23.2%
Final simplification29.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 8.2e-213) (/ ky (/ kx th)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8.2e-213) {
tmp = ky / (kx / th);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 8.2d-213) then
tmp = ky / (kx / th)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8.2e-213) {
tmp = ky / (kx / th);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 8.2e-213: tmp = ky / (kx / th) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 8.2e-213) tmp = Float64(ky / Float64(kx / th)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 8.2e-213) tmp = ky / (kx / th); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 8.2e-213], N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 8.2 \cdot 10^{-213}:\\
\;\;\;\;\frac{ky}{\frac{kx}{th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 8.19999999999999949e-213Initial program 93.0%
Taylor expanded in ky around 0 21.7%
Taylor expanded in kx around 0 16.3%
Taylor expanded in th around 0 13.6%
associate-/l*14.3%
Simplified14.3%
if 8.19999999999999949e-213 < ky Initial program 94.6%
remove-double-neg94.6%
sin-neg94.6%
neg-mul-194.6%
*-commutative94.6%
associate-*l*94.6%
associate-*l/94.5%
associate-/r/94.5%
associate-*l/94.6%
associate-/r/94.5%
sin-neg94.5%
neg-mul-194.5%
associate-/r*94.5%
associate-/r/94.6%
Simplified99.7%
Taylor expanded in kx around 0 33.4%
Final simplification22.8%
(FPCore (kx ky th) :precision binary64 (/ ky (/ kx th)))
double code(double kx, double ky, double th) {
return ky / (kx / th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = ky / (kx / th)
end function
public static double code(double kx, double ky, double th) {
return ky / (kx / th);
}
def code(kx, ky, th): return ky / (kx / th)
function code(kx, ky, th) return Float64(ky / Float64(kx / th)) end
function tmp = code(kx, ky, th) tmp = ky / (kx / th); end
code[kx_, ky_, th_] := N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{ky}{\frac{kx}{th}}
\end{array}
Initial program 93.7%
Taylor expanded in ky around 0 19.2%
Taylor expanded in kx around 0 13.9%
Taylor expanded in th around 0 10.9%
associate-/l*11.3%
Simplified11.3%
Final simplification11.3%
herbie shell --seed 2023333
(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)))