
(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 95.5%
unpow295.5%
sqr-neg95.5%
sin-neg95.5%
sin-neg95.5%
unpow295.5%
associate-*l/93.8%
associate-/l*95.4%
+-commutative95.4%
unpow295.4%
sin-neg95.4%
sin-neg95.4%
Simplified99.6%
associate-*r/97.6%
hypot-undefine93.8%
unpow293.8%
unpow293.8%
+-commutative93.8%
associate-*l/95.5%
*-commutative95.5%
clear-num95.4%
un-div-inv95.5%
+-commutative95.5%
unpow295.5%
unpow295.5%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(/ (sin ky) (/ (sin ky) (- (sin th))))
(if (<= (sin ky) 5e-135)
(* (sin ky) (/ (sin th) (sin kx)))
(if (<= (sin ky) 1e-37)
(* (sin th) (/ 1.0 (/ (hypot (sin ky) kx) ky)))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = sin(ky) / (sin(ky) / -sin(th));
} else if (sin(ky) <= 5e-135) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if (sin(ky) <= 1e-37) {
tmp = sin(th) * (1.0 / (hypot(sin(ky), kx) / ky));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.05) {
tmp = Math.sin(ky) / (Math.sin(ky) / -Math.sin(th));
} else if (Math.sin(ky) <= 5e-135) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(ky) <= 1e-37) {
tmp = Math.sin(th) * (1.0 / (Math.hypot(Math.sin(ky), kx) / ky));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.05: tmp = math.sin(ky) / (math.sin(ky) / -math.sin(th)) elif math.sin(ky) <= 5e-135: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif math.sin(ky) <= 1e-37: tmp = math.sin(th) * (1.0 / (math.hypot(math.sin(ky), kx) / ky)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.05) tmp = Float64(sin(ky) / Float64(sin(ky) / Float64(-sin(th)))); elseif (sin(ky) <= 5e-135) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif (sin(ky) <= 1e-37) tmp = Float64(sin(th) * Float64(1.0 / Float64(hypot(sin(ky), kx) / ky))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.05) tmp = sin(ky) / (sin(ky) / -sin(th)); elseif (sin(ky) <= 5e-135) tmp = sin(ky) * (sin(th) / sin(kx)); elseif (sin(ky) <= 1e-37) tmp = sin(th) * (1.0 / (hypot(sin(ky), kx) / ky)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.05], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[ky], $MachinePrecision] / (-N[Sin[th], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-135], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-37], N[(N[Sin[th], $MachinePrecision] * N[(1.0 / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin ky}{-\sin th}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-135}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-37}:\\
\;\;\;\;\sin th \cdot \frac{1}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.7%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt0.0%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod59.7%
add-sqr-sqrt60.1%
distribute-neg-frac60.1%
neg-sub060.1%
Applied egg-rr60.1%
neg-sub060.1%
distribute-neg-frac260.1%
Simplified60.1%
if -0.050000000000000003 < (sin.f64 ky) < 5.0000000000000002e-135Initial program 88.5%
unpow288.5%
sqr-neg88.5%
sin-neg88.5%
sin-neg88.5%
unpow288.5%
associate-*l/85.0%
associate-/l*88.4%
+-commutative88.4%
unpow288.4%
sin-neg88.4%
sin-neg88.4%
Simplified99.5%
Taylor expanded in ky around 0 51.2%
if 5.0000000000000002e-135 < (sin.f64 ky) < 1.00000000000000007e-37Initial program 99.8%
Taylor expanded in kx around 0 76.3%
clear-num76.2%
inv-pow76.2%
+-commutative76.2%
unpow276.2%
unpow276.2%
hypot-define76.2%
Applied egg-rr76.2%
unpow-176.2%
Simplified76.2%
Taylor expanded in ky around 0 76.2%
if 1.00000000000000007e-37 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.5%
Taylor expanded in kx around 0 64.2%
Final simplification59.4%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(/ (sin ky) (/ (sin ky) (- (sin th))))
(if (<= (sin ky) 5e-135)
(* (sin ky) (/ (sin th) (sin kx)))
(if (<= (sin ky) 1e-37)
(* ky (/ (sin th) (hypot (sin ky) kx)))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = sin(ky) / (sin(ky) / -sin(th));
} else if (sin(ky) <= 5e-135) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if (sin(ky) <= 1e-37) {
tmp = ky * (sin(th) / hypot(sin(ky), kx));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.05) {
tmp = Math.sin(ky) / (Math.sin(ky) / -Math.sin(th));
} else if (Math.sin(ky) <= 5e-135) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(ky) <= 1e-37) {
tmp = ky * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.05: tmp = math.sin(ky) / (math.sin(ky) / -math.sin(th)) elif math.sin(ky) <= 5e-135: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif math.sin(ky) <= 1e-37: tmp = ky * (math.sin(th) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.05) tmp = Float64(sin(ky) / Float64(sin(ky) / Float64(-sin(th)))); elseif (sin(ky) <= 5e-135) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif (sin(ky) <= 1e-37) tmp = Float64(ky * Float64(sin(th) / hypot(sin(ky), kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.05) tmp = sin(ky) / (sin(ky) / -sin(th)); elseif (sin(ky) <= 5e-135) tmp = sin(ky) * (sin(th) / sin(kx)); elseif (sin(ky) <= 1e-37) tmp = ky * (sin(th) / hypot(sin(ky), kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.05], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[ky], $MachinePrecision] / (-N[Sin[th], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-135], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-37], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin ky}{-\sin th}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-135}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-37}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.7%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt0.0%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod59.7%
add-sqr-sqrt60.1%
distribute-neg-frac60.1%
neg-sub060.1%
Applied egg-rr60.1%
neg-sub060.1%
distribute-neg-frac260.1%
Simplified60.1%
if -0.050000000000000003 < (sin.f64 ky) < 5.0000000000000002e-135Initial program 88.5%
unpow288.5%
sqr-neg88.5%
sin-neg88.5%
sin-neg88.5%
unpow288.5%
associate-*l/85.0%
associate-/l*88.4%
+-commutative88.4%
unpow288.4%
sin-neg88.4%
sin-neg88.4%
Simplified99.5%
Taylor expanded in ky around 0 51.2%
if 5.0000000000000002e-135 < (sin.f64 ky) < 1.00000000000000007e-37Initial program 99.8%
Taylor expanded in kx around 0 76.3%
clear-num76.2%
inv-pow76.2%
+-commutative76.2%
unpow276.2%
unpow276.2%
hypot-define76.2%
Applied egg-rr76.2%
unpow-176.2%
Simplified76.2%
associate-*l/76.1%
*-un-lft-identity76.1%
Applied egg-rr76.1%
associate-/r/76.2%
Simplified76.2%
Taylor expanded in ky around 0 76.2%
if 1.00000000000000007e-37 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.5%
Taylor expanded in kx around 0 64.2%
Final simplification59.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) kx)))
(if (<= (sin ky) -0.24)
(* (sin ky) (/ th t_1))
(if (<= (sin ky) 5e-135)
(* (sin ky) (/ (sin th) (sin kx)))
(if (<= (sin ky) 1e-37) (* ky (/ (sin th) t_1)) (sin th))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), kx);
double tmp;
if (sin(ky) <= -0.24) {
tmp = sin(ky) * (th / t_1);
} else if (sin(ky) <= 5e-135) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if (sin(ky) <= 1e-37) {
tmp = ky * (sin(th) / t_1);
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), kx);
double tmp;
if (Math.sin(ky) <= -0.24) {
tmp = Math.sin(ky) * (th / t_1);
} else if (Math.sin(ky) <= 5e-135) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(ky) <= 1e-37) {
tmp = ky * (Math.sin(th) / t_1);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), kx) tmp = 0 if math.sin(ky) <= -0.24: tmp = math.sin(ky) * (th / t_1) elif math.sin(ky) <= 5e-135: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif math.sin(ky) <= 1e-37: tmp = ky * (math.sin(th) / t_1) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), kx) tmp = 0.0 if (sin(ky) <= -0.24) tmp = Float64(sin(ky) * Float64(th / t_1)); elseif (sin(ky) <= 5e-135) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif (sin(ky) <= 1e-37) tmp = Float64(ky * Float64(sin(th) / t_1)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), kx); tmp = 0.0; if (sin(ky) <= -0.24) tmp = sin(ky) * (th / t_1); elseif (sin(ky) <= 5e-135) tmp = sin(ky) * (sin(th) / sin(kx)); elseif (sin(ky) <= 1e-37) tmp = ky * (sin(th) / t_1); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.24], N[(N[Sin[ky], $MachinePrecision] * N[(th / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-135], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-37], N[(ky * N[(N[Sin[th], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, kx\right)\\
\mathbf{if}\;\sin ky \leq -0.24:\\
\;\;\;\;\sin ky \cdot \frac{th}{t\_1}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-135}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-37}:\\
\;\;\;\;ky \cdot \frac{\sin th}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.23999999999999999Initial program 99.7%
Taylor expanded in kx around 0 54.1%
clear-num54.1%
inv-pow54.1%
+-commutative54.1%
unpow254.1%
unpow254.1%
hypot-define54.2%
Applied egg-rr54.2%
unpow-154.2%
Simplified54.2%
associate-*l/54.2%
*-un-lft-identity54.2%
Applied egg-rr54.2%
associate-/r/54.2%
Simplified54.2%
Taylor expanded in th around 0 31.0%
if -0.23999999999999999 < (sin.f64 ky) < 5.0000000000000002e-135Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/85.9%
associate-/l*89.1%
+-commutative89.1%
unpow289.1%
sin-neg89.1%
sin-neg89.1%
Simplified99.6%
Taylor expanded in ky around 0 48.8%
if 5.0000000000000002e-135 < (sin.f64 ky) < 1.00000000000000007e-37Initial program 99.8%
Taylor expanded in kx around 0 76.3%
clear-num76.2%
inv-pow76.2%
+-commutative76.2%
unpow276.2%
unpow276.2%
hypot-define76.2%
Applied egg-rr76.2%
unpow-176.2%
Simplified76.2%
associate-*l/76.1%
*-un-lft-identity76.1%
Applied egg-rr76.1%
associate-/r/76.2%
Simplified76.2%
Taylor expanded in ky around 0 76.2%
if 1.00000000000000007e-37 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.5%
Taylor expanded in kx around 0 64.2%
Final simplification52.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.24) (* (sin ky) (/ th (hypot (sin ky) kx))) (if (<= (sin ky) 5e-106) (* (sin ky) (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.24) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 5e-106) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.24) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 5e-106) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.24: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 5e-106: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.24) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 5e-106) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.24) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 5e-106) tmp = sin(ky) * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.24], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-106], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.24:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-106}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.23999999999999999Initial program 99.7%
Taylor expanded in kx around 0 54.1%
clear-num54.1%
inv-pow54.1%
+-commutative54.1%
unpow254.1%
unpow254.1%
hypot-define54.2%
Applied egg-rr54.2%
unpow-154.2%
Simplified54.2%
associate-*l/54.2%
*-un-lft-identity54.2%
Applied egg-rr54.2%
associate-/r/54.2%
Simplified54.2%
Taylor expanded in th around 0 31.0%
if -0.23999999999999999 < (sin.f64 ky) < 4.99999999999999983e-106Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/86.5%
associate-/l*90.2%
+-commutative90.2%
unpow290.2%
sin-neg90.2%
sin-neg90.2%
Simplified99.6%
Taylor expanded in ky around 0 47.3%
if 4.99999999999999983e-106 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 62.4%
Final simplification49.9%
(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(sin(ky) / Float64(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[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}
\end{array}
Initial program 95.5%
unpow295.5%
sqr-neg95.5%
sin-neg95.5%
sin-neg95.5%
unpow295.5%
associate-*l/93.8%
associate-/l*95.4%
+-commutative95.4%
unpow295.4%
sin-neg95.4%
sin-neg95.4%
Simplified99.6%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
(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 95.5%
unpow295.5%
sqr-neg95.5%
sin-neg95.5%
sin-neg95.5%
unpow295.5%
associate-*l/93.8%
associate-/l*95.4%
+-commutative95.4%
unpow295.4%
sin-neg95.4%
sin-neg95.4%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 9e-133)
(* ky (/ (sin th) (sin kx)))
(if (<= ky 4.8e-37)
(* (sin th) (/ 1.0 (/ (hypot (sin ky) kx) ky)))
(* (sin ky) (/ (sin th) (fabs (sin ky)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9e-133) {
tmp = ky * (sin(th) / sin(kx));
} else if (ky <= 4.8e-37) {
tmp = sin(th) * (1.0 / (hypot(sin(ky), kx) / ky));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9e-133) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else if (ky <= 4.8e-37) {
tmp = Math.sin(th) * (1.0 / (Math.hypot(Math.sin(ky), kx) / ky));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 9e-133: tmp = ky * (math.sin(th) / math.sin(kx)) elif ky <= 4.8e-37: tmp = math.sin(th) * (1.0 / (math.hypot(math.sin(ky), kx) / ky)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 9e-133) tmp = Float64(ky * Float64(sin(th) / sin(kx))); elseif (ky <= 4.8e-37) tmp = Float64(sin(th) * Float64(1.0 / Float64(hypot(sin(ky), kx) / ky))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 9e-133) tmp = ky * (sin(th) / sin(kx)); elseif (ky <= 4.8e-37) tmp = sin(th) * (1.0 / (hypot(sin(ky), kx) / ky)); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 9e-133], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 4.8e-37], N[(N[Sin[th], $MachinePrecision] * N[(1.0 / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 9 \cdot 10^{-133}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;ky \leq 4.8 \cdot 10^{-37}:\\
\;\;\;\;\sin th \cdot \frac{1}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 9.00000000000000019e-133Initial program 92.9%
unpow292.9%
sqr-neg92.9%
sin-neg92.9%
sin-neg92.9%
unpow292.9%
associate-*l/90.7%
associate-/l*92.8%
+-commutative92.8%
unpow292.8%
sin-neg92.8%
sin-neg92.8%
Simplified99.6%
Taylor expanded in ky around 0 32.5%
associate-/l*32.5%
Simplified32.5%
if 9.00000000000000019e-133 < ky < 4.79999999999999982e-37Initial program 99.8%
Taylor expanded in kx around 0 76.3%
clear-num76.2%
inv-pow76.2%
+-commutative76.2%
unpow276.2%
unpow276.2%
hypot-define76.2%
Applied egg-rr76.2%
unpow-176.2%
Simplified76.2%
Taylor expanded in ky around 0 76.2%
if 4.79999999999999982e-37 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 40.6%
add-sqr-sqrt39.5%
sqrt-prod58.3%
rem-sqrt-square58.3%
Applied egg-rr58.3%
Final simplification44.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.001) (fabs (sin th)) (if (<= (sin ky) 5e-106) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.001) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-106) {
tmp = ky * (sin(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) <= (-0.001d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-106) then
tmp = ky * (sin(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) <= -0.001) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-106) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.001: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-106: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.001) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-106) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.001) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-106) tmp = ky * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.001], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-106], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.001:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-106}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -1e-3Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.2%
sqrt-unprod30.6%
pow230.6%
Applied egg-rr30.6%
unpow230.6%
rem-sqrt-square37.2%
associate-*r/37.1%
*-commutative37.1%
associate-/l*37.2%
*-inverses37.2%
*-rgt-identity37.2%
Simplified37.2%
if -1e-3 < (sin.f64 ky) < 4.99999999999999983e-106Initial program 89.5%
unpow289.5%
sqr-neg89.5%
sin-neg89.5%
sin-neg89.5%
unpow289.5%
associate-*l/85.4%
associate-/l*89.4%
+-commutative89.4%
unpow289.4%
sin-neg89.4%
sin-neg89.4%
Simplified99.6%
Taylor expanded in ky around 0 50.4%
associate-/l*50.5%
Simplified50.5%
if 4.99999999999999983e-106 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 62.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 0.102) (/ (sin ky) (/ (hypot ky (sin kx)) (sin th))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.102) {
tmp = sin(ky) / (hypot(ky, sin(kx)) / sin(th));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.102) {
tmp = Math.sin(ky) / (Math.hypot(ky, Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.102: tmp = math.sin(ky) / (math.hypot(ky, math.sin(kx)) / math.sin(th)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.102) tmp = Float64(sin(ky) / Float64(hypot(ky, sin(kx)) / sin(th))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.102) tmp = sin(ky) / (hypot(ky, sin(kx)) / sin(th)); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.102], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.102:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(ky, \sin kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 0.101999999999999993Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 66.7%
if 0.101999999999999993 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 39.7%
add-sqr-sqrt38.5%
sqrt-prod59.1%
rem-sqrt-square59.1%
Applied egg-rr59.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky 0.102) (* (sin ky) (/ (sin th) (hypot ky (sin kx)))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.102) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.102) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.102: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.102) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.102) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.102], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.102:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 0.101999999999999993Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
Taylor expanded in ky around 0 66.7%
if 0.101999999999999993 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 39.7%
add-sqr-sqrt38.5%
sqrt-prod59.1%
rem-sqrt-square59.1%
Applied egg-rr59.1%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.0028) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0028) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0028) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0028: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0028) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0028) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0028], 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[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0028:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if th < 0.00279999999999999997Initial program 96.5%
unpow296.5%
sqr-neg96.5%
sin-neg96.5%
sin-neg96.5%
unpow296.5%
associate-*l/94.0%
associate-/l*96.3%
+-commutative96.3%
unpow296.3%
sin-neg96.3%
sin-neg96.3%
Simplified99.6%
Taylor expanded in th around 0 64.2%
if 0.00279999999999999997 < th Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/93.2%
associate-/l*93.3%
+-commutative93.3%
unpow293.3%
sin-neg93.3%
sin-neg93.3%
Simplified99.6%
Taylor expanded in kx around 0 36.2%
add-sqr-sqrt35.4%
sqrt-prod49.2%
rem-sqrt-square53.6%
Applied egg-rr53.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-106) (* (sin ky) (/ (sin th) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-106) {
tmp = sin(ky) * (sin(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) <= 5d-106) then
tmp = sin(ky) * (sin(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) <= 5e-106) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 5e-106: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-106) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 5e-106) tmp = sin(ky) * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-106], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-106}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 4.99999999999999983e-106Initial program 93.0%
unpow293.0%
sqr-neg93.0%
sin-neg93.0%
sin-neg93.0%
unpow293.0%
associate-*l/90.3%
associate-/l*92.9%
+-commutative92.9%
unpow292.9%
sin-neg92.9%
sin-neg92.9%
Simplified99.6%
Taylor expanded in ky around 0 35.7%
if 4.99999999999999983e-106 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 62.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.001) (fabs (sin th)) (if (<= (sin ky) 5e-132) (* ky (/ (sin th) kx)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.001) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-132) {
tmp = ky * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.001d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-132) then
tmp = ky * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.001) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-132) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.001: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-132: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.001) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-132) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.001) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-132) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.001], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-132], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.001:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-132}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -1e-3Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.2%
sqrt-unprod30.6%
pow230.6%
Applied egg-rr30.6%
unpow230.6%
rem-sqrt-square37.2%
associate-*r/37.1%
*-commutative37.1%
associate-/l*37.2%
*-inverses37.2%
*-rgt-identity37.2%
Simplified37.2%
if -1e-3 < (sin.f64 ky) < 4.9999999999999999e-132Initial program 88.3%
Taylor expanded in kx around 0 53.6%
Taylor expanded in ky around 0 35.1%
associate-/l*35.0%
Simplified35.0%
if 4.9999999999999999e-132 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.7%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 61.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (+ (exp (* th (+ 1.0 (* th -0.5)))) -1.0) (if (<= (sin ky) 5e-132) (* ky (/ (sin th) kx)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = exp((th * (1.0 + (th * -0.5)))) + -1.0;
} else if (sin(ky) <= 5e-132) {
tmp = ky * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = exp((th * (1.0d0 + (th * (-0.5d0))))) + (-1.0d0)
else if (sin(ky) <= 5d-132) then
tmp = ky * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = Math.exp((th * (1.0 + (th * -0.5)))) + -1.0;
} else if (Math.sin(ky) <= 5e-132) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = math.exp((th * (1.0 + (th * -0.5)))) + -1.0 elif math.sin(ky) <= 5e-132: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(exp(Float64(th * Float64(1.0 + Float64(th * -0.5)))) + -1.0); elseif (sin(ky) <= 5e-132) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = exp((th * (1.0 + (th * -0.5)))) + -1.0; elseif (sin(ky) <= 5e-132) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[Exp[N[(th * N[(1.0 + N[(th * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-132], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;e^{th \cdot \left(1 + th \cdot -0.5\right)} + -1\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-132}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
expm1-log1p-u2.6%
expm1-undefine3.4%
Applied egg-rr3.4%
Taylor expanded in th around 0 5.7%
*-commutative5.7%
Simplified5.7%
if -0.0200000000000000004 < (sin.f64 ky) < 4.9999999999999999e-132Initial program 88.4%
Taylor expanded in kx around 0 53.1%
Taylor expanded in ky around 0 34.7%
associate-/l*34.7%
Simplified34.7%
if 4.9999999999999999e-132 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.7%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 61.0%
Final simplification39.3%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4e-126) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4e-126) {
tmp = ky * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4d-126) then
tmp = ky * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4e-126) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4e-126: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4e-126) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4e-126) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4e-126], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4 \cdot 10^{-126}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.9999999999999998e-126Initial program 92.9%
Taylor expanded in kx around 0 56.1%
Taylor expanded in ky around 0 22.5%
associate-/l*22.5%
Simplified22.5%
if 3.9999999999999998e-126 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 41.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 9.6e-132) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9.6e-132) {
tmp = ky * (th / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 9.6d-132) then
tmp = ky * (th / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9.6e-132) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 9.6e-132: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 9.6e-132) tmp = Float64(ky * Float64(th / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 9.6e-132) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 9.6e-132], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 9.6 \cdot 10^{-132}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 9.60000000000000062e-132Initial program 92.9%
Taylor expanded in kx around 0 56.1%
Taylor expanded in ky around 0 22.5%
associate-/l*22.5%
Simplified22.5%
Taylor expanded in th around 0 19.4%
associate-/l*19.3%
Simplified19.3%
if 9.60000000000000062e-132 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 41.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.7e-104) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.7e-104) {
tmp = ky * (th / 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 <= 4.7d-104) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.7e-104) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.7e-104: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.7e-104) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.7e-104) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.7e-104], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.7 \cdot 10^{-104}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 4.7e-104Initial program 93.4%
Taylor expanded in kx around 0 57.8%
Taylor expanded in ky around 0 23.0%
associate-/l*23.0%
Simplified23.0%
Taylor expanded in th around 0 20.1%
associate-/l*20.1%
Simplified20.1%
if 4.7e-104 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 40.8%
Taylor expanded in th around 0 11.6%
(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 95.5%
unpow295.5%
sqr-neg95.5%
sin-neg95.5%
sin-neg95.5%
unpow295.5%
associate-*l/93.8%
associate-/l*95.4%
+-commutative95.4%
unpow295.4%
sin-neg95.4%
sin-neg95.4%
Simplified99.6%
Taylor expanded in kx around 0 28.5%
Taylor expanded in th around 0 11.0%
herbie shell --seed 2024182
(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)))