
(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 12 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}
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.08) (* (sin th) (fabs (/ ky (sin kx)))) (if (<= (sin kx) 2e-143) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.08) {
tmp = sin(th) * fabs((ky / sin(kx)));
} else if (sin(kx) <= 2e-143) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.08d0)) then
tmp = sin(th) * abs((ky / sin(kx)))
else if (sin(kx) <= 2d-143) then
tmp = sin(th)
else
tmp = sin(th) * (sin(ky) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.08) {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-143) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.08: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) elif math.sin(kx) <= 2e-143: tmp = math.sin(th) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.08) tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); elseif (sin(kx) <= 2e-143) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.08) tmp = sin(th) * abs((ky / sin(kx))); elseif (sin(kx) <= 2e-143) tmp = sin(th); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.08], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-143], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.08:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-143}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
(FPCore (kx ky th)
:precision binary64
(if (<= th 215.0)
(/
(sin ky)
(* (hypot (sin kx) (sin ky)) (+ (/ 1.0 th) (* th 0.16666666666666666))))
(/ (* ky (sin th)) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 215.0) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) * ((1.0 / th) + (th * 0.16666666666666666)));
} else {
tmp = (ky * sin(th)) / hypot(sin(ky), sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 215.0) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) * ((1.0 / th) + (th * 0.16666666666666666)));
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(ky), Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 215.0: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) * ((1.0 / th) + (th * 0.16666666666666666))) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(ky), math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 215.0) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) * Float64(Float64(1.0 / th) + Float64(th * 0.16666666666666666)))); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(ky), sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 215.0) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) * ((1.0 / th) + (th * 0.16666666666666666))); else tmp = (ky * sin(th)) / hypot(sin(ky), sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 215.0], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] * N[(N[(1.0 / th), $MachinePrecision] + N[(th * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 215:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin kx, \sin ky\right) \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\end{array}
\end{array}
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.0064)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(if (or (<= th 1.05e+259) (not (<= th 2.5e+288)))
(* (sin th) (fabs (/ (sin ky) (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0064) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else if ((th <= 1.05e+259) || !(th <= 2.5e+288)) {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0064) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else if ((th <= 1.05e+259) || !(th <= 2.5e+288)) {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0064: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) elif (th <= 1.05e+259) or not (th <= 2.5e+288): tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0064) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); elseif ((th <= 1.05e+259) || !(th <= 2.5e+288)) tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0064) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); elseif ((th <= 1.05e+259) || ~((th <= 2.5e+288))) tmp = sin(th) * abs((sin(ky) / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0064], 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[th, 1.05e+259], N[Not[LessEqual[th, 2.5e+288]], $MachinePrecision]], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0064:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{elif}\;th \leq 1.05 \cdot 10^{+259} \lor \neg \left(th \leq 2.5 \cdot 10^{+288}\right):\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.08) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 5e-140) (sin th) (* (sin th) (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.08) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 5e-140) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.08d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 5d-140) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.08) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-140) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.08: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 5e-140: tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.08) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-140) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.08) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-140) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.08], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-140], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.08:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-140}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= th 0.0014) (/ (sin ky) (/ (hypot (sin kx) (sin ky)) th)) (/ (* ky (sin th)) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0014) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else {
tmp = (ky * sin(th)) / hypot(sin(ky), sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0014) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(ky), Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0014: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(ky), math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0014) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(ky), sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0014) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); else tmp = (ky * sin(th)) / hypot(sin(ky), sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0014], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0014:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.8e-140) (sin th) (* (sin th) (fabs (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-140) {
tmp = sin(th);
} else {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6.8d-140) then
tmp = sin(th)
else
tmp = sin(th) * abs((sin(ky) / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-140) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.8e-140: tmp = math.sin(th) else: tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.8e-140) tmp = sin(th); else tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.8e-140) tmp = sin(th); else tmp = sin(th) * abs((sin(ky) / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.8e-140], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.8 \cdot 10^{-140}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.8e-140) (sin th) (* (sin th) (fabs (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-140) {
tmp = sin(th);
} else {
tmp = sin(th) * fabs((ky / sin(kx)));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6.8d-140) then
tmp = sin(th)
else
tmp = sin(th) * abs((ky / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-140) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.8e-140: tmp = math.sin(th) else: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.8e-140) tmp = sin(th); else tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.8e-140) tmp = sin(th); else tmp = sin(th) * abs((ky / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.8e-140], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.8 \cdot 10^{-140}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= kx 7e-140) (sin th) (* (sin th) (/ ky (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 7e-140) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 7d-140) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 7e-140) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 7e-140: tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 7e-140) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 7e-140) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 7e-140], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 7 \cdot 10^{-140}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.2e-159) (* (sin th) (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.2e-159) {
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 <= 3.2d-159) 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 <= 3.2e-159) {
tmp = Math.sin(th) * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.2e-159: tmp = math.sin(th) * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.2e-159) 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 <= 3.2e-159) tmp = sin(th) * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.2e-159], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.2 \cdot 10^{-159}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.25e-192) (/ ky (/ kx th)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.25e-192) {
tmp = ky / (kx / th);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.25d-192) then
tmp = ky / (kx / th)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.25e-192) {
tmp = ky / (kx / th);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.25e-192: tmp = ky / (kx / th) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.25e-192) tmp = Float64(ky / Float64(kx / th)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.25e-192) tmp = ky / (kx / th); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.25e-192], N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.25 \cdot 10^{-192}:\\
\;\;\;\;\frac{ky}{\frac{kx}{th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
(FPCore (kx ky th) :precision binary64 (/ ky (/ kx th)))
double code(double kx, double ky, double th) {
return ky / (kx / th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = ky / (kx / th)
end function
public static double code(double kx, double ky, double th) {
return ky / (kx / th);
}
def code(kx, ky, th): return ky / (kx / th)
function code(kx, ky, th) return Float64(ky / Float64(kx / th)) end
function tmp = code(kx, ky, th) tmp = ky / (kx / th); end
code[kx_, ky_, th_] := N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{ky}{\frac{kx}{th}}
\end{array}
herbie shell --seed 2023347
(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)))