
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (/ (sin th) (/ (hypot (sin ky) (sin kx)) (sin ky))))
double code(double kx, double ky, double th) {
return sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
def code(kx, ky, th): return math.sin(th) / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky))
function code(kx, ky, th) return Float64(sin(th) / Float64(hypot(sin(ky), sin(kx)) / sin(ky))) end
function tmp = code(kx, ky, th) tmp = sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky)); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\end{array}
Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/92.5%
associate-/l*93.2%
unpow293.2%
Simplified99.6%
associate-*r/97.1%
hypot-undefine92.5%
unpow292.5%
unpow292.5%
+-commutative92.5%
associate-*l/93.2%
*-commutative93.2%
clear-num93.2%
un-div-inv93.2%
+-commutative93.2%
unpow293.2%
unpow293.2%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (/ (* th (sin ky)) (hypot (sin ky) kx)) (if (<= (sin ky) 4e-6) (/ ky (/ (hypot ky (sin kx)) (sin th))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = (th * sin(ky)) / hypot(sin(ky), kx);
} else if (sin(ky) <= 4e-6) {
tmp = ky / (hypot(ky, sin(kx)) / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = (th * Math.sin(ky)) / Math.hypot(Math.sin(ky), kx);
} else if (Math.sin(ky) <= 4e-6) {
tmp = ky / (Math.hypot(ky, Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = (th * math.sin(ky)) / math.hypot(math.sin(ky), kx) elif math.sin(ky) <= 4e-6: tmp = ky / (math.hypot(ky, math.sin(kx)) / math.sin(th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(Float64(th * sin(ky)) / hypot(sin(ky), kx)); elseif (sin(ky) <= 4e-6) tmp = Float64(ky / Float64(hypot(ky, sin(kx)) / sin(th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = (th * sin(ky)) / hypot(sin(ky), kx); elseif (sin(ky) <= 4e-6) tmp = ky / (hypot(ky, sin(kx)) / sin(th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(N[(th * N[Sin[ky], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-6], N[(ky / N[(N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\frac{th \cdot \sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\frac{ky}{\frac{\mathsf{hypot}\left(ky, \sin kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/99.7%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
associate-*r/99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 51.3%
Taylor expanded in kx around 0 34.7%
if -0.0200000000000000004 < (sin.f64 ky) < 3.99999999999999982e-6Initial program 87.5%
unpow287.5%
sqr-neg87.5%
sin-neg87.5%
sin-neg87.5%
unpow287.5%
associate-*l/86.2%
associate-/l*87.6%
unpow287.6%
Simplified99.7%
Taylor expanded in ky around 0 98.3%
clear-num98.1%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in ky around 0 98.8%
if 3.99999999999999982e-6 < (sin.f64 ky) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 59.5%
Final simplification75.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 4e-6) (/ ky (/ (hypot ky (sin kx)) (sin th))) (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-6) {
tmp = ky / (hypot(ky, sin(kx)) / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
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-6) {
tmp = ky / (Math.hypot(ky, Math.sin(kx)) / Math.sin(th));
} 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-6: tmp = ky / (math.hypot(ky, math.sin(kx)) / math.sin(th)) 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-6) tmp = Float64(ky / Float64(hypot(ky, sin(kx)) / sin(th))); 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-6) tmp = ky / (hypot(ky, sin(kx)) / sin(th)); 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-6], N[(ky / N[(N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $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^{-6}:\\
\;\;\;\;\frac{ky}{\frac{\mathsf{hypot}\left(ky, \sin kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/99.7%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.4%
add-sqr-sqrt0.8%
sqrt-unprod30.2%
pow230.2%
Applied egg-rr30.2%
unpow230.2%
rem-sqrt-square42.5%
Simplified42.5%
if -0.0050000000000000001 < (sin.f64 ky) < 3.99999999999999982e-6Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/86.1%
associate-/l*87.5%
unpow287.5%
Simplified99.7%
Taylor expanded in ky around 0 99.0%
clear-num98.8%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in ky around 0 99.6%
if 3.99999999999999982e-6 < (sin.f64 ky) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 59.5%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 4e-6) (* ky (/ (sin th) (hypot ky (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-6) {
tmp = ky * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 4e-6) {
tmp = ky * (Math.sin(th) / Math.hypot(ky, 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-6: tmp = ky * (math.sin(th) / math.hypot(ky, 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-6) tmp = Float64(ky * Float64(sin(th) / hypot(ky, 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-6) tmp = ky * (sin(th) / hypot(ky, 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-6], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $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^{-6}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/99.7%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.4%
add-sqr-sqrt0.8%
sqrt-unprod30.2%
pow230.2%
Applied egg-rr30.2%
unpow230.2%
rem-sqrt-square42.5%
Simplified42.5%
if -0.0050000000000000001 < (sin.f64 ky) < 3.99999999999999982e-6Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/86.1%
associate-/l*87.5%
unpow287.5%
Simplified99.7%
Taylor expanded in ky around 0 99.0%
Taylor expanded in ky around 0 99.5%
if 3.99999999999999982e-6 < (sin.f64 ky) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 59.5%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.004) (/ (sin th) (/ (fabs (sin kx)) ky)) (if (<= (sin kx) 5e-49) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.004) {
tmp = sin(th) / (fabs(sin(kx)) / ky);
} else if (sin(kx) <= 5e-49) {
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.004d0)) then
tmp = sin(th) / (abs(sin(kx)) / ky)
else if (sin(kx) <= 5d-49) 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.004) {
tmp = Math.sin(th) / (Math.abs(Math.sin(kx)) / ky);
} else if (Math.sin(kx) <= 5e-49) {
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.004: tmp = math.sin(th) / (math.fabs(math.sin(kx)) / ky) elif math.sin(kx) <= 5e-49: 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.004) tmp = Float64(sin(th) / Float64(abs(sin(kx)) / ky)); elseif (sin(kx) <= 5e-49) 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.004) tmp = sin(th) / (abs(sin(kx)) / ky); elseif (sin(kx) <= 5e-49) 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.004], N[(N[Sin[th], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-49], 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.004:\\
\;\;\;\;\frac{\sin th}{\frac{\left|\sin kx\right|}{ky}}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0040000000000000001Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.4%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 13.9%
add-sqr-sqrt0.0%
sqrt-prod67.0%
rem-sqrt-square67.0%
Applied egg-rr59.8%
if -0.0040000000000000001 < (sin.f64 kx) < 4.9999999999999999e-49Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/85.9%
associate-/l*87.1%
unpow287.1%
Simplified99.7%
Taylor expanded in kx around 0 41.1%
if 4.9999999999999999e-49 < (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.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 62.8%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (hypot ky (sin kx)))) (if (<= (sin kx) 5e-49) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.15) {
tmp = ky * (th / hypot(ky, sin(kx)));
} else if (sin(kx) <= 5e-49) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.15) {
tmp = ky * (th / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-49) {
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.15: tmp = ky * (th / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 5e-49: 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.15) tmp = Float64(ky * Float64(th / hypot(ky, sin(kx)))); elseif (sin(kx) <= 5e-49) 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.15) tmp = ky * (th / hypot(ky, sin(kx))); elseif (sin(kx) <= 5e-49) 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.15], N[(ky * N[(th / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-49], 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.15:\\
\;\;\;\;ky \cdot \frac{th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 59.4%
Taylor expanded in th around 0 33.7%
Taylor expanded in ky around 0 34.3%
if -0.149999999999999994 < (sin.f64 kx) < 4.9999999999999999e-49Initial program 87.9%
unpow287.9%
sqr-neg87.9%
sin-neg87.9%
sin-neg87.9%
unpow287.9%
associate-*l/86.7%
associate-/l*87.8%
unpow287.8%
Simplified99.7%
Taylor expanded in kx around 0 39.1%
if 4.9999999999999999e-49 < (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.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 62.8%
(FPCore (kx ky th) :precision binary64 (* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(th) * (sin(ky) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(th) * (sin(ky) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.2%
+-commutative93.2%
unpow293.2%
unpow293.2%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/92.5%
associate-/l*93.2%
unpow293.2%
Simplified99.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (hypot ky (sin kx)))) (if (<= (sin kx) 5e-49) (sin th) (/ (sin th) (/ (sin kx) ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.15) {
tmp = ky * (th / hypot(ky, sin(kx)));
} else if (sin(kx) <= 5e-49) {
tmp = sin(th);
} else {
tmp = sin(th) / (sin(kx) / ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.15) {
tmp = ky * (th / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-49) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.15: tmp = ky * (th / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 5e-49: tmp = math.sin(th) else: tmp = math.sin(th) / (math.sin(kx) / ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.15) tmp = Float64(ky * Float64(th / hypot(ky, sin(kx)))); elseif (sin(kx) <= 5e-49) tmp = sin(th); else tmp = Float64(sin(th) / Float64(sin(kx) / ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.15) tmp = ky * (th / hypot(ky, sin(kx))); elseif (sin(kx) <= 5e-49) tmp = sin(th); else tmp = sin(th) / (sin(kx) / ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.15], N[(ky * N[(th / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-49], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.15:\\
\;\;\;\;ky \cdot \frac{th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 59.4%
Taylor expanded in th around 0 33.7%
Taylor expanded in ky around 0 34.3%
if -0.149999999999999994 < (sin.f64 kx) < 4.9999999999999999e-49Initial program 87.9%
unpow287.9%
sqr-neg87.9%
sin-neg87.9%
sin-neg87.9%
unpow287.9%
associate-*l/86.7%
associate-/l*87.8%
unpow287.8%
Simplified99.7%
Taylor expanded in kx around 0 39.1%
if 4.9999999999999999e-49 < (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.5%
unpow299.5%
Simplified99.5%
associate-*r/99.3%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.5%
*-commutative99.5%
clear-num99.4%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 55.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (fabs (sin kx)))) (if (<= (sin kx) 5e-49) (sin th) (/ (sin th) (/ (sin kx) ky)))))
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) <= 5e-49) {
tmp = sin(th);
} else {
tmp = sin(th) / (sin(kx) / ky);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.15d0)) then
tmp = ky * (th / abs(sin(kx)))
else if (sin(kx) <= 5d-49) then
tmp = sin(th)
else
tmp = sin(th) / (sin(kx) / ky)
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) <= 5e-49) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
}
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) <= 5e-49: tmp = math.sin(th) else: tmp = math.sin(th) / (math.sin(kx) / ky) 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) <= 5e-49) tmp = sin(th); else tmp = Float64(sin(th) / Float64(sin(kx) / ky)); 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) <= 5e-49) tmp = sin(th); else tmp = sin(th) / (sin(kx) / ky); 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], 5e-49], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $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 5 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 59.4%
Taylor expanded in th around 0 33.7%
Taylor expanded in ky around 0 13.2%
associate-/l*13.2%
Simplified13.2%
add-sqr-sqrt0.0%
sqrt-prod65.4%
rem-sqrt-square65.4%
Applied egg-rr32.9%
if -0.149999999999999994 < (sin.f64 kx) < 4.9999999999999999e-49Initial program 87.9%
unpow287.9%
sqr-neg87.9%
sin-neg87.9%
sin-neg87.9%
unpow287.9%
associate-*l/86.7%
associate-/l*87.8%
unpow287.8%
Simplified99.7%
Taylor expanded in kx around 0 39.1%
if 4.9999999999999999e-49 < (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.5%
unpow299.5%
Simplified99.5%
associate-*r/99.3%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.5%
*-commutative99.5%
clear-num99.4%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 55.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.15) (* ky (/ th (fabs (sin kx)))) (if (<= (sin kx) 5e-49) (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) <= 5e-49) {
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) <= 5d-49) 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) <= 5e-49) {
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) <= 5e-49: 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) <= 5e-49) 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) <= 5e-49) 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], 5e-49], 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 5 \cdot 10^{-49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.149999999999999994Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 59.4%
Taylor expanded in th around 0 33.7%
Taylor expanded in ky around 0 13.2%
associate-/l*13.2%
Simplified13.2%
add-sqr-sqrt0.0%
sqrt-prod65.4%
rem-sqrt-square65.4%
Applied egg-rr32.9%
if -0.149999999999999994 < (sin.f64 kx) < 4.9999999999999999e-49Initial program 87.9%
unpow287.9%
sqr-neg87.9%
sin-neg87.9%
sin-neg87.9%
unpow287.9%
associate-*l/86.7%
associate-/l*87.8%
unpow287.8%
Simplified99.7%
Taylor expanded in kx around 0 39.1%
if 4.9999999999999999e-49 < (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.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 55.1%
associate-/l*55.3%
Simplified55.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.012) (/ (sin th) (/ (hypot (sin ky) kx) (sin ky))) (* (sin ky) (/ (sin th) (fabs (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.012) {
tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.012) {
tmp = Math.sin(th) / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.012: tmp = math.sin(th) / (math.hypot(math.sin(ky), kx) / math.sin(ky)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.012) tmp = Float64(sin(th) / Float64(hypot(sin(ky), kx) / sin(ky))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.012) tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky)); else tmp = sin(ky) * (sin(th) / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.012], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.012:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 0.012Initial program 91.6%
unpow291.6%
sqr-neg91.6%
sin-neg91.6%
sin-neg91.6%
unpow291.6%
associate-*l/90.7%
associate-/l*91.5%
unpow291.5%
Simplified99.7%
associate-*r/96.5%
hypot-undefine90.7%
unpow290.7%
unpow290.7%
+-commutative90.7%
associate-*l/91.6%
*-commutative91.6%
clear-num91.6%
un-div-inv91.6%
+-commutative91.6%
unpow291.6%
unpow291.6%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in kx around 0 73.9%
if 0.012 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 34.0%
add-sqr-sqrt29.7%
sqrt-prod65.5%
rem-sqrt-square65.5%
Applied egg-rr65.5%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.00315) (* (sin ky) (/ (sin th) (hypot (sin ky) kx))) (* (sin ky) (/ (sin th) (fabs (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.00315) {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.00315) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.00315: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.00315) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.00315) tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); else tmp = sin(ky) * (sin(th) / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.00315], 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[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.00315:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 0.00315Initial program 91.6%
unpow291.6%
sqr-neg91.6%
sin-neg91.6%
sin-neg91.6%
unpow291.6%
associate-*l/90.7%
associate-/l*91.5%
unpow291.5%
Simplified99.7%
Taylor expanded in kx around 0 73.8%
if 0.00315 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 34.0%
add-sqr-sqrt29.7%
sqrt-prod65.5%
rem-sqrt-square65.5%
Applied egg-rr65.5%
(FPCore (kx ky th) :precision binary64 (if (<= th 8e-7) (* th (/ (sin ky) (hypot (sin ky) (sin kx)))) (/ ky (/ (hypot ky (sin kx)) (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 8e-7) {
tmp = th * (sin(ky) / hypot(sin(ky), sin(kx)));
} else {
tmp = ky / (hypot(ky, sin(kx)) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 8e-7) {
tmp = th * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = ky / (Math.hypot(ky, Math.sin(kx)) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 8e-7: tmp = th * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = ky / (math.hypot(ky, math.sin(kx)) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 8e-7) tmp = Float64(th * Float64(sin(ky) / hypot(sin(ky), sin(kx)))); else tmp = Float64(ky / Float64(hypot(ky, sin(kx)) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 8e-7) tmp = th * (sin(ky) / hypot(sin(ky), sin(kx))); else tmp = ky / (hypot(ky, sin(kx)) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 8e-7], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ky / N[(N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 8 \cdot 10^{-7}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\mathsf{hypot}\left(ky, \sin kx\right)}{\sin th}}\\
\end{array}
\end{array}
if th < 7.9999999999999996e-7Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/92.6%
associate-/l*93.6%
unpow293.6%
Simplified99.7%
associate-*r/96.2%
Applied egg-rr96.2%
Taylor expanded in th around 0 61.9%
*-commutative61.9%
associate-/l*65.4%
Applied egg-rr65.4%
if 7.9999999999999996e-7 < th Initial program 92.2%
unpow292.2%
sqr-neg92.2%
sin-neg92.2%
sin-neg92.2%
unpow292.2%
associate-*l/92.2%
associate-/l*92.1%
unpow292.1%
Simplified99.5%
Taylor expanded in ky around 0 57.9%
clear-num57.9%
un-div-inv57.9%
Applied egg-rr57.9%
Taylor expanded in ky around 0 69.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.25e-47) (sin th) (if (<= kx 14.5) (/ (sin th) (/ kx ky)) (* ky (/ th (fabs (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.25e-47) {
tmp = sin(th);
} else if (kx <= 14.5) {
tmp = sin(th) / (kx / ky);
} 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 <= 1.25d-47) then
tmp = sin(th)
else if (kx <= 14.5d0) then
tmp = sin(th) / (kx / ky)
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 <= 1.25e-47) {
tmp = Math.sin(th);
} else if (kx <= 14.5) {
tmp = Math.sin(th) / (kx / ky);
} else {
tmp = ky * (th / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.25e-47: tmp = math.sin(th) elif kx <= 14.5: tmp = math.sin(th) / (kx / ky) else: tmp = ky * (th / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.25e-47) tmp = sin(th); elseif (kx <= 14.5) tmp = Float64(sin(th) / Float64(kx / ky)); 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 <= 1.25e-47) tmp = sin(th); elseif (kx <= 14.5) tmp = sin(th) / (kx / ky); else tmp = ky * (th / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.25e-47], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 14.5], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $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 1.25 \cdot 10^{-47}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 14.5:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 1.25000000000000003e-47Initial program 91.3%
unpow291.3%
sqr-neg91.3%
sin-neg91.3%
sin-neg91.3%
unpow291.3%
associate-*l/90.3%
associate-/l*91.2%
unpow291.2%
Simplified99.7%
Taylor expanded in kx around 0 30.5%
if 1.25000000000000003e-47 < kx < 14.5Initial 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%
associate-*r/99.3%
hypot-undefine99.3%
unpow299.3%
unpow299.3%
+-commutative99.3%
associate-*l/99.5%
*-commutative99.5%
clear-num99.7%
un-div-inv99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 68.8%
Taylor expanded in kx around 0 65.8%
if 14.5 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 59.8%
Taylor expanded in th around 0 30.7%
Taylor expanded in ky around 0 19.2%
associate-/l*19.2%
Simplified19.2%
add-sqr-sqrt30.2%
sqrt-prod66.4%
rem-sqrt-square66.4%
Applied egg-rr30.1%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.3e-48) (sin th) (if (<= kx 100000000000.0) (/ (sin th) (/ kx ky)) (* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.3e-48) {
tmp = sin(th);
} else if (kx <= 100000000000.0) {
tmp = sin(th) / (kx / ky);
} 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 (kx <= 4.3d-48) then
tmp = sin(th)
else if (kx <= 100000000000.0d0) then
tmp = sin(th) / (kx / ky)
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 (kx <= 4.3e-48) {
tmp = Math.sin(th);
} else if (kx <= 100000000000.0) {
tmp = Math.sin(th) / (kx / ky);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.3e-48: tmp = math.sin(th) elif kx <= 100000000000.0: tmp = math.sin(th) / (kx / ky) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.3e-48) tmp = sin(th); elseif (kx <= 100000000000.0) tmp = Float64(sin(th) / Float64(kx / ky)); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.3e-48) tmp = sin(th); elseif (kx <= 100000000000.0) tmp = sin(th) / (kx / ky); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.3e-48], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 100000000000.0], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $MachinePrecision]), $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.3 \cdot 10^{-48}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 100000000000:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 4.3e-48Initial program 91.3%
unpow291.3%
sqr-neg91.3%
sin-neg91.3%
sin-neg91.3%
unpow291.3%
associate-*l/90.3%
associate-/l*91.2%
unpow291.2%
Simplified99.7%
Taylor expanded in kx around 0 30.5%
if 4.3e-48 < kx < 1e11Initial 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%
associate-*r/99.2%
hypot-undefine99.2%
unpow299.2%
unpow299.2%
+-commutative99.2%
associate-*l/99.4%
*-commutative99.4%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 62.3%
Taylor expanded in kx around 0 59.6%
if 1e11 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 60.9%
Taylor expanded in th around 0 31.1%
Taylor expanded in ky around 0 19.5%
associate-/l*19.5%
Simplified19.5%
(FPCore (kx ky th) :precision binary64 (if (<= kx 7.8e-47) (sin th) (if (<= kx 100000000000.0) (* ky (/ (sin th) kx)) (* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 7.8e-47) {
tmp = sin(th);
} else if (kx <= 100000000000.0) {
tmp = ky * (sin(th) / kx);
} 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 (kx <= 7.8d-47) then
tmp = sin(th)
else if (kx <= 100000000000.0d0) then
tmp = ky * (sin(th) / kx)
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 (kx <= 7.8e-47) {
tmp = Math.sin(th);
} else if (kx <= 100000000000.0) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 7.8e-47: tmp = math.sin(th) elif kx <= 100000000000.0: tmp = ky * (math.sin(th) / kx) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 7.8e-47) tmp = sin(th); elseif (kx <= 100000000000.0) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 7.8e-47) tmp = sin(th); elseif (kx <= 100000000000.0) tmp = ky * (sin(th) / kx); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 7.8e-47], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 100000000000.0], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 7.8 \cdot 10^{-47}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 100000000000:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 7.79999999999999956e-47Initial program 91.3%
unpow291.3%
sqr-neg91.3%
sin-neg91.3%
sin-neg91.3%
unpow291.3%
associate-*l/90.3%
associate-/l*91.2%
unpow291.2%
Simplified99.7%
Taylor expanded in kx around 0 30.5%
if 7.79999999999999956e-47 < kx < 1e11Initial 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%
associate-*r/99.2%
hypot-undefine99.2%
unpow299.2%
unpow299.2%
+-commutative99.2%
associate-*l/99.4%
*-commutative99.4%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 62.3%
Taylor expanded in kx around 0 59.5%
associate-/l*59.3%
Simplified59.3%
if 1e11 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 60.9%
Taylor expanded in th around 0 31.1%
Taylor expanded in ky around 0 19.5%
associate-/l*19.5%
Simplified19.5%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.32e-46) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.32e-46) {
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 (kx <= 1.32d-46) 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 (kx <= 1.32e-46) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.32e-46: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.32e-46) 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 (kx <= 1.32e-46) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.32e-46], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.32 \cdot 10^{-46}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.32000000000000001e-46Initial program 91.3%
unpow291.3%
sqr-neg91.3%
sin-neg91.3%
sin-neg91.3%
unpow291.3%
associate-*l/90.3%
associate-/l*91.2%
unpow291.2%
Simplified99.7%
Taylor expanded in kx around 0 30.5%
if 1.32000000000000001e-46 < 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.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 62.6%
Taylor expanded in th around 0 31.6%
Taylor expanded in ky around 0 21.7%
associate-/l*21.7%
Simplified21.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.1e-233) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.1e-233) {
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 <= 3.1d-233) 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 <= 3.1e-233) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.1e-233: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.1e-233) 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 <= 3.1e-233) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.1e-233], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.1 \cdot 10^{-233}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.10000000000000015e-233Initial program 93.1%
unpow293.1%
sqr-neg93.1%
sin-neg93.1%
sin-neg93.1%
unpow293.1%
associate-*l/92.9%
associate-/l*93.0%
unpow293.0%
Simplified99.6%
Taylor expanded in ky around 0 59.1%
Taylor expanded in th around 0 32.0%
Taylor expanded in ky around 0 17.7%
associate-/l*19.6%
Simplified19.6%
Taylor expanded in kx around 0 14.9%
associate-/l*16.8%
Simplified16.8%
if 3.10000000000000015e-233 < ky Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.9%
associate-/l*93.4%
unpow293.4%
Simplified99.6%
Taylor expanded in kx around 0 35.9%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.1e-127) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.1e-127) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.1d-127) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.1e-127) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.1e-127: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.1e-127) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.1e-127) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.1e-127], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 1.1000000000000001e-127Initial program 89.6%
unpow289.6%
sqr-neg89.6%
sin-neg89.6%
sin-neg89.6%
unpow289.6%
associate-*l/88.7%
associate-/l*89.5%
unpow289.5%
Simplified99.6%
Taylor expanded in ky around 0 64.1%
Taylor expanded in th around 0 32.7%
Taylor expanded in ky around 0 17.8%
associate-/l*20.0%
Simplified20.0%
Taylor expanded in kx around 0 15.3%
associate-/l*17.6%
Simplified17.6%
if 1.1000000000000001e-127 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.2%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 34.3%
Taylor expanded in th around 0 17.8%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/92.5%
associate-/l*93.2%
unpow293.2%
Simplified99.6%
Taylor expanded in kx around 0 25.5%
Taylor expanded in th around 0 13.7%
herbie shell --seed 2024143
(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)))