
(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 ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 90.2%
+-commutative90.2%
unpow290.2%
unpow290.2%
hypot-undefine99.6%
Applied egg-rr99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.2)
(/ (* (sin ky) th) (fabs (sin kx)))
(if (<= (sin kx) 5e-13)
(* ky (/ (sin th) (hypot ky kx)))
(* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.2) {
tmp = (sin(ky) * th) / fabs(sin(kx));
} else if (sin(kx) <= 5e-13) {
tmp = ky * (sin(th) / hypot(ky, kx));
} 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.2) {
tmp = (Math.sin(ky) * th) / Math.abs(Math.sin(kx));
} else if (Math.sin(kx) <= 5e-13) {
tmp = ky * (Math.sin(th) / Math.hypot(ky, kx));
} 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.2: tmp = (math.sin(ky) * th) / math.fabs(math.sin(kx)) elif math.sin(kx) <= 5e-13: tmp = ky * (math.sin(th) / math.hypot(ky, kx)) 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.2) tmp = Float64(Float64(sin(ky) * th) / abs(sin(kx))); elseif (sin(kx) <= 5e-13) tmp = Float64(ky * Float64(sin(th) / hypot(ky, kx))); 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.2) tmp = (sin(ky) * th) / abs(sin(kx)); elseif (sin(kx) <= 5e-13) tmp = ky * (sin(th) / hypot(ky, kx)); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.2], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-13], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $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.2:\\
\;\;\;\;\frac{\sin ky \cdot th}{\left|\sin kx\right|}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-13}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.20000000000000001Initial 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.5%
Taylor expanded in ky around 0 13.7%
Taylor expanded in th around 0 13.9%
add-sqr-sqrt0.0%
sqrt-prod52.4%
rem-sqrt-square52.4%
Applied egg-rr28.9%
if -0.20000000000000001 < (sin.f64 kx) < 4.9999999999999999e-13Initial program 82.3%
unpow282.3%
sqr-neg82.3%
sin-neg82.3%
sin-neg82.3%
unpow282.3%
associate-*l/79.5%
associate-/l*82.2%
unpow282.2%
Simplified99.7%
Taylor expanded in kx around 0 94.4%
Taylor expanded in ky around 0 50.6%
Taylor expanded in ky around 0 67.2%
if 4.9999999999999999e-13 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 55.4%
Final simplification55.6%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 90.2%
unpow290.2%
sqr-neg90.2%
sin-neg90.2%
sin-neg90.2%
unpow290.2%
associate-*l/88.7%
associate-/l*90.1%
unpow290.1%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.0004)
(/ th (/ (hypot (sin ky) (sin kx)) (sin ky)))
(if (<= th 9.5e+247)
(* (sin th) (/ (sin ky) (hypot ky (sin kx))))
(* (sin th) (/ (sin ky) (hypot (sin ky) kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0004) {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
} else if (th <= 9.5e+247) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0004) {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
} else if (th <= 9.5e+247) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0004: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) elif th <= 9.5e+247: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0004) tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); elseif (th <= 9.5e+247) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0004) tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); elseif (th <= 9.5e+247) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0004], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 9.5e+247], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0004:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\mathbf{elif}\;th \leq 9.5 \cdot 10^{+247}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\end{array}
\end{array}
if th < 4.00000000000000019e-4Initial program 91.1%
+-commutative91.1%
unpow291.1%
unpow291.1%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 67.9%
*-commutative67.9%
clear-num67.9%
un-div-inv67.9%
Applied egg-rr67.9%
if 4.00000000000000019e-4 < th < 9.5000000000000002e247Initial program 87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 60.8%
if 9.5000000000000002e247 < th Initial program 88.7%
unpow288.7%
sqr-neg88.7%
sin-neg88.7%
sin-neg88.7%
unpow288.7%
associate-*l/88.9%
associate-/l*88.7%
unpow288.7%
Simplified99.5%
Taylor expanded in kx around 0 69.2%
clear-num69.2%
un-div-inv69.2%
Applied egg-rr69.2%
associate-/r/69.3%
Simplified69.3%
Final simplification66.4%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00072)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(if (<= th 3e+248)
(* (sin th) (/ (sin ky) (hypot ky (sin kx))))
(* (sin th) (/ (sin ky) (hypot (sin ky) kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00072) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else if (th <= 3e+248) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00072) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else if (th <= 3e+248) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00072: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * th elif th <= 3e+248: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00072) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); elseif (th <= 3e+248) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00072) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; elseif (th <= 3e+248) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00072], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], If[LessEqual[th, 3e+248], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00072:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{elif}\;th \leq 3 \cdot 10^{+248}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\end{array}
\end{array}
if th < 7.20000000000000045e-4Initial program 91.1%
+-commutative91.1%
unpow291.1%
unpow291.1%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 67.9%
if 7.20000000000000045e-4 < th < 3e248Initial program 87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 60.8%
if 3e248 < th Initial program 88.7%
unpow288.7%
sqr-neg88.7%
sin-neg88.7%
sin-neg88.7%
unpow288.7%
associate-*l/88.9%
associate-/l*88.7%
unpow288.7%
Simplified99.5%
Taylor expanded in kx around 0 69.2%
clear-num69.2%
un-div-inv69.2%
Applied egg-rr69.2%
associate-/r/69.3%
Simplified69.3%
Final simplification66.4%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00072)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= th 1.06e+248)
(* (sin th) (/ (sin ky) (hypot ky (sin kx))))
(* (sin th) (/ (sin ky) (hypot (sin ky) kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00072) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (th <= 1.06e+248) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00072) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 1.06e+248) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00072: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 1.06e+248: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00072) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (th <= 1.06e+248) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00072) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (th <= 1.06e+248) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00072], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.06e+248], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00072:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 1.06 \cdot 10^{+248}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\end{array}
\end{array}
if th < 7.20000000000000045e-4Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.2%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in th around 0 67.9%
if 7.20000000000000045e-4 < th < 1.06e248Initial program 87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 60.8%
if 1.06e248 < th Initial program 88.7%
unpow288.7%
sqr-neg88.7%
sin-neg88.7%
sin-neg88.7%
unpow288.7%
associate-*l/88.9%
associate-/l*88.7%
unpow288.7%
Simplified99.5%
Taylor expanded in kx around 0 69.2%
clear-num69.2%
un-div-inv69.2%
Applied egg-rr69.2%
associate-/r/69.3%
Simplified69.3%
Final simplification66.4%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.0024)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= th 1.35e+248)
(* (sin th) (/ (sin ky) (hypot ky (sin kx))))
(* (sin ky) (/ (sin th) (hypot (sin ky) kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0024) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (th <= 1.35e+248) {
tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0024) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 1.35e+248) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0024: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 1.35e+248: tmp = math.sin(th) * (math.sin(ky) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0024) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (th <= 1.35e+248) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(ky, sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0024) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (th <= 1.35e+248) tmp = sin(th) * (sin(ky) / hypot(ky, sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0024], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.35e+248], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0024:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 1.35 \cdot 10^{+248}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\end{array}
\end{array}
if th < 0.00239999999999999979Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.2%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in th around 0 67.9%
if 0.00239999999999999979 < th < 1.34999999999999994e248Initial program 87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 60.8%
if 1.34999999999999994e248 < th Initial program 88.7%
unpow288.7%
sqr-neg88.7%
sin-neg88.7%
sin-neg88.7%
unpow288.7%
associate-*l/88.9%
associate-/l*88.7%
unpow288.7%
Simplified99.5%
Taylor expanded in kx around 0 69.2%
Final simplification66.4%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00074)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= th 4.9e+250)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(* (sin ky) (/ (sin th) (hypot (sin ky) kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00074) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (th <= 4.9e+250) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00074) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 4.9e+250) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00074: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 4.9e+250: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00074) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (th <= 4.9e+250) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00074) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (th <= 4.9e+250) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00074], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 4.9e+250], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00074:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 4.9 \cdot 10^{+250}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\end{array}
\end{array}
if th < 7.3999999999999999e-4Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.2%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in th around 0 67.9%
if 7.3999999999999999e-4 < th < 4.89999999999999993e250Initial program 87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
associate-*l/87.0%
associate-/l*87.1%
unpow287.1%
Simplified99.4%
Taylor expanded in ky around 0 60.7%
if 4.89999999999999993e250 < th Initial program 88.7%
unpow288.7%
sqr-neg88.7%
sin-neg88.7%
sin-neg88.7%
unpow288.7%
associate-*l/88.9%
associate-/l*88.7%
unpow288.7%
Simplified99.5%
Taylor expanded in kx around 0 69.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (fabs (sin th)) (if (<= (sin ky) 4e-75) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 4e-75) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 4d-75) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 4e-75) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 4e-75: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = abs(sin(th)); elseif (sin(ky) <= 4e-75) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = abs(sin(th)); elseif (sin(ky) <= 4e-75) tmp = ky * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-75], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-75}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.8%
add-sqr-sqrt1.5%
sqrt-unprod24.8%
pow224.8%
Applied egg-rr24.8%
unpow224.8%
rem-sqrt-square31.3%
Simplified31.3%
if -0.0200000000000000004 < (sin.f64 ky) < 3.9999999999999998e-75Initial program 76.6%
unpow276.6%
sqr-neg76.6%
sin-neg76.6%
sin-neg76.6%
unpow276.6%
associate-*l/73.0%
associate-/l*76.6%
unpow276.6%
Simplified99.6%
Taylor expanded in ky around 0 45.9%
associate-/l*48.5%
Simplified48.5%
if 3.9999999999999998e-75 < (sin.f64 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.6%
Taylor expanded in kx around 0 53.8%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.0012) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin ky) (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0012) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0012) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0012: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0012) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0012) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0012], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0012:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 0.00119999999999999989Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.2%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in th around 0 67.9%
if 0.00119999999999999989 < th Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/87.3%
associate-/l*87.4%
unpow287.4%
Simplified99.4%
Taylor expanded in ky around 0 56.0%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.01) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin ky) (/ (sin th) (fabs (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.01) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(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 (th <= 0.01) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.01: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.01) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(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 (th <= 0.01) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.01], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.01:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if th < 0.0100000000000000002Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.2%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in th around 0 67.9%
if 0.0100000000000000002 < th Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/87.3%
associate-/l*87.4%
unpow287.4%
Simplified99.4%
Taylor expanded in ky around 0 22.2%
add-sqr-sqrt21.0%
sqrt-prod43.1%
rem-sqrt-square49.6%
Applied egg-rr49.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.75e-6) (* ky (/ (sin th) (hypot ky kx))) (* (sin ky) (/ (sin th) (fabs (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.75e-6) {
tmp = ky * (sin(th) / hypot(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 <= 1.75e-6) {
tmp = ky * (Math.sin(th) / Math.hypot(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 <= 1.75e-6: tmp = ky * (math.sin(th) / math.hypot(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 <= 1.75e-6) tmp = Float64(ky * Float64(sin(th) / hypot(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 <= 1.75e-6) tmp = ky * (sin(th) / hypot(ky, kx)); else tmp = sin(ky) * (sin(th) / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.75e-6], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 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 1.75 \cdot 10^{-6}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 1.74999999999999997e-6Initial program 87.6%
unpow287.6%
sqr-neg87.6%
sin-neg87.6%
sin-neg87.6%
unpow287.6%
associate-*l/85.7%
associate-/l*87.6%
unpow287.6%
Simplified99.6%
Taylor expanded in kx around 0 70.2%
Taylor expanded in ky around 0 40.0%
Taylor expanded in ky around 0 52.0%
if 1.74999999999999997e-6 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
Taylor expanded in ky around 0 29.2%
add-sqr-sqrt21.6%
sqrt-prod53.1%
rem-sqrt-square53.1%
Applied egg-rr53.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) 5e-13) (* ky (/ (sin th) (hypot ky kx))) (* (sin ky) (/ (sin th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= 5e-13) {
tmp = ky * (sin(th) / hypot(ky, kx));
} 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) <= 5e-13) {
tmp = ky * (Math.sin(th) / Math.hypot(ky, kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= 5e-13: tmp = ky * (math.sin(th) / math.hypot(ky, kx)) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= 5e-13) tmp = Float64(ky * Float64(sin(th) / hypot(ky, kx))); 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) <= 5e-13) tmp = ky * (sin(th) / hypot(ky, kx)); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-13], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{-13}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < 4.9999999999999999e-13Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/85.5%
associate-/l*87.3%
unpow287.3%
Simplified99.6%
Taylor expanded in kx around 0 71.0%
Taylor expanded in ky around 0 40.2%
Taylor expanded in ky around 0 51.9%
if 4.9999999999999999e-13 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 55.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (fabs (sin th)) (if (<= (sin ky) 5e-77) (/ ky (/ kx (sin th))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-77) {
tmp = ky / (kx / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-77) then
tmp = ky / (kx / sin(th))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-77) {
tmp = ky / (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 = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-77: tmp = ky / (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 = abs(sin(th)); elseif (sin(ky) <= 5e-77) tmp = Float64(ky / Float64(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 = abs(sin(th)); elseif (sin(ky) <= 5e-77) tmp = ky / (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[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-77], N[(ky / N[(kx / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-77}:\\
\;\;\;\;\frac{ky}{\frac{kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0200000000000000004Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.8%
add-sqr-sqrt1.5%
sqrt-unprod24.8%
pow224.8%
Applied egg-rr24.8%
unpow224.8%
rem-sqrt-square31.3%
Simplified31.3%
if -0.0200000000000000004 < (sin.f64 ky) < 4.99999999999999963e-77Initial program 75.9%
unpow275.9%
sqr-neg75.9%
sin-neg75.9%
sin-neg75.9%
unpow275.9%
associate-*l/72.3%
associate-/l*75.9%
unpow275.9%
Simplified99.6%
Taylor expanded in kx around 0 70.6%
Taylor expanded in ky around 0 29.7%
associate-/l*32.4%
Simplified32.4%
clear-num32.4%
un-div-inv32.4%
Applied egg-rr32.4%
if 4.99999999999999963e-77 < (sin.f64 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.6%
Taylor expanded in kx around 0 52.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) 5e-13) (* ky (/ (sin th) (hypot ky kx))) (* ky (/ (sin th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= 5e-13) {
tmp = ky * (sin(th) / hypot(ky, kx));
} else {
tmp = ky * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= 5e-13) {
tmp = ky * (Math.sin(th) / Math.hypot(ky, kx));
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= 5e-13: tmp = ky * (math.sin(th) / math.hypot(ky, kx)) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= 5e-13) tmp = Float64(ky * Float64(sin(th) / hypot(ky, kx))); 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) <= 5e-13) tmp = ky * (sin(th) / hypot(ky, kx)); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-13], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $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 5 \cdot 10^{-13}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < 4.9999999999999999e-13Initial program 87.4%
unpow287.4%
sqr-neg87.4%
sin-neg87.4%
sin-neg87.4%
unpow287.4%
associate-*l/85.5%
associate-/l*87.3%
unpow287.3%
Simplified99.6%
Taylor expanded in kx around 0 71.0%
Taylor expanded in ky around 0 40.2%
Taylor expanded in ky around 0 51.9%
if 4.9999999999999999e-13 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 46.5%
associate-/l*46.5%
Simplified46.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.2e-77) (/ ky (/ kx (sin th))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.2e-77) {
tmp = ky / (kx / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 3.2d-77) then
tmp = ky / (kx / sin(th))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.2e-77) {
tmp = ky / (kx / Math.sin(th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.2e-77: tmp = ky / (kx / math.sin(th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.2e-77) tmp = Float64(ky / Float64(kx / sin(th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.2e-77) tmp = ky / (kx / sin(th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.2e-77], N[(ky / N[(kx / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{ky}{\frac{kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.2e-77Initial program 85.2%
unpow285.2%
sqr-neg85.2%
sin-neg85.2%
sin-neg85.2%
unpow285.2%
associate-*l/83.0%
associate-/l*85.1%
unpow285.1%
Simplified99.5%
Taylor expanded in kx around 0 65.9%
Taylor expanded in ky around 0 19.5%
associate-/l*21.1%
Simplified21.1%
clear-num21.1%
un-div-inv21.2%
Applied egg-rr21.2%
if 3.2e-77 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 30.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.2e-77) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.2e-77) {
tmp = ky * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 3.2d-77) then
tmp = ky * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.2e-77) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.2e-77: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.2e-77) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.2e-77) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.2e-77], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.2 \cdot 10^{-77}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.2e-77Initial program 85.2%
unpow285.2%
sqr-neg85.2%
sin-neg85.2%
sin-neg85.2%
unpow285.2%
associate-*l/83.0%
associate-/l*85.1%
unpow285.1%
Simplified99.5%
Taylor expanded in kx around 0 65.9%
Taylor expanded in ky around 0 19.5%
associate-/l*21.1%
Simplified21.1%
if 3.2e-77 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 30.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.8e-110) (* th (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.8e-110) {
tmp = th * (ky / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 2.8d-110) then
tmp = th * (ky / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.8e-110) {
tmp = th * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.8e-110: tmp = th * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.8e-110) tmp = Float64(th * Float64(ky / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.8e-110) tmp = th * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.8e-110], N[(th * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.8 \cdot 10^{-110}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.8e-110Initial program 84.4%
+-commutative84.4%
unpow284.4%
unpow284.4%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 51.5%
Taylor expanded in kx around 0 37.2%
Taylor expanded in ky around 0 14.1%
if 2.8e-110 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 31.3%
Final simplification20.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.6e-110) (* th (/ ky kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.6e-110) {
tmp = th * (ky / 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 <= 3.6d-110) then
tmp = th * (ky / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.6e-110) {
tmp = th * (ky / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.6e-110: tmp = th * (ky / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.6e-110) tmp = Float64(th * Float64(ky / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.6e-110) tmp = th * (ky / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.6e-110], N[(th * N[(ky / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.6 \cdot 10^{-110}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 3.59999999999999995e-110Initial program 84.4%
+-commutative84.4%
unpow284.4%
unpow284.4%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 51.5%
Taylor expanded in kx around 0 37.2%
Taylor expanded in ky around 0 14.1%
if 3.59999999999999995e-110 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 31.3%
Taylor expanded in th around 0 20.0%
Final simplification16.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.8e-110) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.8e-110) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4.8d-110) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.8e-110) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.8e-110: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.8e-110) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.8e-110) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.8e-110], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.8 \cdot 10^{-110}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 4.80000000000000013e-110Initial program 84.4%
unpow284.4%
sqr-neg84.4%
sin-neg84.4%
sin-neg84.4%
unpow284.4%
associate-*l/82.0%
associate-/l*84.3%
unpow284.3%
Simplified99.6%
Taylor expanded in kx around 0 64.7%
Taylor expanded in ky around 0 18.7%
associate-/l*20.4%
Simplified20.4%
Taylor expanded in th around 0 14.1%
if 4.80000000000000013e-110 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 31.3%
Taylor expanded in th around 0 20.0%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 90.2%
unpow290.2%
sqr-neg90.2%
sin-neg90.2%
sin-neg90.2%
unpow290.2%
associate-*l/88.7%
associate-/l*90.1%
unpow290.1%
Simplified99.6%
Taylor expanded in kx around 0 24.9%
Taylor expanded in th around 0 15.4%
herbie shell --seed 2024125
(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)))