
(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 19 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 th) (/ (hypot (sin ky) (sin kx)) (sin ky))))
double code(double kx, double ky, double th) {
return sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
def code(kx, ky, th): return math.sin(th) / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky))
function code(kx, ky, th) return Float64(sin(th) / Float64(hypot(sin(ky), sin(kx)) / sin(ky))) end
function tmp = code(kx, ky, th) tmp = sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky)); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\end{array}
Initial program 93.4%
+-commutative93.4%
unpow293.4%
unpow293.4%
hypot-def99.6%
Simplified99.6%
associate-*l/94.8%
associate-*r/99.5%
expm1-log1p-u99.5%
expm1-udef40.9%
Applied egg-rr40.9%
expm1-def99.5%
expm1-log1p99.5%
*-commutative99.5%
associate-/r/99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -1e-49)
(fabs (sin th))
(if (<= (sin ky) -1e-304)
(/ (sin ky) (/ (sin kx) (sin th)))
(if (<= (sin ky) 2e-57)
(* (sin th) (fabs (/ (sin ky) (sin kx))))
(/ (* (sin th) (sin ky)) (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -1e-49) {
tmp = fabs(sin(th));
} else if (sin(ky) <= -1e-304) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else if (sin(ky) <= 2e-57) {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
} else {
tmp = (sin(th) * sin(ky)) / sin(ky);
}
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) <= (-1d-49)) then
tmp = abs(sin(th))
else if (sin(ky) <= (-1d-304)) then
tmp = sin(ky) / (sin(kx) / sin(th))
else if (sin(ky) <= 2d-57) then
tmp = sin(th) * abs((sin(ky) / sin(kx)))
else
tmp = (sin(th) * sin(ky)) / sin(ky)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -1e-49) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= -1e-304) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else if (Math.sin(ky) <= 2e-57) {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
} else {
tmp = (Math.sin(th) * Math.sin(ky)) / Math.sin(ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -1e-49: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= -1e-304: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) elif math.sin(ky) <= 2e-57: tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) else: tmp = (math.sin(th) * math.sin(ky)) / math.sin(ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= -1e-304) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); elseif (sin(ky) <= 2e-57) tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); else tmp = Float64(Float64(sin(th) * sin(ky)) / sin(ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= -1e-304) tmp = sin(ky) / (sin(kx) / sin(th)); elseif (sin(ky) <= 2e-57) tmp = sin(th) * abs((sin(ky) / sin(kx))); else tmp = (sin(th) * sin(ky)) / sin(ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -1e-49], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], -1e-304], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-57], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[th], $MachinePrecision] * N[Sin[ky], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-49}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -1 \cdot 10^{-304}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot \sin ky}{\sin ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -9.99999999999999936e-50Initial program 99.5%
associate-*l/99.7%
associate-*r/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.3%
sqrt-unprod28.2%
pow228.2%
clear-num28.1%
un-div-inv28.2%
Applied egg-rr28.2%
unpow228.2%
rem-sqrt-square32.6%
associate-/r/32.7%
*-inverses32.7%
*-lft-identity32.7%
Simplified32.7%
if -9.99999999999999936e-50 < (sin.f64 ky) < -9.99999999999999971e-305Initial program 87.0%
associate-/r/87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 44.3%
if -9.99999999999999971e-305 < (sin.f64 ky) < 1.99999999999999991e-57Initial program 87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 44.6%
add-sqr-sqrt37.0%
sqrt-unprod51.7%
pow251.7%
Applied egg-rr51.7%
unpow251.7%
rem-sqrt-square78.9%
Simplified78.9%
if 1.99999999999999991e-57 < (sin.f64 ky) Initial program 99.6%
associate-*l/99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-def99.4%
Simplified99.4%
Taylor expanded in kx around 0 56.7%
Final simplification52.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin th) -0.004)
(/ (sin ky) (/ (sin kx) (sin th)))
(if (<= (sin th) 1e-7)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(* (sin ky) (fabs (/ (sin th) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(th) <= -0.004) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else if (sin(th) <= 1e-7) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * fabs((sin(th) / sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(th) <= -0.004) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else if (Math.sin(th) <= 1e-7) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(th) <= -0.004: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) elif math.sin(th) <= 1e-7: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(th) <= -0.004) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); elseif (sin(th) <= 1e-7) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(th) <= -0.004) tmp = sin(ky) / (sin(kx) / sin(th)); elseif (sin(th) <= 1e-7) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * abs((sin(th) / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[th], $MachinePrecision], -0.004], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 1e-7], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin th \leq -0.004:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{elif}\;\sin th \leq 10^{-7}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin kx}\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.0040000000000000001Initial program 92.0%
associate-/r/92.0%
+-commutative92.0%
unpow292.0%
unpow292.0%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 23.3%
if -0.0040000000000000001 < (sin.f64 th) < 9.9999999999999995e-8Initial program 94.0%
associate-*l/87.5%
+-commutative87.5%
unpow287.5%
unpow287.5%
hypot-def89.4%
Simplified89.4%
Taylor expanded in th around 0 89.3%
expm1-log1p-u89.3%
expm1-udef19.5%
div-inv19.5%
*-commutative19.5%
associate-*l*19.5%
div-inv19.5%
Applied egg-rr19.5%
expm1-def99.6%
expm1-log1p99.6%
*-commutative99.6%
associate-*l/89.3%
associate-*r/99.6%
Simplified99.6%
if 9.9999999999999995e-8 < (sin.f64 th) Initial program 94.1%
associate-*l/94.2%
associate-*r/94.1%
+-commutative94.1%
unpow294.1%
unpow294.1%
hypot-def99.4%
Simplified99.4%
Taylor expanded in ky around 0 27.2%
add-sqr-sqrt25.5%
sqrt-unprod54.4%
pow254.4%
Applied egg-rr54.4%
unpow254.4%
rem-sqrt-square59.9%
Simplified59.9%
Final simplification66.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -1e-49)
(fabs (sin th))
(if (<= (sin ky) 2e-154)
(/ (sin th) (/ (sin kx) ky))
(/ (* (sin th) (sin ky)) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -1e-49) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-154) {
tmp = sin(th) / (sin(kx) / ky);
} else {
tmp = (sin(th) * sin(ky)) / sin(ky);
}
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) <= (-1d-49)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-154) then
tmp = sin(th) / (sin(kx) / ky)
else
tmp = (sin(th) * sin(ky)) / sin(ky)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -1e-49) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-154) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = (Math.sin(th) * Math.sin(ky)) / Math.sin(ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -1e-49: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-154: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = (math.sin(th) * math.sin(ky)) / math.sin(ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) tmp = Float64(sin(th) / Float64(sin(kx) / ky)); else tmp = Float64(Float64(sin(th) * sin(ky)) / sin(ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) tmp = sin(th) / (sin(kx) / ky); else tmp = (sin(th) * sin(ky)) / sin(ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -1e-49], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-154], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[th], $MachinePrecision] * N[Sin[ky], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-49}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-154}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th \cdot \sin ky}{\sin ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -9.99999999999999936e-50Initial program 99.5%
associate-*l/99.7%
associate-*r/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.3%
sqrt-unprod28.2%
pow228.2%
clear-num28.1%
un-div-inv28.2%
Applied egg-rr28.2%
unpow228.2%
rem-sqrt-square32.6%
associate-/r/32.7%
*-inverses32.7%
*-lft-identity32.7%
Simplified32.7%
if -9.99999999999999936e-50 < (sin.f64 ky) < 1.9999999999999999e-154Initial program 85.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 44.1%
associate-/l*45.6%
Simplified45.6%
if 1.9999999999999999e-154 < (sin.f64 ky) Initial program 99.6%
associate-*l/98.3%
+-commutative98.3%
unpow298.3%
unpow298.3%
hypot-def98.3%
Simplified98.3%
Taylor expanded in kx around 0 54.1%
Final simplification45.2%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.4%
associate-*l/90.4%
associate-*r/93.4%
+-commutative93.4%
unpow293.4%
unpow293.4%
hypot-def99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (kx ky th) :precision binary64 (* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(th) * (sin(ky) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(th) * (sin(ky) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.4%
+-commutative93.4%
unpow293.4%
unpow293.4%
hypot-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (or (<= ky -3000000000000.0) (not (<= ky 0.025)))
(* (sin ky) (/ th t_1))
(* (sin th) (/ ky t_1)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if ((ky <= -3000000000000.0) || !(ky <= 0.025)) {
tmp = sin(ky) * (th / t_1);
} else {
tmp = sin(th) * (ky / t_1);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if ((ky <= -3000000000000.0) || !(ky <= 0.025)) {
tmp = Math.sin(ky) * (th / t_1);
} else {
tmp = Math.sin(th) * (ky / t_1);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if (ky <= -3000000000000.0) or not (ky <= 0.025): tmp = math.sin(ky) * (th / t_1) else: tmp = math.sin(th) * (ky / t_1) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if ((ky <= -3000000000000.0) || !(ky <= 0.025)) tmp = Float64(sin(ky) * Float64(th / t_1)); else tmp = Float64(sin(th) * Float64(ky / t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if ((ky <= -3000000000000.0) || ~((ky <= 0.025))) tmp = sin(ky) * (th / t_1); else tmp = sin(th) * (ky / t_1); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[Or[LessEqual[ky, -3000000000000.0], N[Not[LessEqual[ky, 0.025]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] * N[(th / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq -3000000000000 \lor \neg \left(ky \leq 0.025\right):\\
\;\;\;\;\sin ky \cdot \frac{th}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\end{array}
\end{array}
if ky < -3e12 or 0.025000000000000001 < ky Initial program 99.6%
associate-*l/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in th around 0 55.9%
expm1-log1p-u55.1%
expm1-udef5.7%
div-inv5.7%
*-commutative5.7%
associate-*l*5.7%
div-inv5.7%
Applied egg-rr5.7%
expm1-def55.2%
expm1-log1p56.0%
*-commutative56.0%
associate-*l/55.9%
associate-*r/56.0%
Simplified56.0%
if -3e12 < ky < 0.025000000000000001Initial program 88.8%
associate-/r/88.8%
+-commutative88.8%
unpow288.8%
unpow288.8%
hypot-def99.6%
Simplified99.6%
associate-/l*91.3%
clear-num90.8%
associate-/r/91.2%
Applied egg-rr91.2%
Taylor expanded in ky around 0 89.1%
expm1-log1p-u89.0%
expm1-udef32.6%
associate-*l/32.6%
*-un-lft-identity32.6%
*-un-lft-identity32.6%
times-frac32.6%
/-rgt-identity32.6%
Applied egg-rr32.6%
expm1-def97.3%
expm1-log1p97.5%
Simplified97.5%
Final simplification79.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (or (<= ky -3000000000000.0) (not (<= ky 0.0148)))
(* th (/ (sin ky) t_1))
(* (sin th) (/ ky t_1)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if ((ky <= -3000000000000.0) || !(ky <= 0.0148)) {
tmp = th * (sin(ky) / t_1);
} else {
tmp = sin(th) * (ky / t_1);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if ((ky <= -3000000000000.0) || !(ky <= 0.0148)) {
tmp = th * (Math.sin(ky) / t_1);
} else {
tmp = Math.sin(th) * (ky / t_1);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if (ky <= -3000000000000.0) or not (ky <= 0.0148): tmp = th * (math.sin(ky) / t_1) else: tmp = math.sin(th) * (ky / t_1) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if ((ky <= -3000000000000.0) || !(ky <= 0.0148)) tmp = Float64(th * Float64(sin(ky) / t_1)); else tmp = Float64(sin(th) * Float64(ky / t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if ((ky <= -3000000000000.0) || ~((ky <= 0.0148))) tmp = th * (sin(ky) / t_1); else tmp = sin(th) * (ky / t_1); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[Or[LessEqual[ky, -3000000000000.0], N[Not[LessEqual[ky, 0.0148]], $MachinePrecision]], N[(th * N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq -3000000000000 \lor \neg \left(ky \leq 0.0148\right):\\
\;\;\;\;th \cdot \frac{\sin ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\end{array}
\end{array}
if ky < -3e12 or 0.014800000000000001 < ky Initial program 99.6%
associate-*l/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in th around 0 55.9%
associate-/l*56.0%
associate-/r/56.0%
Applied egg-rr56.0%
if -3e12 < ky < 0.014800000000000001Initial program 88.8%
associate-/r/88.8%
+-commutative88.8%
unpow288.8%
unpow288.8%
hypot-def99.6%
Simplified99.6%
associate-/l*91.3%
clear-num90.8%
associate-/r/91.2%
Applied egg-rr91.2%
Taylor expanded in ky around 0 89.1%
expm1-log1p-u89.0%
expm1-udef32.6%
associate-*l/32.6%
*-un-lft-identity32.6%
*-un-lft-identity32.6%
times-frac32.6%
/-rgt-identity32.6%
Applied egg-rr32.6%
expm1-def97.3%
expm1-log1p97.5%
Simplified97.5%
Final simplification79.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= ky -3000000000000.0)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(if (<= ky 0.0077) (* (sin th) (/ ky t_1)) (* th (/ (sin ky) t_1))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (ky <= -3000000000000.0) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else if (ky <= 0.0077) {
tmp = sin(th) * (ky / t_1);
} else {
tmp = th * (sin(ky) / t_1);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (ky <= -3000000000000.0) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else if (ky <= 0.0077) {
tmp = Math.sin(th) * (ky / t_1);
} else {
tmp = th * (Math.sin(ky) / t_1);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if ky <= -3000000000000.0: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) elif ky <= 0.0077: tmp = math.sin(th) * (ky / t_1) else: tmp = th * (math.sin(ky) / t_1) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (ky <= -3000000000000.0) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); elseif (ky <= 0.0077) tmp = Float64(sin(th) * Float64(ky / t_1)); else tmp = Float64(th * Float64(sin(ky) / t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (ky <= -3000000000000.0) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); elseif (ky <= 0.0077) tmp = sin(th) * (ky / t_1); else tmp = th * (sin(ky) / t_1); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[ky, -3000000000000.0], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 0.0077], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision], N[(th * N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq -3000000000000:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{elif}\;ky \leq 0.0077:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;th \cdot \frac{\sin ky}{t_1}\\
\end{array}
\end{array}
if ky < -3e12Initial program 99.5%
associate-/r/99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.5%
Simplified99.5%
Taylor expanded in th around 0 54.7%
associate-*r/54.9%
unpow254.9%
unpow254.9%
hypot-def54.9%
*-rgt-identity54.9%
hypot-def54.9%
unpow254.9%
unpow254.9%
+-commutative54.9%
unpow254.9%
unpow254.9%
hypot-def54.9%
Simplified54.9%
if -3e12 < ky < 0.0077000000000000002Initial program 88.8%
associate-/r/88.8%
+-commutative88.8%
unpow288.8%
unpow288.8%
hypot-def99.6%
Simplified99.6%
associate-/l*91.3%
clear-num90.8%
associate-/r/91.2%
Applied egg-rr91.2%
Taylor expanded in ky around 0 89.1%
expm1-log1p-u89.0%
expm1-udef32.6%
associate-*l/32.6%
*-un-lft-identity32.6%
*-un-lft-identity32.6%
times-frac32.6%
/-rgt-identity32.6%
Applied egg-rr32.6%
expm1-def97.3%
expm1-log1p97.5%
Simplified97.5%
if 0.0077000000000000002 < ky Initial program 99.6%
associate-*l/99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.5%
Simplified99.5%
Taylor expanded in th around 0 57.0%
associate-/l*57.1%
associate-/r/57.2%
Applied egg-rr57.2%
Final simplification79.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -1e-49) (fabs (sin th)) (if (<= (sin ky) 2e-154) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -1e-49) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-154) {
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) <= (-1d-49)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-154) 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) <= -1e-49) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-154) {
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) <= -1e-49: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-154: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) 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) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -1e-49], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-154], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-49}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-154}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -9.99999999999999936e-50Initial program 99.5%
associate-*l/99.7%
associate-*r/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.3%
sqrt-unprod28.2%
pow228.2%
clear-num28.1%
un-div-inv28.2%
Applied egg-rr28.2%
unpow228.2%
rem-sqrt-square32.6%
associate-/r/32.7%
*-inverses32.7%
*-lft-identity32.7%
Simplified32.7%
if -9.99999999999999936e-50 < (sin.f64 ky) < 1.9999999999999999e-154Initial program 85.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 45.5%
if 1.9999999999999999e-154 < (sin.f64 ky) Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 53.1%
Final simplification44.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -1e-49) (fabs (sin th)) (if (<= (sin ky) 2e-154) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -1e-49) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-154) {
tmp = sin(th) / (sin(kx) / ky);
} 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) <= (-1d-49)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-154) then
tmp = sin(th) / (sin(kx) / ky)
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) <= -1e-49) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-154) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -1e-49: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-154: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) tmp = Float64(sin(th) / Float64(sin(kx) / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -1e-49) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-154) tmp = sin(th) / (sin(kx) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -1e-49], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-154], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -1 \cdot 10^{-49}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-154}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -9.99999999999999936e-50Initial program 99.5%
associate-*l/99.7%
associate-*r/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.3%
sqrt-unprod28.2%
pow228.2%
clear-num28.1%
un-div-inv28.2%
Applied egg-rr28.2%
unpow228.2%
rem-sqrt-square32.6%
associate-/r/32.7%
*-inverses32.7%
*-lft-identity32.7%
Simplified32.7%
if -9.99999999999999936e-50 < (sin.f64 ky) < 1.9999999999999999e-154Initial program 85.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 44.1%
associate-/l*45.6%
Simplified45.6%
if 1.9999999999999999e-154 < (sin.f64 ky) Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 53.1%
Final simplification44.9%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (fabs (sin th))))
(if (<= ky -2e-158)
t_1
(if (<= ky 3.6e-152)
(* (+ (* kx 0.16666666666666666) (/ 1.0 kx)) (* (sin th) ky))
(if (<= ky 22000.0) (sin th) (if (<= ky 2.35e+272) t_1 (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = fabs(sin(th));
double tmp;
if (ky <= -2e-158) {
tmp = t_1;
} else if (ky <= 3.6e-152) {
tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (sin(th) * ky);
} else if (ky <= 22000.0) {
tmp = sin(th);
} else if (ky <= 2.35e+272) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = abs(sin(th))
if (ky <= (-2d-158)) then
tmp = t_1
else if (ky <= 3.6d-152) then
tmp = ((kx * 0.16666666666666666d0) + (1.0d0 / kx)) * (sin(th) * ky)
else if (ky <= 22000.0d0) then
tmp = sin(th)
else if (ky <= 2.35d+272) then
tmp = t_1
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.abs(Math.sin(th));
double tmp;
if (ky <= -2e-158) {
tmp = t_1;
} else if (ky <= 3.6e-152) {
tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (Math.sin(th) * ky);
} else if (ky <= 22000.0) {
tmp = Math.sin(th);
} else if (ky <= 2.35e+272) {
tmp = t_1;
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.fabs(math.sin(th)) tmp = 0 if ky <= -2e-158: tmp = t_1 elif ky <= 3.6e-152: tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (math.sin(th) * ky) elif ky <= 22000.0: tmp = math.sin(th) elif ky <= 2.35e+272: tmp = t_1 else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = abs(sin(th)) tmp = 0.0 if (ky <= -2e-158) tmp = t_1; elseif (ky <= 3.6e-152) tmp = Float64(Float64(Float64(kx * 0.16666666666666666) + Float64(1.0 / kx)) * Float64(sin(th) * ky)); elseif (ky <= 22000.0) tmp = sin(th); elseif (ky <= 2.35e+272) tmp = t_1; else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = abs(sin(th)); tmp = 0.0; if (ky <= -2e-158) tmp = t_1; elseif (ky <= 3.6e-152) tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (sin(th) * ky); elseif (ky <= 22000.0) tmp = sin(th); elseif (ky <= 2.35e+272) tmp = t_1; else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ky, -2e-158], t$95$1, If[LessEqual[ky, 3.6e-152], N[(N[(N[(kx * 0.16666666666666666), $MachinePrecision] + N[(1.0 / kx), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 22000.0], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 2.35e+272], t$95$1, N[Sin[th], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin th\right|\\
\mathbf{if}\;ky \leq -2 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;ky \leq 3.6 \cdot 10^{-152}:\\
\;\;\;\;\left(kx \cdot 0.16666666666666666 + \frac{1}{kx}\right) \cdot \left(\sin th \cdot ky\right)\\
\mathbf{elif}\;ky \leq 22000:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 2.35 \cdot 10^{+272}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < -2.00000000000000013e-158 or 22000 < ky < 2.35e272Initial program 99.3%
associate-*l/97.9%
associate-*r/99.2%
+-commutative99.2%
unpow299.2%
unpow299.2%
hypot-def99.5%
Simplified99.5%
Taylor expanded in kx around 0 18.3%
add-sqr-sqrt6.8%
sqrt-unprod24.3%
pow224.3%
clear-num24.3%
un-div-inv24.3%
Applied egg-rr24.3%
unpow224.3%
rem-sqrt-square28.0%
associate-/r/28.0%
*-inverses28.0%
*-lft-identity28.0%
Simplified28.0%
if -2.00000000000000013e-158 < ky < 3.6e-152Initial program 79.6%
+-commutative79.6%
unpow279.6%
unpow279.6%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 50.2%
Taylor expanded in kx around 0 22.0%
Taylor expanded in ky around 0 27.2%
if 3.6e-152 < ky < 22000 or 2.35e272 < ky Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 54.9%
Final simplification31.9%
(FPCore (kx ky th)
:precision binary64
(if (<= ky -180.0)
(sin th)
(if (<= ky 4.7e-151)
(* (+ (* kx 0.16666666666666666) (/ 1.0 kx)) (* (sin th) ky))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -180.0) {
tmp = sin(th);
} else if (ky <= 4.7e-151) {
tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (sin(th) * ky);
} 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 <= (-180.0d0)) then
tmp = sin(th)
else if (ky <= 4.7d-151) then
tmp = ((kx * 0.16666666666666666d0) + (1.0d0 / kx)) * (sin(th) * ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -180.0) {
tmp = Math.sin(th);
} else if (ky <= 4.7e-151) {
tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (Math.sin(th) * ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -180.0: tmp = math.sin(th) elif ky <= 4.7e-151: tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (math.sin(th) * ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -180.0) tmp = sin(th); elseif (ky <= 4.7e-151) tmp = Float64(Float64(Float64(kx * 0.16666666666666666) + Float64(1.0 / kx)) * Float64(sin(th) * ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -180.0) tmp = sin(th); elseif (ky <= 4.7e-151) tmp = ((kx * 0.16666666666666666) + (1.0 / kx)) * (sin(th) * ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -180.0], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 4.7e-151], N[(N[(N[(kx * 0.16666666666666666), $MachinePrecision] + N[(1.0 / kx), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -180:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.7 \cdot 10^{-151}:\\
\;\;\;\;\left(kx \cdot 0.16666666666666666 + \frac{1}{kx}\right) \cdot \left(\sin th \cdot ky\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < -180 or 4.70000000000000029e-151 < ky Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 32.7%
if -180 < ky < 4.70000000000000029e-151Initial program 85.8%
+-commutative85.8%
unpow285.8%
unpow285.8%
hypot-def99.5%
Simplified99.5%
Taylor expanded in ky around 0 44.5%
Taylor expanded in kx around 0 18.2%
Taylor expanded in ky around 0 22.6%
Final simplification28.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky -1.65e-49) (sin th) (if (<= ky 4.6e-248) (* ky (/ th (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = sin(th);
} else if (ky <= 4.6e-248) {
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 (ky <= (-1.65d-49)) then
tmp = sin(th)
else if (ky <= 4.6d-248) 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 (ky <= -1.65e-49) {
tmp = Math.sin(th);
} else if (ky <= 4.6e-248) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -1.65e-49: tmp = math.sin(th) elif ky <= 4.6e-248: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -1.65e-49) tmp = sin(th); elseif (ky <= 4.6e-248) 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 (ky <= -1.65e-49) tmp = sin(th); elseif (ky <= 4.6e-248) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -1.65e-49], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 4.6e-248], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -1.65 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.6 \cdot 10^{-248}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < -1.65e-49 or 4.6e-248 < ky Initial program 96.7%
+-commutative96.7%
unpow296.7%
unpow296.7%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 30.6%
if -1.65e-49 < ky < 4.6e-248Initial program 86.9%
associate-*l/80.3%
+-commutative80.3%
unpow280.3%
unpow280.3%
hypot-def88.8%
Simplified88.8%
Taylor expanded in th around 0 31.0%
Taylor expanded in ky around 0 22.0%
associate-/l*23.9%
Simplified23.9%
Taylor expanded in ky around 0 22.0%
associate-*r/23.8%
Simplified23.8%
Final simplification28.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky -1.65e-49) (sin th) (if (<= ky 4.6e-248) (* th (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = sin(th);
} else if (ky <= 4.6e-248) {
tmp = th * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= (-1.65d-49)) then
tmp = sin(th)
else if (ky <= 4.6d-248) then
tmp = th * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = Math.sin(th);
} else if (ky <= 4.6e-248) {
tmp = th * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -1.65e-49: tmp = math.sin(th) elif ky <= 4.6e-248: tmp = th * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -1.65e-49) tmp = sin(th); elseif (ky <= 4.6e-248) tmp = Float64(th * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -1.65e-49) tmp = sin(th); elseif (ky <= 4.6e-248) tmp = th * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -1.65e-49], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 4.6e-248], N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -1.65 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.6 \cdot 10^{-248}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < -1.65e-49 or 4.6e-248 < ky Initial program 96.7%
+-commutative96.7%
unpow296.7%
unpow296.7%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 30.6%
if -1.65e-49 < ky < 4.6e-248Initial program 86.9%
associate-*l/80.3%
+-commutative80.3%
unpow280.3%
unpow280.3%
hypot-def88.8%
Simplified88.8%
Taylor expanded in th around 0 31.0%
Taylor expanded in ky around 0 22.0%
associate-/l*23.9%
Simplified23.9%
associate-/r/24.0%
Applied egg-rr24.0%
Final simplification28.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky -4.2e-19) (sin th) (if (<= ky 3.4e-248) (/ th (/ kx ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -4.2e-19) {
tmp = sin(th);
} else if (ky <= 3.4e-248) {
tmp = th / (kx / ky);
} 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 <= (-4.2d-19)) then
tmp = sin(th)
else if (ky <= 3.4d-248) then
tmp = th / (kx / ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -4.2e-19) {
tmp = Math.sin(th);
} else if (ky <= 3.4e-248) {
tmp = th / (kx / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -4.2e-19: tmp = math.sin(th) elif ky <= 3.4e-248: tmp = th / (kx / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -4.2e-19) tmp = sin(th); elseif (ky <= 3.4e-248) tmp = Float64(th / Float64(kx / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -4.2e-19) tmp = sin(th); elseif (ky <= 3.4e-248) tmp = th / (kx / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -4.2e-19], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 3.4e-248], N[(th / N[(kx / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -4.2 \cdot 10^{-19}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 3.4 \cdot 10^{-248}:\\
\;\;\;\;\frac{th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < -4.1999999999999998e-19 or 3.3999999999999998e-248 < ky Initial program 96.6%
+-commutative96.6%
unpow296.6%
unpow296.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 31.2%
if -4.1999999999999998e-19 < ky < 3.3999999999999998e-248Initial program 87.4%
associate-*l/80.9%
+-commutative80.9%
unpow280.9%
unpow280.9%
hypot-def89.2%
Simplified89.2%
Taylor expanded in th around 0 31.1%
Taylor expanded in ky around 0 22.5%
associate-/l*24.3%
Simplified24.3%
Taylor expanded in kx around 0 17.4%
associate-/l*19.5%
Simplified19.5%
Final simplification27.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky -1.65e-49) th (if (<= ky 1.06e-81) (* th (/ ky kx)) th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = th;
} else if (ky <= 1.06e-81) {
tmp = th * (ky / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= (-1.65d-49)) then
tmp = th
else if (ky <= 1.06d-81) then
tmp = th * (ky / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = th;
} else if (ky <= 1.06e-81) {
tmp = th * (ky / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -1.65e-49: tmp = th elif ky <= 1.06e-81: tmp = th * (ky / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -1.65e-49) tmp = th; elseif (ky <= 1.06e-81) tmp = Float64(th * Float64(ky / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -1.65e-49) tmp = th; elseif (ky <= 1.06e-81) tmp = th * (ky / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -1.65e-49], th, If[LessEqual[ky, 1.06e-81], N[(th * N[(ky / kx), $MachinePrecision]), $MachinePrecision], th]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -1.65 \cdot 10^{-49}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.06 \cdot 10^{-81}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < -1.65e-49 or 1.05999999999999991e-81 < ky Initial program 99.5%
associate-*l/98.8%
+-commutative98.8%
unpow298.8%
unpow298.8%
hypot-def98.8%
Simplified98.8%
Taylor expanded in th around 0 53.6%
Taylor expanded in kx around 0 19.9%
if -1.65e-49 < ky < 1.05999999999999991e-81Initial program 86.6%
associate-*l/81.2%
+-commutative81.2%
unpow281.2%
unpow281.2%
hypot-def90.5%
Simplified90.5%
Taylor expanded in th around 0 32.5%
Taylor expanded in ky around 0 22.3%
associate-/l*23.6%
Simplified23.6%
Taylor expanded in kx around 0 18.8%
*-commutative18.8%
associate-/l*20.1%
Simplified20.1%
associate-/r/20.2%
Applied egg-rr20.2%
Final simplification20.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky -1.65e-49) th (if (<= ky 1.9e-79) (/ th (/ kx ky)) th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = th;
} else if (ky <= 1.9e-79) {
tmp = th / (kx / ky);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= (-1.65d-49)) then
tmp = th
else if (ky <= 1.9d-79) then
tmp = th / (kx / ky)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -1.65e-49) {
tmp = th;
} else if (ky <= 1.9e-79) {
tmp = th / (kx / ky);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -1.65e-49: tmp = th elif ky <= 1.9e-79: tmp = th / (kx / ky) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -1.65e-49) tmp = th; elseif (ky <= 1.9e-79) tmp = Float64(th / Float64(kx / ky)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -1.65e-49) tmp = th; elseif (ky <= 1.9e-79) tmp = th / (kx / ky); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -1.65e-49], th, If[LessEqual[ky, 1.9e-79], N[(th / N[(kx / ky), $MachinePrecision]), $MachinePrecision], th]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -1.65 \cdot 10^{-49}:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 1.9 \cdot 10^{-79}:\\
\;\;\;\;\frac{th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < -1.65e-49 or 1.9000000000000001e-79 < ky Initial program 99.5%
associate-*l/98.8%
+-commutative98.8%
unpow298.8%
unpow298.8%
hypot-def98.8%
Simplified98.8%
Taylor expanded in th around 0 53.6%
Taylor expanded in kx around 0 19.9%
if -1.65e-49 < ky < 1.9000000000000001e-79Initial program 86.6%
associate-*l/81.2%
+-commutative81.2%
unpow281.2%
unpow281.2%
hypot-def90.5%
Simplified90.5%
Taylor expanded in th around 0 32.5%
Taylor expanded in ky around 0 22.3%
associate-/l*23.6%
Simplified23.6%
Taylor expanded in kx around 0 18.8%
associate-/l*20.3%
Simplified20.3%
Final simplification20.1%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.4%
associate-*l/90.4%
+-commutative90.4%
unpow290.4%
unpow290.4%
hypot-def94.8%
Simplified94.8%
Taylor expanded in th around 0 43.6%
Taylor expanded in kx around 0 13.2%
Final simplification13.2%
herbie shell --seed 2023278
(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)))