
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 90.6%
+-commutative90.6%
unpow290.6%
unpow290.6%
hypot-undefine99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin th) -0.38)
(* (sin ky) t_1)
(if (<= (sin th) -0.05)
(fabs (sin th))
(if (<= (sin th) 5e-8)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(if (or (<= (sin th) 0.82) (not (<= (sin th) 0.993)))
(/ (sin ky) (fabs (/ (sin ky) (sin th))))
(fabs (* ky t_1))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(th) <= -0.38) {
tmp = sin(ky) * t_1;
} else if (sin(th) <= -0.05) {
tmp = fabs(sin(th));
} else if (sin(th) <= 5e-8) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else if ((sin(th) <= 0.82) || !(sin(th) <= 0.993)) {
tmp = sin(ky) / fabs((sin(ky) / sin(th)));
} else {
tmp = fabs((ky * t_1));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(th) <= -0.38) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(th) <= -0.05) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(th) <= 5e-8) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else if ((Math.sin(th) <= 0.82) || !(Math.sin(th) <= 0.993)) {
tmp = Math.sin(ky) / Math.abs((Math.sin(ky) / Math.sin(th)));
} else {
tmp = Math.abs((ky * t_1));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(th) <= -0.38: tmp = math.sin(ky) * t_1 elif math.sin(th) <= -0.05: tmp = math.fabs(math.sin(th)) elif math.sin(th) <= 5e-8: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) elif (math.sin(th) <= 0.82) or not (math.sin(th) <= 0.993): tmp = math.sin(ky) / math.fabs((math.sin(ky) / math.sin(th))) else: tmp = math.fabs((ky * t_1)) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(th) <= -0.38) tmp = Float64(sin(ky) * t_1); elseif (sin(th) <= -0.05) tmp = abs(sin(th)); elseif (sin(th) <= 5e-8) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); elseif ((sin(th) <= 0.82) || !(sin(th) <= 0.993)) tmp = Float64(sin(ky) / abs(Float64(sin(ky) / sin(th)))); else tmp = abs(Float64(ky * t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(th) <= -0.38) tmp = sin(ky) * t_1; elseif (sin(th) <= -0.05) tmp = abs(sin(th)); elseif (sin(th) <= 5e-8) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); elseif ((sin(th) <= 0.82) || ~((sin(th) <= 0.993))) tmp = sin(ky) / abs((sin(ky) / sin(th))); else tmp = abs((ky * t_1)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[th], $MachinePrecision], -0.38], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], -0.05], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-8], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[th], $MachinePrecision], 0.82], N[Not[LessEqual[N[Sin[th], $MachinePrecision], 0.993]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] / N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin th \leq -0.38:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin th \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{elif}\;\sin th \leq 0.82 \lor \neg \left(\sin th \leq 0.993\right):\\
\;\;\;\;\frac{\sin ky}{\left|\frac{\sin ky}{\sin th}\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.38Initial program 95.7%
associate-*l/95.7%
associate-/l*95.8%
unpow295.8%
sqr-neg95.8%
sin-neg95.8%
sin-neg95.8%
unpow295.8%
unpow295.8%
sin-neg95.8%
sin-neg95.8%
sqr-neg95.8%
unpow295.8%
Simplified99.6%
Taylor expanded in ky around 0 26.6%
if -0.38 < (sin.f64 th) < -0.050000000000000003Initial program 84.9%
associate-*l/84.7%
associate-/l*84.7%
unpow284.7%
sqr-neg84.7%
sin-neg84.7%
sin-neg84.7%
unpow284.7%
unpow284.7%
sin-neg84.7%
sin-neg84.7%
sqr-neg84.7%
unpow284.7%
Simplified99.6%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 49.1%
associate-/r/49.2%
*-inverses49.2%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
sqrt-unprod17.2%
pow217.2%
Applied egg-rr17.2%
unpow217.2%
rem-sqrt-square17.2%
Simplified17.2%
if -0.050000000000000003 < (sin.f64 th) < 4.9999999999999998e-8Initial program 89.5%
associate-*l/84.0%
associate-/l*89.4%
unpow289.4%
sqr-neg89.4%
sin-neg89.4%
sin-neg89.4%
unpow289.4%
unpow289.4%
sin-neg89.4%
sin-neg89.4%
sqr-neg89.4%
unpow289.4%
Simplified99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 87.0%
associate-*l/87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine97.5%
*-lft-identity97.5%
hypot-undefine87.1%
unpow287.1%
unpow287.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-define97.5%
Simplified97.5%
if 4.9999999999999998e-8 < (sin.f64 th) < 0.819999999999999951 or 0.992999999999999994 < (sin.f64 th) Initial program 89.2%
associate-*l/89.2%
associate-/l*89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
unpow289.2%
sin-neg89.2%
sin-neg89.2%
sqr-neg89.2%
unpow289.2%
Simplified99.7%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 26.2%
add-sqr-sqrt25.1%
sqrt-unprod47.1%
pow247.1%
Applied egg-rr47.1%
unpow247.1%
rem-sqrt-square50.8%
Simplified50.8%
if 0.819999999999999951 < (sin.f64 th) < 0.992999999999999994Initial program 91.6%
associate-*l/91.5%
associate-/l*91.5%
unpow291.5%
sqr-neg91.5%
sin-neg91.5%
sin-neg91.5%
unpow291.5%
unpow291.5%
sin-neg91.5%
sin-neg91.5%
sqr-neg91.5%
unpow291.5%
Simplified99.6%
Taylor expanded in ky around 0 19.0%
add-sqr-sqrt13.0%
sqrt-unprod23.7%
pow223.7%
associate-/l*23.7%
Applied egg-rr23.7%
unpow223.7%
rem-sqrt-square39.0%
Simplified39.0%
Final simplification65.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin th) -0.38)
(* (sin ky) t_1)
(if (<= (sin th) -0.05)
(fabs (sin th))
(if (<= (sin th) 5e-8)
(/ (/ (sin ky) (hypot (sin ky) (sin kx))) (/ 1.0 th))
(if (or (<= (sin th) 0.82) (not (<= (sin th) 0.993)))
(/ (sin ky) (fabs (/ (sin ky) (sin th))))
(fabs (* ky t_1))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(th) <= -0.38) {
tmp = sin(ky) * t_1;
} else if (sin(th) <= -0.05) {
tmp = fabs(sin(th));
} else if (sin(th) <= 5e-8) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) / (1.0 / th);
} else if ((sin(th) <= 0.82) || !(sin(th) <= 0.993)) {
tmp = sin(ky) / fabs((sin(ky) / sin(th)));
} else {
tmp = fabs((ky * t_1));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(th) <= -0.38) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(th) <= -0.05) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(th) <= 5e-8) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) / (1.0 / th);
} else if ((Math.sin(th) <= 0.82) || !(Math.sin(th) <= 0.993)) {
tmp = Math.sin(ky) / Math.abs((Math.sin(ky) / Math.sin(th)));
} else {
tmp = Math.abs((ky * t_1));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(th) <= -0.38: tmp = math.sin(ky) * t_1 elif math.sin(th) <= -0.05: tmp = math.fabs(math.sin(th)) elif math.sin(th) <= 5e-8: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) / (1.0 / th) elif (math.sin(th) <= 0.82) or not (math.sin(th) <= 0.993): tmp = math.sin(ky) / math.fabs((math.sin(ky) / math.sin(th))) else: tmp = math.fabs((ky * t_1)) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(th) <= -0.38) tmp = Float64(sin(ky) * t_1); elseif (sin(th) <= -0.05) tmp = abs(sin(th)); elseif (sin(th) <= 5e-8) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) / Float64(1.0 / th)); elseif ((sin(th) <= 0.82) || !(sin(th) <= 0.993)) tmp = Float64(sin(ky) / abs(Float64(sin(ky) / sin(th)))); else tmp = abs(Float64(ky * t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(th) <= -0.38) tmp = sin(ky) * t_1; elseif (sin(th) <= -0.05) tmp = abs(sin(th)); elseif (sin(th) <= 5e-8) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) / (1.0 / th); elseif ((sin(th) <= 0.82) || ~((sin(th) <= 0.993))) tmp = sin(ky) / abs((sin(ky) / sin(th))); else tmp = abs((ky * t_1)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[th], $MachinePrecision], -0.38], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], -0.05], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-8], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(1.0 / th), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[th], $MachinePrecision], 0.82], N[Not[LessEqual[N[Sin[th], $MachinePrecision], 0.993]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] / N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin th \leq -0.38:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin th \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}}{\frac{1}{th}}\\
\mathbf{elif}\;\sin th \leq 0.82 \lor \neg \left(\sin th \leq 0.993\right):\\
\;\;\;\;\frac{\sin ky}{\left|\frac{\sin ky}{\sin th}\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.38Initial program 95.7%
associate-*l/95.7%
associate-/l*95.8%
unpow295.8%
sqr-neg95.8%
sin-neg95.8%
sin-neg95.8%
unpow295.8%
unpow295.8%
sin-neg95.8%
sin-neg95.8%
sqr-neg95.8%
unpow295.8%
Simplified99.6%
Taylor expanded in ky around 0 26.6%
if -0.38 < (sin.f64 th) < -0.050000000000000003Initial program 84.9%
associate-*l/84.7%
associate-/l*84.7%
unpow284.7%
sqr-neg84.7%
sin-neg84.7%
sin-neg84.7%
unpow284.7%
unpow284.7%
sin-neg84.7%
sin-neg84.7%
sqr-neg84.7%
unpow284.7%
Simplified99.6%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 49.1%
associate-/r/49.2%
*-inverses49.2%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
sqrt-unprod17.2%
pow217.2%
Applied egg-rr17.2%
unpow217.2%
rem-sqrt-square17.2%
Simplified17.2%
if -0.050000000000000003 < (sin.f64 th) < 4.9999999999999998e-8Initial program 89.5%
+-commutative89.5%
unpow289.5%
unpow289.5%
hypot-undefine99.9%
Applied egg-rr99.9%
associate-/r/99.7%
div-inv99.6%
associate-/r*99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 97.5%
if 4.9999999999999998e-8 < (sin.f64 th) < 0.819999999999999951 or 0.992999999999999994 < (sin.f64 th) Initial program 89.2%
associate-*l/89.2%
associate-/l*89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
unpow289.2%
sin-neg89.2%
sin-neg89.2%
sqr-neg89.2%
unpow289.2%
Simplified99.7%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 26.2%
add-sqr-sqrt25.1%
sqrt-unprod47.1%
pow247.1%
Applied egg-rr47.1%
unpow247.1%
rem-sqrt-square50.8%
Simplified50.8%
if 0.819999999999999951 < (sin.f64 th) < 0.992999999999999994Initial program 91.6%
associate-*l/91.5%
associate-/l*91.5%
unpow291.5%
sqr-neg91.5%
sin-neg91.5%
sin-neg91.5%
unpow291.5%
unpow291.5%
sin-neg91.5%
sin-neg91.5%
sqr-neg91.5%
unpow291.5%
Simplified99.6%
Taylor expanded in ky around 0 19.0%
add-sqr-sqrt13.0%
sqrt-unprod23.7%
pow223.7%
associate-/l*23.7%
Applied egg-rr23.7%
unpow223.7%
rem-sqrt-square39.0%
Simplified39.0%
Final simplification65.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.005)
(fabs (sin th))
(if (<= (sin ky) 4e-205)
(* (sin th) (/ ky (sin kx)))
(if (or (<= (sin ky) 2e-82)
(and (not (<= (sin ky) 5e-59)) (<= (sin ky) 2e-44)))
(fabs (* ky (/ (sin th) (sin kx))))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 4e-205) {
tmp = sin(th) * (ky / sin(kx));
} else if ((sin(ky) <= 2e-82) || (!(sin(ky) <= 5e-59) && (sin(ky) <= 2e-44))) {
tmp = fabs((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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 4d-205) then
tmp = sin(th) * (ky / sin(kx))
else if ((sin(ky) <= 2d-82) .or. (.not. (sin(ky) <= 5d-59)) .and. (sin(ky) <= 2d-44)) then
tmp = abs((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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 4e-205) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else if ((Math.sin(ky) <= 2e-82) || (!(Math.sin(ky) <= 5e-59) && (Math.sin(ky) <= 2e-44))) {
tmp = Math.abs((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.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 4e-205: tmp = math.sin(th) * (ky / math.sin(kx)) elif (math.sin(ky) <= 2e-82) or (not (math.sin(ky) <= 5e-59) and (math.sin(ky) <= 2e-44)): tmp = math.fabs((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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 4e-205) tmp = Float64(sin(th) * Float64(ky / sin(kx))); elseif ((sin(ky) <= 2e-82) || (!(sin(ky) <= 5e-59) && (sin(ky) <= 2e-44))) tmp = abs(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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 4e-205) tmp = sin(th) * (ky / sin(kx)); elseif ((sin(ky) <= 2e-82) || (~((sin(ky) <= 5e-59)) && (sin(ky) <= 2e-44))) tmp = abs((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.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-205], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 2e-82], And[N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 5e-59]], $MachinePrecision], LessEqual[N[Sin[ky], $MachinePrecision], 2e-44]]], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-205}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-82} \lor \neg \left(\sin ky \leq 5 \cdot 10^{-59}\right) \land \sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in kx around 0 2.5%
associate-/r/2.5%
*-inverses2.5%
add-sqr-sqrt1.0%
*-un-lft-identity1.0%
sqrt-unprod29.3%
pow229.3%
Applied egg-rr29.3%
unpow229.3%
rem-sqrt-square37.3%
Simplified37.3%
if -0.0050000000000000001 < (sin.f64 ky) < 4e-205Initial program 77.9%
associate-*l/72.8%
associate-/l*77.9%
unpow277.9%
sqr-neg77.9%
sin-neg77.9%
sin-neg77.9%
unpow277.9%
unpow277.9%
sin-neg77.9%
sin-neg77.9%
sqr-neg77.9%
unpow277.9%
Simplified99.7%
Taylor expanded in ky around 0 44.3%
*-commutative44.3%
associate-/l*49.0%
Simplified49.0%
if 4e-205 < (sin.f64 ky) < 2e-82 or 5.0000000000000001e-59 < (sin.f64 ky) < 1.99999999999999991e-44Initial program 87.0%
associate-*l/84.3%
associate-/l*87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
unpow287.1%
sin-neg87.1%
sin-neg87.1%
sqr-neg87.1%
unpow287.1%
Simplified99.7%
Taylor expanded in ky around 0 45.8%
add-sqr-sqrt28.0%
sqrt-unprod30.6%
pow230.6%
associate-/l*30.6%
Applied egg-rr30.6%
unpow230.6%
rem-sqrt-square38.1%
Simplified38.1%
if 2e-82 < (sin.f64 ky) < 5.0000000000000001e-59 or 1.99999999999999991e-44 < (sin.f64 ky) Initial program 99.9%
associate-*l/97.7%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 64.1%
Final simplification48.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(/ (sin ky) (fabs (/ (sin ky) (sin th))))
(if (<= (sin ky) 4e-205)
(* (sin th) (/ (sin ky) (sin kx)))
(if (or (<= (sin ky) 2e-82)
(and (not (<= (sin ky) 5e-59)) (<= (sin ky) 2e-44)))
(fabs (* ky (/ (sin th) (sin kx))))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = sin(ky) / fabs((sin(ky) / sin(th)));
} else if (sin(ky) <= 4e-205) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if ((sin(ky) <= 2e-82) || (!(sin(ky) <= 5e-59) && (sin(ky) <= 2e-44))) {
tmp = fabs((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.05d0)) then
tmp = sin(ky) / abs((sin(ky) / sin(th)))
else if (sin(ky) <= 4d-205) then
tmp = sin(th) * (sin(ky) / sin(kx))
else if ((sin(ky) <= 2d-82) .or. (.not. (sin(ky) <= 5d-59)) .and. (sin(ky) <= 2d-44)) then
tmp = abs((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.05) {
tmp = Math.sin(ky) / Math.abs((Math.sin(ky) / Math.sin(th)));
} else if (Math.sin(ky) <= 4e-205) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if ((Math.sin(ky) <= 2e-82) || (!(Math.sin(ky) <= 5e-59) && (Math.sin(ky) <= 2e-44))) {
tmp = Math.abs((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.05: tmp = math.sin(ky) / math.fabs((math.sin(ky) / math.sin(th))) elif math.sin(ky) <= 4e-205: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) elif (math.sin(ky) <= 2e-82) or (not (math.sin(ky) <= 5e-59) and (math.sin(ky) <= 2e-44)): tmp = math.fabs((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.05) tmp = Float64(sin(ky) / abs(Float64(sin(ky) / sin(th)))); elseif (sin(ky) <= 4e-205) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif ((sin(ky) <= 2e-82) || (!(sin(ky) <= 5e-59) && (sin(ky) <= 2e-44))) tmp = abs(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.05) tmp = sin(ky) / abs((sin(ky) / sin(th))); elseif (sin(ky) <= 4e-205) tmp = sin(th) * (sin(ky) / sin(kx)); elseif ((sin(ky) <= 2e-82) || (~((sin(ky) <= 5e-59)) && (sin(ky) <= 2e-44))) tmp = abs((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.05], N[(N[Sin[ky], $MachinePrecision] / N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-205], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 2e-82], And[N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 5e-59]], $MachinePrecision], LessEqual[N[Sin[ky], $MachinePrecision], 2e-44]]], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\frac{\sin ky}{\left|\frac{\sin ky}{\sin th}\right|}\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-205}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-82} \lor \neg \left(\sin ky \leq 5 \cdot 10^{-59}\right) \land \sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.5%
sqrt-unprod25.2%
pow225.2%
Applied egg-rr25.2%
unpow225.2%
rem-sqrt-square28.5%
Simplified28.5%
if -0.050000000000000003 < (sin.f64 ky) < 4e-205Initial program 78.1%
+-commutative78.1%
unpow278.1%
unpow278.1%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in ky around 0 48.5%
if 4e-205 < (sin.f64 ky) < 2e-82 or 5.0000000000000001e-59 < (sin.f64 ky) < 1.99999999999999991e-44Initial program 87.0%
associate-*l/84.3%
associate-/l*87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
unpow287.1%
sin-neg87.1%
sin-neg87.1%
sqr-neg87.1%
unpow287.1%
Simplified99.7%
Taylor expanded in ky around 0 45.8%
add-sqr-sqrt28.0%
sqrt-unprod30.6%
pow230.6%
associate-/l*30.6%
Applied egg-rr30.6%
unpow230.6%
rem-sqrt-square38.1%
Simplified38.1%
if 2e-82 < (sin.f64 ky) < 5.0000000000000001e-59 or 1.99999999999999991e-44 < (sin.f64 ky) Initial program 99.9%
associate-*l/97.7%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 64.1%
Final simplification45.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.02)
(fabs (* ky t_1))
(if (<= (sin kx) 2e-86)
(sin th)
(if (or (<= (sin kx) 1e-51) (not (<= (sin kx) 1e-22)))
(* (sin ky) t_1)
(fabs (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 2e-86) {
tmp = sin(th);
} else if ((sin(kx) <= 1e-51) || !(sin(kx) <= 1e-22)) {
tmp = sin(ky) * t_1;
} else {
tmp = fabs(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 = sin(th) / sin(kx)
if (sin(kx) <= (-0.02d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 2d-86) then
tmp = sin(th)
else if ((sin(kx) <= 1d-51) .or. (.not. (sin(kx) <= 1d-22))) then
tmp = sin(ky) * t_1
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 2e-86) {
tmp = Math.sin(th);
} else if ((Math.sin(kx) <= 1e-51) || !(Math.sin(kx) <= 1e-22)) {
tmp = Math.sin(ky) * t_1;
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.02: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 2e-86: tmp = math.sin(th) elif (math.sin(kx) <= 1e-51) or not (math.sin(kx) <= 1e-22): tmp = math.sin(ky) * t_1 else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.02) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif ((sin(kx) <= 1e-51) || !(sin(kx) <= 1e-22)) tmp = Float64(sin(ky) * t_1); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.02) tmp = abs((ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif ((sin(kx) <= 1e-51) || ~((sin(kx) <= 1e-22))) tmp = sin(ky) * t_1; else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-86], N[Sin[th], $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 1e-51], N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 1e-22]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-86}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-51} \lor \neg \left(\sin kx \leq 10^{-22}\right):\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 15.5%
add-sqr-sqrt12.1%
sqrt-unprod21.6%
pow221.6%
associate-/l*21.6%
Applied egg-rr21.6%
unpow221.6%
rem-sqrt-square35.8%
Simplified35.8%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000017e-86Initial program 79.6%
associate-*l/74.4%
associate-/l*79.5%
unpow279.5%
sqr-neg79.5%
sin-neg79.5%
sin-neg79.5%
unpow279.5%
unpow279.5%
sin-neg79.5%
sin-neg79.5%
sqr-neg79.5%
unpow279.5%
Simplified99.8%
Taylor expanded in kx around 0 38.6%
if 2.00000000000000017e-86 < (sin.f64 kx) < 1e-51 or 1e-22 < (sin.f64 kx) Initial program 99.6%
associate-*l/98.4%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in ky around 0 64.8%
if 1e-51 < (sin.f64 kx) < 1e-22Initial program 100.0%
associate-*l/100.0%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.5%
clear-num99.0%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 50.9%
associate-/r/50.9%
*-inverses50.9%
add-sqr-sqrt0.5%
*-un-lft-identity0.5%
sqrt-unprod18.0%
pow218.0%
Applied egg-rr18.0%
unpow218.0%
rem-sqrt-square18.0%
Simplified18.0%
Final simplification44.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.02)
(fabs (* ky t_1))
(if (<= (sin kx) 2e-86)
(sin th)
(if (<= (sin kx) 1e-51)
(* (sin ky) t_1)
(if (<= (sin kx) 1e-22)
(fabs (sin th))
(* (sin th) (/ (sin ky) (sin kx)))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 2e-86) {
tmp = sin(th);
} else if (sin(kx) <= 1e-51) {
tmp = sin(ky) * t_1;
} else if (sin(kx) <= 1e-22) {
tmp = fabs(sin(th));
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.02d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 2d-86) then
tmp = sin(th)
else if (sin(kx) <= 1d-51) then
tmp = sin(ky) * t_1
else if (sin(kx) <= 1d-22) then
tmp = abs(sin(th))
else
tmp = sin(th) * (sin(ky) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 2e-86) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 1e-51) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(kx) <= 1e-22) {
tmp = Math.abs(Math.sin(th));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.02: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 2e-86: tmp = math.sin(th) elif math.sin(kx) <= 1e-51: tmp = math.sin(ky) * t_1 elif math.sin(kx) <= 1e-22: tmp = math.fabs(math.sin(th)) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.02) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif (sin(kx) <= 1e-51) tmp = Float64(sin(ky) * t_1); elseif (sin(kx) <= 1e-22) tmp = abs(sin(th)); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.02) tmp = abs((ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif (sin(kx) <= 1e-51) tmp = sin(ky) * t_1; elseif (sin(kx) <= 1e-22) tmp = abs(sin(th)); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-86], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-51], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-22], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-86}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-51}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin kx \leq 10^{-22}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 15.5%
add-sqr-sqrt12.1%
sqrt-unprod21.6%
pow221.6%
associate-/l*21.6%
Applied egg-rr21.6%
unpow221.6%
rem-sqrt-square35.8%
Simplified35.8%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000017e-86Initial program 79.6%
associate-*l/74.4%
associate-/l*79.5%
unpow279.5%
sqr-neg79.5%
sin-neg79.5%
sin-neg79.5%
unpow279.5%
unpow279.5%
sin-neg79.5%
sin-neg79.5%
sqr-neg79.5%
unpow279.5%
Simplified99.8%
Taylor expanded in kx around 0 38.6%
if 2.00000000000000017e-86 < (sin.f64 kx) < 1e-51Initial program 99.4%
associate-*l/99.8%
associate-/l*99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
unpow299.8%
sin-neg99.8%
sin-neg99.8%
sqr-neg99.8%
unpow299.8%
Simplified99.8%
Taylor expanded in ky around 0 65.0%
if 1e-51 < (sin.f64 kx) < 1e-22Initial program 100.0%
associate-*l/100.0%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.5%
clear-num99.0%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 50.9%
associate-/r/50.9%
*-inverses50.9%
add-sqr-sqrt0.5%
*-un-lft-identity0.5%
sqrt-unprod18.0%
pow218.0%
Applied egg-rr18.0%
unpow218.0%
rem-sqrt-square18.0%
Simplified18.0%
if 1e-22 < (sin.f64 kx) Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 64.6%
Final simplification44.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.02)
(fabs (* ky t_1))
(if (<= (sin kx) 2e-86)
(sin th)
(if (<= (sin kx) 1e-51)
(* (sin ky) t_1)
(if (<= (sin kx) 1e-22)
(fabs (sin th))
(/ (sin th) (/ (sin kx) (sin ky)))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 2e-86) {
tmp = sin(th);
} else if (sin(kx) <= 1e-51) {
tmp = sin(ky) * t_1;
} else if (sin(kx) <= 1e-22) {
tmp = fabs(sin(th));
} else {
tmp = sin(th) / (sin(kx) / 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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.02d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 2d-86) then
tmp = sin(th)
else if (sin(kx) <= 1d-51) then
tmp = sin(ky) * t_1
else if (sin(kx) <= 1d-22) then
tmp = abs(sin(th))
else
tmp = sin(th) / (sin(kx) / sin(ky))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 2e-86) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 1e-51) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(kx) <= 1e-22) {
tmp = Math.abs(Math.sin(th));
} else {
tmp = Math.sin(th) / (Math.sin(kx) / Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.02: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 2e-86: tmp = math.sin(th) elif math.sin(kx) <= 1e-51: tmp = math.sin(ky) * t_1 elif math.sin(kx) <= 1e-22: tmp = math.fabs(math.sin(th)) else: tmp = math.sin(th) / (math.sin(kx) / math.sin(ky)) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.02) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif (sin(kx) <= 1e-51) tmp = Float64(sin(ky) * t_1); elseif (sin(kx) <= 1e-22) tmp = abs(sin(th)); else tmp = Float64(sin(th) / Float64(sin(kx) / sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.02) tmp = abs((ky * t_1)); elseif (sin(kx) <= 2e-86) tmp = sin(th); elseif (sin(kx) <= 1e-51) tmp = sin(ky) * t_1; elseif (sin(kx) <= 1e-22) tmp = abs(sin(th)); else tmp = sin(th) / (sin(kx) / sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-86], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-51], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-22], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-86}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-51}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin kx \leq 10^{-22}:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 15.5%
add-sqr-sqrt12.1%
sqrt-unprod21.6%
pow221.6%
associate-/l*21.6%
Applied egg-rr21.6%
unpow221.6%
rem-sqrt-square35.8%
Simplified35.8%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000017e-86Initial program 79.6%
associate-*l/74.4%
associate-/l*79.5%
unpow279.5%
sqr-neg79.5%
sin-neg79.5%
sin-neg79.5%
unpow279.5%
unpow279.5%
sin-neg79.5%
sin-neg79.5%
sqr-neg79.5%
unpow279.5%
Simplified99.8%
Taylor expanded in kx around 0 38.6%
if 2.00000000000000017e-86 < (sin.f64 kx) < 1e-51Initial program 99.4%
associate-*l/99.8%
associate-/l*99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
unpow299.8%
sin-neg99.8%
sin-neg99.8%
sqr-neg99.8%
unpow299.8%
Simplified99.8%
Taylor expanded in ky around 0 65.0%
if 1e-51 < (sin.f64 kx) < 1e-22Initial program 100.0%
associate-*l/100.0%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.5%
clear-num99.0%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 50.9%
associate-/r/50.9%
*-inverses50.9%
add-sqr-sqrt0.5%
*-un-lft-identity0.5%
sqrt-unprod18.0%
pow218.0%
Applied egg-rr18.0%
unpow218.0%
rem-sqrt-square18.0%
Simplified18.0%
if 1e-22 < (sin.f64 kx) Initial program 99.6%
associate-*l/98.3%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.7%
associate-*r/98.3%
hypot-undefine98.3%
unpow298.3%
unpow298.3%
+-commutative98.3%
associate-*l/99.6%
*-commutative99.6%
clear-num99.4%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 64.8%
Final simplification44.0%
(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 90.6%
associate-*l/88.0%
associate-/l*90.6%
unpow290.6%
sqr-neg90.6%
sin-neg90.6%
sin-neg90.6%
unpow290.6%
unpow290.6%
sin-neg90.6%
sin-neg90.6%
sqr-neg90.6%
unpow290.6%
Simplified99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 2e-44) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-44) {
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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-44) 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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-44) {
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.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-44: 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-44) 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-44) 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.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-44], 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.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in kx around 0 2.5%
associate-/r/2.5%
*-inverses2.5%
add-sqr-sqrt1.0%
*-un-lft-identity1.0%
sqrt-unprod29.3%
pow229.3%
Applied egg-rr29.3%
unpow229.3%
rem-sqrt-square37.3%
Simplified37.3%
if -0.0050000000000000001 < (sin.f64 ky) < 1.99999999999999991e-44Initial program 81.4%
associate-*l/76.6%
associate-/l*81.5%
unpow281.5%
sqr-neg81.5%
sin-neg81.5%
sin-neg81.5%
unpow281.5%
unpow281.5%
sin-neg81.5%
sin-neg81.5%
sqr-neg81.5%
unpow281.5%
Simplified99.7%
Taylor expanded in ky around 0 43.3%
associate-/l*46.6%
Simplified46.6%
if 1.99999999999999991e-44 < (sin.f64 ky) Initial program 99.9%
associate-*l/99.1%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 64.0%
Final simplification47.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 2e-44) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-44) {
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) <= (-0.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-44) 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) <= -0.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-44) {
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) <= -0.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-44: 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) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-44) 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) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-44) 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], -0.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-44], 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 -0.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in kx around 0 2.5%
associate-/r/2.5%
*-inverses2.5%
add-sqr-sqrt1.0%
*-un-lft-identity1.0%
sqrt-unprod29.3%
pow229.3%
Applied egg-rr29.3%
unpow229.3%
rem-sqrt-square37.3%
Simplified37.3%
if -0.0050000000000000001 < (sin.f64 ky) < 1.99999999999999991e-44Initial program 81.4%
associate-*l/76.6%
associate-/l*81.5%
unpow281.5%
sqr-neg81.5%
sin-neg81.5%
sin-neg81.5%
unpow281.5%
unpow281.5%
sin-neg81.5%
sin-neg81.5%
sqr-neg81.5%
unpow281.5%
Simplified99.7%
associate-*r/87.7%
hypot-undefine76.6%
unpow276.6%
unpow276.6%
+-commutative76.6%
associate-*l/81.4%
*-commutative81.4%
clear-num81.4%
un-div-inv81.5%
+-commutative81.5%
unpow281.5%
unpow281.5%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 46.6%
if 1.99999999999999991e-44 < (sin.f64 ky) Initial program 99.9%
associate-*l/99.1%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 64.0%
Final simplification47.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.02) (* ky (/ th kx)) (if (<= (sin kx) 2e-35) (sin th) (* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.02) {
tmp = ky * (th / kx);
} else if (sin(kx) <= 2e-35) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.02d0)) then
tmp = ky * (th / kx)
else if (sin(kx) <= 2d-35) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = ky * (th / kx);
} else if (Math.sin(kx) <= 2e-35) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.02: tmp = ky * (th / kx) elif math.sin(kx) <= 2e-35: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.02) tmp = Float64(ky * Float64(th / kx)); elseif (sin(kx) <= 2e-35) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.02) tmp = ky * (th / kx); elseif (sin(kx) <= 2e-35) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-35], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-35}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 15.5%
Taylor expanded in th around 0 15.1%
associate-/l*15.1%
Simplified15.1%
Taylor expanded in kx around 0 16.2%
associate-/l*16.4%
Simplified16.4%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000002e-35Initial program 81.6%
associate-*l/77.0%
associate-/l*81.6%
unpow281.6%
sqr-neg81.6%
sin-neg81.6%
sin-neg81.6%
unpow281.6%
unpow281.6%
sin-neg81.6%
sin-neg81.6%
sqr-neg81.6%
unpow281.6%
Simplified99.8%
Taylor expanded in kx around 0 38.8%
if 2.00000000000000002e-35 < (sin.f64 kx) Initial program 99.6%
associate-*l/98.3%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.7%
Taylor expanded in ky around 0 54.9%
Taylor expanded in th around 0 26.8%
associate-/l*28.1%
Simplified28.1%
Final simplification30.2%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 3.7e-179)
(* (sin th) (/ ky kx))
(if (<= ky 1.12e-82)
(fabs (* th (/ ky (sin kx))))
(if (<= ky 4.3e+40) (sin th) (fabs (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.7e-179) {
tmp = sin(th) * (ky / kx);
} else if (ky <= 1.12e-82) {
tmp = fabs((th * (ky / sin(kx))));
} else if (ky <= 4.3e+40) {
tmp = sin(th);
} else {
tmp = fabs(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 <= 3.7d-179) then
tmp = sin(th) * (ky / kx)
else if (ky <= 1.12d-82) then
tmp = abs((th * (ky / sin(kx))))
else if (ky <= 4.3d+40) then
tmp = sin(th)
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.7e-179) {
tmp = Math.sin(th) * (ky / kx);
} else if (ky <= 1.12e-82) {
tmp = Math.abs((th * (ky / Math.sin(kx))));
} else if (ky <= 4.3e+40) {
tmp = Math.sin(th);
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.7e-179: tmp = math.sin(th) * (ky / kx) elif ky <= 1.12e-82: tmp = math.fabs((th * (ky / math.sin(kx)))) elif ky <= 4.3e+40: tmp = math.sin(th) else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.7e-179) tmp = Float64(sin(th) * Float64(ky / kx)); elseif (ky <= 1.12e-82) tmp = abs(Float64(th * Float64(ky / sin(kx)))); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.7e-179) tmp = sin(th) * (ky / kx); elseif (ky <= 1.12e-82) tmp = abs((th * (ky / sin(kx)))); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.7e-179], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 1.12e-82], N[Abs[N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ky, 4.3e+40], N[Sin[th], $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.7 \cdot 10^{-179}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{elif}\;ky \leq 1.12 \cdot 10^{-82}:\\
\;\;\;\;\left|th \cdot \frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;ky \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < 3.6999999999999999e-179Initial program 85.3%
associate-*l/82.3%
associate-/l*85.3%
unpow285.3%
sqr-neg85.3%
sin-neg85.3%
sin-neg85.3%
unpow285.3%
unpow285.3%
sin-neg85.3%
sin-neg85.3%
sqr-neg85.3%
unpow285.3%
Simplified99.7%
Taylor expanded in ky around 0 28.5%
Taylor expanded in kx around 0 20.0%
*-commutative20.0%
associate-/l*22.8%
Simplified22.8%
if 3.6999999999999999e-179 < ky < 1.12e-82Initial program 94.9%
associate-*l/91.1%
associate-/l*95.0%
unpow295.0%
sqr-neg95.0%
sin-neg95.0%
sin-neg95.0%
unpow295.0%
unpow295.0%
sin-neg95.0%
sin-neg95.0%
sqr-neg95.0%
unpow295.0%
Simplified99.9%
Taylor expanded in ky around 0 42.5%
Taylor expanded in th around 0 28.5%
associate-/l*28.1%
Simplified28.1%
add-sqr-sqrt20.5%
sqrt-unprod24.0%
pow224.0%
associate-*r/24.1%
*-commutative24.1%
Applied egg-rr24.1%
unpow224.1%
rem-sqrt-square31.3%
associate-/l*31.0%
Simplified31.0%
if 1.12e-82 < ky < 4.3000000000000002e40Initial program 99.9%
associate-*l/95.3%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 54.5%
if 4.3000000000000002e40 < ky Initial program 99.8%
associate-*l/99.6%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 22.2%
associate-/r/22.2%
*-inverses22.2%
add-sqr-sqrt11.3%
*-un-lft-identity11.3%
sqrt-unprod28.0%
pow228.0%
Applied egg-rr28.0%
unpow228.0%
rem-sqrt-square33.7%
Simplified33.7%
Final simplification29.1%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 1.22e-177)
(* (sin th) (/ ky kx))
(if (<= ky 3.5e-81)
(* ky (fabs (/ th (sin kx))))
(if (<= ky 4.3e+40) (sin th) (fabs (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.22e-177) {
tmp = sin(th) * (ky / kx);
} else if (ky <= 3.5e-81) {
tmp = ky * fabs((th / sin(kx)));
} else if (ky <= 4.3e+40) {
tmp = sin(th);
} else {
tmp = fabs(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.22d-177) then
tmp = sin(th) * (ky / kx)
else if (ky <= 3.5d-81) then
tmp = ky * abs((th / sin(kx)))
else if (ky <= 4.3d+40) then
tmp = sin(th)
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.22e-177) {
tmp = Math.sin(th) * (ky / kx);
} else if (ky <= 3.5e-81) {
tmp = ky * Math.abs((th / Math.sin(kx)));
} else if (ky <= 4.3e+40) {
tmp = Math.sin(th);
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.22e-177: tmp = math.sin(th) * (ky / kx) elif ky <= 3.5e-81: tmp = ky * math.fabs((th / math.sin(kx))) elif ky <= 4.3e+40: tmp = math.sin(th) else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.22e-177) tmp = Float64(sin(th) * Float64(ky / kx)); elseif (ky <= 3.5e-81) tmp = Float64(ky * abs(Float64(th / sin(kx)))); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.22e-177) tmp = sin(th) * (ky / kx); elseif (ky <= 3.5e-81) tmp = ky * abs((th / sin(kx))); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.22e-177], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 3.5e-81], N[(ky * N[Abs[N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 4.3e+40], N[Sin[th], $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.22 \cdot 10^{-177}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{elif}\;ky \leq 3.5 \cdot 10^{-81}:\\
\;\;\;\;ky \cdot \left|\frac{th}{\sin kx}\right|\\
\mathbf{elif}\;ky \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < 1.22e-177Initial program 85.3%
associate-*l/82.3%
associate-/l*85.3%
unpow285.3%
sqr-neg85.3%
sin-neg85.3%
sin-neg85.3%
unpow285.3%
unpow285.3%
sin-neg85.3%
sin-neg85.3%
sqr-neg85.3%
unpow285.3%
Simplified99.7%
Taylor expanded in ky around 0 28.5%
Taylor expanded in kx around 0 20.0%
*-commutative20.0%
associate-/l*22.8%
Simplified22.8%
if 1.22e-177 < ky < 3.49999999999999986e-81Initial program 94.9%
associate-*l/91.1%
associate-/l*95.0%
unpow295.0%
sqr-neg95.0%
sin-neg95.0%
sin-neg95.0%
unpow295.0%
unpow295.0%
sin-neg95.0%
sin-neg95.0%
sqr-neg95.0%
unpow295.0%
Simplified99.9%
Taylor expanded in ky around 0 42.5%
Taylor expanded in th around 0 28.5%
associate-/l*28.1%
Simplified28.1%
add-sqr-sqrt15.7%
sqrt-unprod26.5%
pow226.5%
Applied egg-rr26.5%
unpow226.5%
rem-sqrt-square30.9%
Simplified30.9%
if 3.49999999999999986e-81 < ky < 4.3000000000000002e40Initial program 99.9%
associate-*l/95.3%
associate-/l*99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
sqr-neg99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 54.5%
if 4.3000000000000002e40 < ky Initial program 99.8%
associate-*l/99.6%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 22.2%
associate-/r/22.2%
*-inverses22.2%
add-sqr-sqrt11.3%
*-un-lft-identity11.3%
sqrt-unprod28.0%
pow228.0%
Applied egg-rr28.0%
unpow228.0%
rem-sqrt-square33.7%
Simplified33.7%
Final simplification29.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.85e-114) (* (sin th) (/ ky kx)) (if (<= ky 4.3e+40) (sin th) (fabs (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.85e-114) {
tmp = sin(th) * (ky / kx);
} else if (ky <= 4.3e+40) {
tmp = sin(th);
} else {
tmp = fabs(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.85d-114) then
tmp = sin(th) * (ky / kx)
else if (ky <= 4.3d+40) then
tmp = sin(th)
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.85e-114) {
tmp = Math.sin(th) * (ky / kx);
} else if (ky <= 4.3e+40) {
tmp = Math.sin(th);
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.85e-114: tmp = math.sin(th) * (ky / kx) elif ky <= 4.3e+40: tmp = math.sin(th) else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.85e-114) tmp = Float64(sin(th) * Float64(ky / kx)); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.85e-114) tmp = sin(th) * (ky / kx); elseif (ky <= 4.3e+40) tmp = sin(th); else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.85e-114], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 4.3e+40], N[Sin[th], $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.85 \cdot 10^{-114}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{elif}\;ky \leq 4.3 \cdot 10^{+40}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < 1.84999999999999982e-114Initial program 85.5%
associate-*l/82.2%
associate-/l*85.4%
unpow285.4%
sqr-neg85.4%
sin-neg85.4%
sin-neg85.4%
unpow285.4%
unpow285.4%
sin-neg85.4%
sin-neg85.4%
sqr-neg85.4%
unpow285.4%
Simplified99.7%
Taylor expanded in ky around 0 29.7%
Taylor expanded in kx around 0 20.9%
*-commutative20.9%
associate-/l*23.4%
Simplified23.4%
if 1.84999999999999982e-114 < ky < 4.3000000000000002e40Initial program 99.8%
associate-*l/96.7%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 47.1%
if 4.3000000000000002e40 < ky Initial program 99.8%
associate-*l/99.6%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 22.2%
associate-/r/22.2%
*-inverses22.2%
add-sqr-sqrt11.3%
*-un-lft-identity11.3%
sqrt-unprod28.0%
pow228.0%
Applied egg-rr28.0%
unpow228.0%
rem-sqrt-square33.7%
Simplified33.7%
Final simplification29.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.15e-114) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.15e-114) {
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 <= 1.15d-114) 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 <= 1.15e-114) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.15e-114: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.15e-114) 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 <= 1.15e-114) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.15e-114], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.15 \cdot 10^{-114}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.15e-114Initial program 85.5%
associate-*l/82.2%
associate-/l*85.4%
unpow285.4%
sqr-neg85.4%
sin-neg85.4%
sin-neg85.4%
unpow285.4%
unpow285.4%
sin-neg85.4%
sin-neg85.4%
sqr-neg85.4%
unpow285.4%
Simplified99.7%
Taylor expanded in ky around 0 29.7%
Taylor expanded in kx around 0 20.9%
associate-/l*23.5%
Simplified23.5%
if 1.15e-114 < ky Initial program 99.8%
associate-*l/98.3%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 33.0%
Final simplification26.9%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.42e-114) (* (sin th) (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.42e-114) {
tmp = sin(th) * (ky / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.42d-114) then
tmp = sin(th) * (ky / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.42e-114) {
tmp = Math.sin(th) * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.42e-114: tmp = math.sin(th) * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.42e-114) tmp = Float64(sin(th) * Float64(ky / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.42e-114) tmp = sin(th) * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.42e-114], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.42 \cdot 10^{-114}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.42e-114Initial program 85.5%
associate-*l/82.2%
associate-/l*85.4%
unpow285.4%
sqr-neg85.4%
sin-neg85.4%
sin-neg85.4%
unpow285.4%
unpow285.4%
sin-neg85.4%
sin-neg85.4%
sqr-neg85.4%
unpow285.4%
Simplified99.7%
Taylor expanded in ky around 0 29.7%
Taylor expanded in kx around 0 20.9%
*-commutative20.9%
associate-/l*23.4%
Simplified23.4%
if 1.42e-114 < ky Initial program 99.8%
associate-*l/98.3%
associate-/l*99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
sqr-neg99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 33.0%
Final simplification26.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 2.8e-35) (sin th) (* ky (/ th kx))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.8e-35) {
tmp = sin(th);
} else {
tmp = ky * (th / kx);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 2.8d-35) then
tmp = sin(th)
else
tmp = ky * (th / kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.8e-35) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 2.8e-35: tmp = math.sin(th) else: tmp = ky * (th / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.8e-35) tmp = sin(th); else tmp = Float64(ky * Float64(th / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 2.8e-35) tmp = sin(th); else tmp = ky * (th / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.8e-35], N[Sin[th], $MachinePrecision], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.8 \cdot 10^{-35}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\end{array}
\end{array}
if kx < 2.8e-35Initial program 87.4%
associate-*l/84.2%
associate-/l*87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
sqr-neg87.3%
unpow287.3%
Simplified99.7%
Taylor expanded in kx around 0 29.1%
if 2.8e-35 < kx Initial program 99.6%
associate-*l/98.4%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.6%
Taylor expanded in ky around 0 40.8%
Taylor expanded in th around 0 27.9%
associate-/l*29.0%
Simplified29.0%
Taylor expanded in kx around 0 27.3%
associate-/l*28.6%
Simplified28.6%
Final simplification28.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 2.3e-109) th (* ky (/ th kx))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.3e-109) {
tmp = th;
} else {
tmp = ky * (th / kx);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 2.3d-109) then
tmp = th
else
tmp = ky * (th / kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.3e-109) {
tmp = th;
} else {
tmp = ky * (th / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 2.3e-109: tmp = th else: tmp = ky * (th / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.3e-109) tmp = th; else tmp = Float64(ky * Float64(th / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 2.3e-109) tmp = th; else tmp = ky * (th / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.3e-109], th, N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.3 \cdot 10^{-109}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\end{array}
\end{array}
if kx < 2.3000000000000001e-109Initial program 86.3%
associate-*l/82.9%
associate-/l*86.3%
unpow286.3%
sqr-neg86.3%
sin-neg86.3%
sin-neg86.3%
unpow286.3%
unpow286.3%
sin-neg86.3%
sin-neg86.3%
sqr-neg86.3%
unpow286.3%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 27.9%
Taylor expanded in th around 0 14.6%
if 2.3000000000000001e-109 < kx Initial program 99.6%
associate-*l/98.6%
associate-/l*99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
sqr-neg99.5%
unpow299.5%
Simplified99.6%
Taylor expanded in ky around 0 40.0%
Taylor expanded in th around 0 24.6%
associate-/l*25.6%
Simplified25.6%
Taylor expanded in kx around 0 24.2%
associate-/l*25.2%
Simplified25.2%
Final simplification18.0%
(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 90.6%
associate-*l/88.0%
associate-/l*90.6%
unpow290.6%
sqr-neg90.6%
sin-neg90.6%
sin-neg90.6%
unpow290.6%
unpow290.6%
sin-neg90.6%
sin-neg90.6%
sqr-neg90.6%
unpow290.6%
Simplified99.7%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 23.0%
Taylor expanded in th around 0 11.7%
Final simplification11.7%
herbie shell --seed 2024044
(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)))