
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin 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 95.1%
+-commutative95.1%
unpow295.1%
unpow295.1%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.01) (* ky (/ (sin th) (fabs (sin kx)))) (if (<= (sin kx) 1e-81) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.01) {
tmp = ky * (sin(th) / fabs(sin(kx)));
} else if (sin(kx) <= 1e-81) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(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.01d0)) then
tmp = ky * (sin(th) / abs(sin(kx)))
else if (sin(kx) <= 1d-81) then
tmp = sin(th)
else
tmp = sin(ky) * (sin(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.01) {
tmp = ky * (Math.sin(th) / Math.abs(Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-81) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.01: tmp = ky * (math.sin(th) / math.fabs(math.sin(kx))) elif math.sin(kx) <= 1e-81: tmp = math.sin(th) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.01) tmp = Float64(ky * Float64(sin(th) / abs(sin(kx)))); elseif (sin(kx) <= 1e-81) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.01) tmp = ky * (sin(th) / abs(sin(kx))); elseif (sin(kx) <= 1e-81) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.01], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-81], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.01:\\
\;\;\;\;ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\mathbf{elif}\;\sin kx \leq 10^{-81}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0100000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
Taylor expanded in ky around 0 9.8%
associate-/l*9.8%
Simplified9.8%
add-sqr-sqrt0.0%
sqrt-prod26.2%
rem-sqrt-square26.2%
Applied egg-rr57.5%
if -0.0100000000000000002 < (sin.f64 kx) < 9.9999999999999996e-82Initial program 88.9%
unpow288.9%
sqr-neg88.9%
sin-neg88.9%
sin-neg88.9%
unpow288.9%
associate-*l/82.8%
associate-/l*88.7%
unpow288.7%
Simplified99.7%
Taylor expanded in kx around 0 35.8%
if 9.9999999999999996e-82 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 57.0%
Final simplification48.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.01) (* ky (/ (sin th) (fabs (sin kx)))) (if (<= (sin kx) 1e-81) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.01) {
tmp = ky * (sin(th) / fabs(sin(kx)));
} else if (sin(kx) <= 1e-81) {
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.01d0)) then
tmp = ky * (sin(th) / abs(sin(kx)))
else if (sin(kx) <= 1d-81) 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.01) {
tmp = ky * (Math.sin(th) / Math.abs(Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-81) {
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.01: tmp = ky * (math.sin(th) / math.fabs(math.sin(kx))) elif math.sin(kx) <= 1e-81: 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.01) tmp = Float64(ky * Float64(sin(th) / abs(sin(kx)))); elseif (sin(kx) <= 1e-81) 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.01) tmp = ky * (sin(th) / abs(sin(kx))); elseif (sin(kx) <= 1e-81) 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.01], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-81], 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.01:\\
\;\;\;\;ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\mathbf{elif}\;\sin kx \leq 10^{-81}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0100000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
Taylor expanded in ky around 0 9.8%
associate-/l*9.8%
Simplified9.8%
add-sqr-sqrt0.0%
sqrt-prod26.2%
rem-sqrt-square26.2%
Applied egg-rr57.5%
if -0.0100000000000000002 < (sin.f64 kx) < 9.9999999999999996e-82Initial program 88.9%
unpow288.9%
sqr-neg88.9%
sin-neg88.9%
sin-neg88.9%
unpow288.9%
associate-*l/82.8%
associate-/l*88.7%
unpow288.7%
Simplified99.7%
Taylor expanded in kx around 0 35.8%
if 9.9999999999999996e-82 < (sin.f64 kx) Initial program 99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 56.9%
Final simplification48.3%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 95.1%
unpow295.1%
sqr-neg95.1%
sin-neg95.1%
sin-neg95.1%
unpow295.1%
associate-*l/92.5%
associate-/l*95.0%
unpow295.0%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 1.7e-5)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (or (<= kx 1.05e+214) (not (<= kx 7e+246)))
(/ (sin ky) (/ (fabs (sin kx)) (sin th)))
(/ (sin ky) (* (hypot (sin ky) (sin kx)) (/ 1.0 th))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if ((kx <= 1.05e+214) || !(kx <= 7e+246)) {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
} else {
tmp = sin(ky) / (hypot(sin(ky), sin(kx)) * (1.0 / th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if ((kx <= 1.05e+214) || !(kx <= 7e+246)) {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), Math.sin(kx)) * (1.0 / th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e-5: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif (kx <= 1.05e+214) or not (kx <= 7e+246): tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) else: tmp = math.sin(ky) / (math.hypot(math.sin(ky), math.sin(kx)) * (1.0 / th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif ((kx <= 1.05e+214) || !(kx <= 7e+246)) tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); else tmp = Float64(sin(ky) / Float64(hypot(sin(ky), sin(kx)) * Float64(1.0 / th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.7e-5) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); elseif ((kx <= 1.05e+214) || ~((kx <= 7e+246))) tmp = sin(ky) / (abs(sin(kx)) / sin(th)); else tmp = sin(ky) / (hypot(sin(ky), sin(kx)) * (1.0 / th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[kx, 1.05e+214], N[Not[LessEqual[kx, 7e+246]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] * N[(1.0 / th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;kx \leq 1.05 \cdot 10^{+214} \lor \neg \left(kx \leq 7 \cdot 10^{+246}\right):\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right) \cdot \frac{1}{th}}\\
\end{array}
\end{array}
if kx < 1.7e-5Initial program 93.3%
+-commutative93.3%
unpow293.3%
unpow293.3%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in kx around 0 71.5%
if 1.7e-5 < kx < 1.05e214 or 6.99999999999999951e246 < kx Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.3%
associate-/l*99.2%
unpow299.2%
Simplified99.3%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 31.3%
add-sqr-sqrt10.4%
sqrt-prod23.8%
rem-sqrt-square23.8%
Applied egg-rr61.2%
if 1.05e214 < kx < 6.99999999999999951e246Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.2%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 73.6%
+-commutative73.6%
unpow273.6%
unpow273.6%
hypot-undefine73.6%
Simplified73.6%
Final simplification69.0%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 1.7e-5)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (or (<= kx 9.4e+213) (not (<= kx 9.5e+245)))
(/ (sin ky) (/ (fabs (sin kx)) (sin th)))
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if ((kx <= 9.4e+213) || !(kx <= 9.5e+245)) {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
} else {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if ((kx <= 9.4e+213) || !(kx <= 9.5e+245)) {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e-5: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif (kx <= 9.4e+213) or not (kx <= 9.5e+245): tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) else: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif ((kx <= 9.4e+213) || !(kx <= 9.5e+245)) tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); else tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.7e-5) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); elseif ((kx <= 9.4e+213) || ~((kx <= 9.5e+245))) tmp = sin(ky) / (abs(sin(kx)) / sin(th)); else tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[kx, 9.4e+213], N[Not[LessEqual[kx, 9.5e+245]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;kx \leq 9.4 \cdot 10^{+213} \lor \neg \left(kx \leq 9.5 \cdot 10^{+245}\right):\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\end{array}
\end{array}
if kx < 1.7e-5Initial program 93.3%
+-commutative93.3%
unpow293.3%
unpow293.3%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in kx around 0 71.5%
if 1.7e-5 < kx < 9.3999999999999995e213 or 9.49999999999999939e245 < kx Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.3%
associate-/l*99.2%
unpow299.2%
Simplified99.3%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 32.3%
add-sqr-sqrt11.7%
sqrt-prod24.9%
rem-sqrt-square24.9%
Applied egg-rr61.7%
if 9.3999999999999995e213 < kx < 9.49999999999999939e245Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.3%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 70.9%
associate-*l/70.9%
+-commutative70.9%
unpow270.9%
unpow270.9%
hypot-undefine70.9%
*-lft-identity70.9%
hypot-undefine70.9%
unpow270.9%
unpow270.9%
+-commutative70.9%
unpow270.9%
unpow270.9%
hypot-define70.9%
Simplified70.9%
Final simplification68.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (fabs (sin kx)))) (if (<= (sin kx) 2e-72) (sin th) (* ky (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.15) {
tmp = ky * (th / fabs(sin(kx)));
} else if (sin(kx) <= 2e-72) {
tmp = sin(th);
} else {
tmp = ky * (sin(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.15d0)) then
tmp = ky * (th / abs(sin(kx)))
else if (sin(kx) <= 2d-72) then
tmp = sin(th)
else
tmp = ky * (sin(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.15) {
tmp = ky * (th / Math.abs(Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-72) {
tmp = Math.sin(th);
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.15: tmp = ky * (th / math.fabs(math.sin(kx))) elif math.sin(kx) <= 2e-72: tmp = math.sin(th) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.15) tmp = Float64(ky * Float64(th / abs(sin(kx)))); elseif (sin(kx) <= 2e-72) tmp = sin(th); else tmp = Float64(ky * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.15) tmp = ky * (th / abs(sin(kx))); elseif (sin(kx) <= 2e-72) tmp = sin(th); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.15], N[(ky * N[(th / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-72], N[Sin[th], $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.15:\\
\;\;\;\;ky \cdot \frac{th}{\left|\sin kx\right|}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-72}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.2%
unpow299.2%
Simplified99.3%
Taylor expanded in ky around 0 7.2%
associate-/l*7.2%
Simplified7.2%
Taylor expanded in th around 0 6.7%
add-sqr-sqrt0.0%
sqrt-prod25.0%
rem-sqrt-square25.0%
Applied egg-rr25.0%
if -0.149999999999999994 < (sin.f64 kx) < 1.9999999999999999e-72Initial program 89.4%
unpow289.4%
sqr-neg89.4%
sin-neg89.4%
sin-neg89.4%
unpow289.4%
associate-*l/83.5%
associate-/l*89.2%
unpow289.2%
Simplified99.7%
Taylor expanded in kx around 0 34.6%
if 1.9999999999999999e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 49.0%
associate-/l*49.1%
Simplified49.1%
Final simplification37.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (fabs (sin kx)))) (if (<= (sin kx) 2e-72) (sin th) (* (sin th) (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.15) {
tmp = ky * (th / fabs(sin(kx)));
} else if (sin(kx) <= 2e-72) {
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.15d0)) then
tmp = ky * (th / abs(sin(kx)))
else if (sin(kx) <= 2d-72) 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.15) {
tmp = ky * (th / Math.abs(Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-72) {
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.15: tmp = ky * (th / math.fabs(math.sin(kx))) elif math.sin(kx) <= 2e-72: 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.15) tmp = Float64(ky * Float64(th / abs(sin(kx)))); elseif (sin(kx) <= 2e-72) 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.15) tmp = ky * (th / abs(sin(kx))); elseif (sin(kx) <= 2e-72) 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.15], N[(ky * N[(th / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-72], 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.15:\\
\;\;\;\;ky \cdot \frac{th}{\left|\sin kx\right|}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-72}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.2%
unpow299.2%
Simplified99.3%
Taylor expanded in ky around 0 7.2%
associate-/l*7.2%
Simplified7.2%
Taylor expanded in th around 0 6.7%
add-sqr-sqrt0.0%
sqrt-prod25.0%
rem-sqrt-square25.0%
Applied egg-rr25.0%
if -0.149999999999999994 < (sin.f64 kx) < 1.9999999999999999e-72Initial program 89.4%
unpow289.4%
sqr-neg89.4%
sin-neg89.4%
sin-neg89.4%
unpow289.4%
associate-*l/83.5%
associate-/l*89.2%
unpow289.2%
Simplified99.7%
Taylor expanded in kx around 0 34.6%
if 1.9999999999999999e-72 < (sin.f64 kx) Initial program 99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 49.1%
Final simplification37.0%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.7e-5) (* (sin ky) (/ (sin th) (hypot (sin ky) kx))) (/ (sin ky) (/ (fabs (sin kx)) (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e-5: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e-5) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.7e-5) tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); else tmp = sin(ky) / (abs(sin(kx)) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e-5], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\end{array}
\end{array}
if kx < 1.7e-5Initial program 93.3%
unpow293.3%
sqr-neg93.3%
sin-neg93.3%
sin-neg93.3%
unpow293.3%
associate-*l/89.6%
associate-/l*93.2%
unpow293.2%
Simplified99.7%
Taylor expanded in kx around 0 71.4%
if 1.7e-5 < kx Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.3%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 29.2%
add-sqr-sqrt10.4%
sqrt-prod24.6%
rem-sqrt-square24.6%
Applied egg-rr59.5%
Final simplification67.8%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.7e-5) (* (sin th) (/ (sin ky) (hypot (sin ky) kx))) (/ (sin ky) (/ (fabs (sin kx)) (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e-5) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e-5: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e-5) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.7e-5) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); else tmp = sin(ky) / (abs(sin(kx)) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e-5], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\end{array}
\end{array}
if kx < 1.7e-5Initial program 93.3%
+-commutative93.3%
unpow293.3%
unpow293.3%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in kx around 0 71.5%
if 1.7e-5 < kx Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.3%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 29.2%
add-sqr-sqrt10.4%
sqrt-prod24.6%
rem-sqrt-square24.6%
Applied egg-rr59.5%
Final simplification67.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.6e-78) (sin th) (/ (sin ky) (/ (fabs (sin kx)) (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.6e-78) {
tmp = sin(th);
} else {
tmp = sin(ky) / (fabs(sin(kx)) / 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 (kx <= 3.6d-78) then
tmp = sin(th)
else
tmp = sin(ky) / (abs(sin(kx)) / sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.6e-78) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.6e-78: tmp = math.sin(th) else: tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.6e-78) tmp = sin(th); else tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.6e-78) tmp = sin(th); else tmp = sin(ky) / (abs(sin(kx)) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.6e-78], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.6 \cdot 10^{-78}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\end{array}
\end{array}
if kx < 3.6000000000000002e-78Initial program 92.8%
unpow292.8%
sqr-neg92.8%
sin-neg92.8%
sin-neg92.8%
unpow292.8%
associate-*l/88.9%
associate-/l*92.7%
unpow292.7%
Simplified99.6%
Taylor expanded in kx around 0 26.0%
if 3.6000000000000002e-78 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.3%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.3%
Applied egg-rr99.3%
Taylor expanded in ky around 0 31.6%
add-sqr-sqrt12.6%
sqrt-prod24.9%
rem-sqrt-square24.9%
Applied egg-rr57.7%
Final simplification37.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.2e-8) (* ky (/ (sin th) (fabs (sin kx)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.2e-8) {
tmp = ky * (sin(th) / fabs(sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.2d-8) then
tmp = ky * (sin(th) / abs(sin(kx)))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.2e-8) {
tmp = ky * (Math.sin(th) / Math.abs(Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.2e-8: tmp = ky * (math.sin(th) / math.fabs(math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.2e-8) tmp = Float64(ky * Float64(sin(th) / abs(sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.2e-8) tmp = ky * (sin(th) / abs(sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.2e-8], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.2 \cdot 10^{-8}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.19999999999999999e-8Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/90.6%
associate-/l*93.8%
unpow293.8%
Simplified99.6%
Taylor expanded in ky around 0 28.7%
associate-/l*31.0%
Simplified31.0%
add-sqr-sqrt16.7%
sqrt-prod25.6%
rem-sqrt-square28.2%
Applied egg-rr52.6%
if 1.19999999999999999e-8 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 32.1%
Final simplification48.3%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 6e-70)
(sin th)
(if (<= kx 600000000.0)
(* ky (/ (sin th) kx))
(fabs (/ (* ky th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6e-70) {
tmp = sin(th);
} else if (kx <= 600000000.0) {
tmp = ky * (sin(th) / kx);
} else {
tmp = fabs(((ky * th) / sin(kx)));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6d-70) then
tmp = sin(th)
else if (kx <= 600000000.0d0) then
tmp = ky * (sin(th) / kx)
else
tmp = abs(((ky * th) / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6e-70) {
tmp = Math.sin(th);
} else if (kx <= 600000000.0) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.abs(((ky * th) / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6e-70: tmp = math.sin(th) elif kx <= 600000000.0: tmp = ky * (math.sin(th) / kx) else: tmp = math.fabs(((ky * th) / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6e-70) tmp = sin(th); elseif (kx <= 600000000.0) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = abs(Float64(Float64(ky * th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6e-70) tmp = sin(th); elseif (kx <= 600000000.0) tmp = ky * (sin(th) / kx); else tmp = abs(((ky * th) / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6e-70], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 600000000.0], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(ky * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6 \cdot 10^{-70}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 600000000:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{ky \cdot th}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 6.0000000000000003e-70Initial program 92.8%
unpow292.8%
sqr-neg92.8%
sin-neg92.8%
sin-neg92.8%
unpow292.8%
associate-*l/88.9%
associate-/l*92.7%
unpow292.7%
Simplified99.6%
Taylor expanded in kx around 0 26.0%
if 6.0000000000000003e-70 < kx < 6e8Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in ky around 0 38.2%
associate-/l*38.3%
Simplified38.3%
Taylor expanded in kx around 0 38.2%
if 6e8 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.3%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
Taylor expanded in ky around 0 25.6%
associate-/l*25.6%
Simplified25.6%
Taylor expanded in th around 0 13.8%
add-sqr-sqrt12.5%
sqrt-unprod11.5%
pow211.5%
Applied egg-rr11.5%
unpow211.5%
rem-sqrt-square18.7%
associate-*r/18.7%
Simplified18.7%
Final simplification24.6%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 3.9e-72)
(sin th)
(if (<= kx 600000000.0)
(* ky (/ (sin th) kx))
(* ky (/ th (fabs (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.9e-72) {
tmp = sin(th);
} else if (kx <= 600000000.0) {
tmp = ky * (sin(th) / kx);
} else {
tmp = ky * (th / fabs(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 <= 3.9d-72) then
tmp = sin(th)
else if (kx <= 600000000.0d0) then
tmp = ky * (sin(th) / kx)
else
tmp = ky * (th / abs(sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.9e-72) {
tmp = Math.sin(th);
} else if (kx <= 600000000.0) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = ky * (th / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.9e-72: tmp = math.sin(th) elif kx <= 600000000.0: tmp = ky * (math.sin(th) / kx) else: tmp = ky * (th / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.9e-72) tmp = sin(th); elseif (kx <= 600000000.0) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = Float64(ky * Float64(th / abs(sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.9e-72) tmp = sin(th); elseif (kx <= 600000000.0) tmp = ky * (sin(th) / kx); else tmp = ky * (th / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.9e-72], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 600000000.0], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[(ky * N[(th / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.9 \cdot 10^{-72}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 600000000:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 3.9e-72Initial program 92.8%
unpow292.8%
sqr-neg92.8%
sin-neg92.8%
sin-neg92.8%
unpow292.8%
associate-*l/88.9%
associate-/l*92.7%
unpow292.7%
Simplified99.6%
Taylor expanded in kx around 0 26.0%
if 3.9e-72 < kx < 6e8Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in ky around 0 38.2%
associate-/l*38.3%
Simplified38.3%
Taylor expanded in kx around 0 38.2%
if 6e8 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.3%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
Taylor expanded in ky around 0 25.6%
associate-/l*25.6%
Simplified25.6%
Taylor expanded in th around 0 13.8%
add-sqr-sqrt10.6%
sqrt-prod25.1%
rem-sqrt-square25.1%
Applied egg-rr25.1%
Final simplification26.4%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 5.5e-179)
(* ky (/ th kx))
(if (or (<= ky 2.6e-98) (not (<= ky 6e-62)))
(sin th)
(* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.5e-179) {
tmp = ky * (th / kx);
} else if ((ky <= 2.6e-98) || !(ky <= 6e-62)) {
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 (ky <= 5.5d-179) then
tmp = ky * (th / kx)
else if ((ky <= 2.6d-98) .or. (.not. (ky <= 6d-62))) 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 (ky <= 5.5e-179) {
tmp = ky * (th / kx);
} else if ((ky <= 2.6e-98) || !(ky <= 6e-62)) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.5e-179: tmp = ky * (th / kx) elif (ky <= 2.6e-98) or not (ky <= 6e-62): tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.5e-179) tmp = Float64(ky * Float64(th / kx)); elseif ((ky <= 2.6e-98) || !(ky <= 6e-62)) 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 (ky <= 5.5e-179) tmp = ky * (th / kx); elseif ((ky <= 2.6e-98) || ~((ky <= 6e-62))) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.5e-179], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 2.6e-98], N[Not[LessEqual[ky, 6e-62]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.5 \cdot 10^{-179}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{elif}\;ky \leq 2.6 \cdot 10^{-98} \lor \neg \left(ky \leq 6 \cdot 10^{-62}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if ky < 5.5000000000000003e-179Initial program 93.7%
unpow293.7%
sqr-neg93.7%
sin-neg93.7%
sin-neg93.7%
unpow293.7%
associate-*l/90.2%
associate-/l*93.6%
unpow293.6%
Simplified99.6%
Taylor expanded in ky around 0 25.4%
associate-/l*28.3%
Simplified28.3%
Taylor expanded in th around 0 20.8%
Taylor expanded in kx around 0 16.6%
associate-/l*19.3%
Simplified19.3%
if 5.5000000000000003e-179 < ky < 2.60000000000000013e-98 or 6.0000000000000002e-62 < ky Initial program 97.4%
unpow297.4%
sqr-neg97.4%
sin-neg97.4%
sin-neg97.4%
unpow297.4%
associate-*l/96.2%
associate-/l*97.3%
unpow297.3%
Simplified99.5%
Taylor expanded in kx around 0 33.6%
if 2.60000000000000013e-98 < ky < 6.0000000000000002e-62Initial program 99.0%
unpow299.0%
sqr-neg99.0%
sin-neg99.0%
sin-neg99.0%
unpow299.0%
associate-*l/99.5%
associate-/l*99.0%
unpow299.0%
Simplified99.0%
Taylor expanded in ky around 0 67.2%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in th around 0 35.4%
Final simplification24.7%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 4.5e-172)
(* ky (/ (sin th) kx))
(if (or (<= ky 1.8e-98) (not (<= ky 6.2e-62)))
(sin th)
(* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.5e-172) {
tmp = ky * (sin(th) / kx);
} else if ((ky <= 1.8e-98) || !(ky <= 6.2e-62)) {
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 (ky <= 4.5d-172) then
tmp = ky * (sin(th) / kx)
else if ((ky <= 1.8d-98) .or. (.not. (ky <= 6.2d-62))) 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 (ky <= 4.5e-172) {
tmp = ky * (Math.sin(th) / kx);
} else if ((ky <= 1.8e-98) || !(ky <= 6.2e-62)) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.5e-172: tmp = ky * (math.sin(th) / kx) elif (ky <= 1.8e-98) or not (ky <= 6.2e-62): tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.5e-172) tmp = Float64(ky * Float64(sin(th) / kx)); elseif ((ky <= 1.8e-98) || !(ky <= 6.2e-62)) 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 (ky <= 4.5e-172) tmp = ky * (sin(th) / kx); elseif ((ky <= 1.8e-98) || ~((ky <= 6.2e-62))) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.5e-172], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 1.8e-98], N[Not[LessEqual[ky, 6.2e-62]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.5 \cdot 10^{-172}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;ky \leq 1.8 \cdot 10^{-98} \lor \neg \left(ky \leq 6.2 \cdot 10^{-62}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if ky < 4.50000000000000004e-172Initial program 93.7%
unpow293.7%
sqr-neg93.7%
sin-neg93.7%
sin-neg93.7%
unpow293.7%
associate-*l/90.2%
associate-/l*93.6%
unpow293.6%
Simplified99.6%
Taylor expanded in ky around 0 25.3%
associate-/l*28.1%
Simplified28.1%
Taylor expanded in kx around 0 21.1%
if 4.50000000000000004e-172 < ky < 1.8000000000000001e-98 or 6.1999999999999999e-62 < ky Initial program 97.4%
unpow297.4%
sqr-neg97.4%
sin-neg97.4%
sin-neg97.4%
unpow297.4%
associate-*l/96.2%
associate-/l*97.3%
unpow297.3%
Simplified99.5%
Taylor expanded in kx around 0 33.9%
if 1.8000000000000001e-98 < ky < 6.1999999999999999e-62Initial program 99.0%
unpow299.0%
sqr-neg99.0%
sin-neg99.0%
sin-neg99.0%
unpow299.0%
associate-*l/99.5%
associate-/l*99.0%
unpow299.0%
Simplified99.0%
Taylor expanded in ky around 0 67.2%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in th around 0 35.4%
Final simplification25.8%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 4.5e-172)
(* ky (/ (sin th) kx))
(if (or (<= ky 2.65e-98) (not (<= ky 6e-62)))
(sin th)
(/ (* ky th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.5e-172) {
tmp = ky * (sin(th) / kx);
} else if ((ky <= 2.65e-98) || !(ky <= 6e-62)) {
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 (ky <= 4.5d-172) then
tmp = ky * (sin(th) / kx)
else if ((ky <= 2.65d-98) .or. (.not. (ky <= 6d-62))) 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 (ky <= 4.5e-172) {
tmp = ky * (Math.sin(th) / kx);
} else if ((ky <= 2.65e-98) || !(ky <= 6e-62)) {
tmp = Math.sin(th);
} else {
tmp = (ky * th) / Math.sin(kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.5e-172: tmp = ky * (math.sin(th) / kx) elif (ky <= 2.65e-98) or not (ky <= 6e-62): tmp = math.sin(th) else: tmp = (ky * th) / math.sin(kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.5e-172) tmp = Float64(ky * Float64(sin(th) / kx)); elseif ((ky <= 2.65e-98) || !(ky <= 6e-62)) tmp = sin(th); else tmp = Float64(Float64(ky * th) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.5e-172) tmp = ky * (sin(th) / kx); elseif ((ky <= 2.65e-98) || ~((ky <= 6e-62))) tmp = sin(th); else tmp = (ky * th) / sin(kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.5e-172], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 2.65e-98], N[Not[LessEqual[ky, 6e-62]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[(ky * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.5 \cdot 10^{-172}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;ky \leq 2.65 \cdot 10^{-98} \lor \neg \left(ky \leq 6 \cdot 10^{-62}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot th}{\sin kx}\\
\end{array}
\end{array}
if ky < 4.50000000000000004e-172Initial program 93.7%
unpow293.7%
sqr-neg93.7%
sin-neg93.7%
sin-neg93.7%
unpow293.7%
associate-*l/90.2%
associate-/l*93.6%
unpow293.6%
Simplified99.6%
Taylor expanded in ky around 0 25.3%
associate-/l*28.1%
Simplified28.1%
Taylor expanded in kx around 0 21.1%
if 4.50000000000000004e-172 < ky < 2.65000000000000015e-98 or 6.0000000000000002e-62 < ky Initial program 97.4%
unpow297.4%
sqr-neg97.4%
sin-neg97.4%
sin-neg97.4%
unpow297.4%
associate-*l/96.2%
associate-/l*97.3%
unpow297.3%
Simplified99.5%
Taylor expanded in kx around 0 33.9%
if 2.65000000000000015e-98 < ky < 6.0000000000000002e-62Initial program 99.0%
unpow299.0%
sqr-neg99.0%
sin-neg99.0%
sin-neg99.0%
unpow299.0%
associate-*l/99.5%
associate-/l*99.0%
unpow299.0%
Simplified99.0%
Taylor expanded in ky around 0 67.2%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in th around 0 35.4%
Final simplification25.8%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.8e-178) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.8e-178) {
tmp = ky * (th / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.8d-178) then
tmp = ky * (th / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.8e-178) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.8e-178: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.8e-178) tmp = Float64(ky * Float64(th / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.8e-178) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.8e-178], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.8 \cdot 10^{-178}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.79999999999999997e-178Initial program 93.7%
unpow293.7%
sqr-neg93.7%
sin-neg93.7%
sin-neg93.7%
unpow293.7%
associate-*l/90.2%
associate-/l*93.6%
unpow293.6%
Simplified99.6%
Taylor expanded in ky around 0 25.4%
associate-/l*28.3%
Simplified28.3%
Taylor expanded in th around 0 20.8%
Taylor expanded in kx around 0 16.6%
associate-/l*19.3%
Simplified19.3%
if 1.79999999999999997e-178 < ky Initial program 97.5%
unpow297.5%
sqr-neg97.5%
sin-neg97.5%
sin-neg97.5%
unpow297.5%
associate-*l/96.4%
associate-/l*97.4%
unpow297.4%
Simplified99.4%
Taylor expanded in kx around 0 32.0%
Final simplification24.0%
(FPCore (kx ky th) :precision binary64 (* ky (/ th kx)))
double code(double kx, double ky, double th) {
return ky * (th / kx);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = ky * (th / kx)
end function
public static double code(double kx, double ky, double th) {
return ky * (th / kx);
}
def code(kx, ky, th): return ky * (th / kx)
function code(kx, ky, th) return Float64(ky * Float64(th / kx)) end
function tmp = code(kx, ky, th) tmp = ky * (th / kx); end
code[kx_, ky_, th_] := N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
ky \cdot \frac{th}{kx}
\end{array}
Initial program 95.1%
unpow295.1%
sqr-neg95.1%
sin-neg95.1%
sin-neg95.1%
unpow295.1%
associate-*l/92.5%
associate-/l*95.0%
unpow295.0%
Simplified99.6%
Taylor expanded in ky around 0 23.5%
associate-/l*25.3%
Simplified25.3%
Taylor expanded in th around 0 17.8%
Taylor expanded in kx around 0 13.1%
associate-/l*14.9%
Simplified14.9%
Final simplification14.9%
herbie shell --seed 2024066
(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)))