
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 93.6%
remove-double-neg93.6%
sin-neg93.6%
neg-mul-193.6%
*-commutative93.6%
associate-*l*93.6%
associate-*l/91.0%
associate-/r/91.0%
associate-*l/93.6%
associate-/r/93.5%
sin-neg93.5%
neg-mul-193.5%
associate-/r*93.5%
associate-/r/93.6%
Simplified99.7%
Final simplification99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin kx) (sin ky))))
(if (<= (sin ky) -0.01)
(/ (sin ky) (* t_1 (+ (/ 1.0 th) (* th 0.16666666666666666))))
(if (<= (sin ky) 0.001)
(/ (sin th) (* t_1 (+ (* ky 0.16666666666666666) (/ 1.0 ky))))
(sin th)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(kx), sin(ky));
double tmp;
if (sin(ky) <= -0.01) {
tmp = sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666)));
} else if (sin(ky) <= 0.001) {
tmp = sin(th) / (t_1 * ((ky * 0.16666666666666666) + (1.0 / ky)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(kx), Math.sin(ky));
double tmp;
if (Math.sin(ky) <= -0.01) {
tmp = Math.sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666)));
} else if (Math.sin(ky) <= 0.001) {
tmp = Math.sin(th) / (t_1 * ((ky * 0.16666666666666666) + (1.0 / ky)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(kx), math.sin(ky)) tmp = 0 if math.sin(ky) <= -0.01: tmp = math.sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666))) elif math.sin(ky) <= 0.001: tmp = math.sin(th) / (t_1 * ((ky * 0.16666666666666666) + (1.0 / ky))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = hypot(sin(kx), sin(ky)) tmp = 0.0 if (sin(ky) <= -0.01) tmp = Float64(sin(ky) / Float64(t_1 * Float64(Float64(1.0 / th) + Float64(th * 0.16666666666666666)))); elseif (sin(ky) <= 0.001) tmp = Float64(sin(th) / Float64(t_1 * Float64(Float64(ky * 0.16666666666666666) + Float64(1.0 / ky)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(kx), sin(ky)); tmp = 0.0; if (sin(ky) <= -0.01) tmp = sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666))); elseif (sin(ky) <= 0.001) tmp = sin(th) / (t_1 * ((ky * 0.16666666666666666) + (1.0 / ky))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[(N[Sin[ky], $MachinePrecision] / N[(t$95$1 * N[(N[(1.0 / th), $MachinePrecision] + N[(th * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.001], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 * N[(N[(ky * 0.16666666666666666), $MachinePrecision] + N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin kx, \sin ky\right)\\
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\frac{\sin ky}{t_1 \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{elif}\;\sin ky \leq 0.001:\\
\;\;\;\;\frac{\sin th}{t_1 \cdot \left(ky \cdot 0.16666666666666666 + \frac{1}{ky}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 56.1%
+-commutative56.1%
unpow256.1%
unpow256.1%
hypot-def56.1%
associate-*r*56.1%
unpow256.1%
unpow256.1%
hypot-def56.1%
distribute-rgt-out56.1%
Simplified56.1%
if -0.0100000000000000002 < (sin.f64 ky) < 1e-3Initial program 87.4%
clear-num87.4%
associate-*l/87.4%
*-un-lft-identity87.4%
unpow287.4%
unpow287.4%
hypot-def99.7%
Applied egg-rr99.7%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 99.4%
if 1e-3 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 64.9%
Final simplification79.9%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.01)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(if (<= (sin ky) 4e-5)
(/ (sin th) (* (hypot (sin kx) (sin ky)) (/ 1.0 ky)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else if (sin(ky) <= 4e-5) {
tmp = sin(th) / (hypot(sin(kx), sin(ky)) * (1.0 / ky));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.01) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else if (Math.sin(ky) <= 4e-5) {
tmp = Math.sin(th) / (Math.hypot(Math.sin(kx), Math.sin(ky)) * (1.0 / ky));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * th elif math.sin(ky) <= 4e-5: tmp = math.sin(th) / (math.hypot(math.sin(kx), math.sin(ky)) * (1.0 / ky)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); elseif (sin(ky) <= 4e-5) tmp = Float64(sin(th) / Float64(hypot(sin(kx), sin(ky)) * Float64(1.0 / ky))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.01) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; elseif (sin(ky) <= 4e-5) tmp = sin(th) / (hypot(sin(kx), sin(ky)) * (1.0 / ky)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-5], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] * N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right) \cdot \frac{1}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.7%
Taylor expanded in th around 0 55.5%
expm1-log1p-u54.6%
expm1-udef5.6%
Applied egg-rr5.6%
expm1-def54.7%
expm1-log1p55.6%
hypot-def55.5%
unpow255.5%
unpow255.5%
+-commutative55.5%
unpow255.5%
unpow255.5%
hypot-def55.6%
Simplified55.6%
if -0.0100000000000000002 < (sin.f64 ky) < 4.00000000000000033e-5Initial program 87.3%
clear-num87.3%
associate-*l/87.3%
*-un-lft-identity87.3%
unpow287.3%
unpow287.3%
hypot-def99.7%
Applied egg-rr99.7%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 99.1%
if 4.00000000000000033e-5 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 64.2%
Final simplification79.3%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin kx) (sin ky))))
(if (<= (sin ky) -0.01)
(/ (sin ky) (* t_1 (+ (/ 1.0 th) (* th 0.16666666666666666))))
(if (<= (sin ky) 4e-5) (/ (sin th) (* t_1 (/ 1.0 ky))) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(kx), sin(ky));
double tmp;
if (sin(ky) <= -0.01) {
tmp = sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666)));
} else if (sin(ky) <= 4e-5) {
tmp = sin(th) / (t_1 * (1.0 / ky));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(kx), Math.sin(ky));
double tmp;
if (Math.sin(ky) <= -0.01) {
tmp = Math.sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666)));
} else if (Math.sin(ky) <= 4e-5) {
tmp = Math.sin(th) / (t_1 * (1.0 / ky));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(kx), math.sin(ky)) tmp = 0 if math.sin(ky) <= -0.01: tmp = math.sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666))) elif math.sin(ky) <= 4e-5: tmp = math.sin(th) / (t_1 * (1.0 / ky)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = hypot(sin(kx), sin(ky)) tmp = 0.0 if (sin(ky) <= -0.01) tmp = Float64(sin(ky) / Float64(t_1 * Float64(Float64(1.0 / th) + Float64(th * 0.16666666666666666)))); elseif (sin(ky) <= 4e-5) tmp = Float64(sin(th) / Float64(t_1 * Float64(1.0 / ky))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(kx), sin(ky)); tmp = 0.0; if (sin(ky) <= -0.01) tmp = sin(ky) / (t_1 * ((1.0 / th) + (th * 0.16666666666666666))); elseif (sin(ky) <= 4e-5) tmp = sin(th) / (t_1 * (1.0 / ky)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[(N[Sin[ky], $MachinePrecision] / N[(t$95$1 * N[(N[(1.0 / th), $MachinePrecision] + N[(th * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-5], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 * N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin kx, \sin ky\right)\\
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\frac{\sin ky}{t_1 \cdot \left(\frac{1}{th} + th \cdot 0.16666666666666666\right)}\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin th}{t_1 \cdot \frac{1}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 56.1%
+-commutative56.1%
unpow256.1%
unpow256.1%
hypot-def56.1%
associate-*r*56.1%
unpow256.1%
unpow256.1%
hypot-def56.1%
distribute-rgt-out56.1%
Simplified56.1%
if -0.0100000000000000002 < (sin.f64 ky) < 4.00000000000000033e-5Initial program 87.3%
clear-num87.3%
associate-*l/87.3%
*-un-lft-identity87.3%
unpow287.3%
unpow287.3%
hypot-def99.7%
Applied egg-rr99.7%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 99.1%
if 4.00000000000000033e-5 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 64.2%
Final simplification79.4%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.05)
(* (sin th) (fabs (/ ky (sin kx))))
(if (<= (sin kx) 0.001)
(/ (sin th) (+ 1.0 (* 0.5 (pow (/ kx (sin ky)) 2.0))))
(/ (* (sin ky) (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = sin(th) * fabs((ky / sin(kx)));
} else if (sin(kx) <= 0.001) {
tmp = sin(th) / (1.0 + (0.5 * pow((kx / sin(ky)), 2.0)));
} 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.05d0)) then
tmp = sin(th) * abs((ky / sin(kx)))
else if (sin(kx) <= 0.001d0) then
tmp = sin(th) / (1.0d0 + (0.5d0 * ((kx / sin(ky)) ** 2.0d0)))
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.05) {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
} else if (Math.sin(kx) <= 0.001) {
tmp = Math.sin(th) / (1.0 + (0.5 * Math.pow((kx / Math.sin(ky)), 2.0)));
} 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.05: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) elif math.sin(kx) <= 0.001: tmp = math.sin(th) / (1.0 + (0.5 * math.pow((kx / math.sin(ky)), 2.0))) 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.05) tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = Float64(sin(th) / Float64(1.0 + Float64(0.5 * (Float64(kx / sin(ky)) ^ 2.0)))); else tmp = Float64(Float64(sin(ky) * sin(th)) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = sin(th) * abs((ky / sin(kx))); elseif (sin(kx) <= 0.001) tmp = sin(th) / (1.0 + (0.5 * ((kx / sin(ky)) ^ 2.0))); else tmp = (sin(ky) * sin(th)) / sin(kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.001], N[(N[Sin[th], $MachinePrecision] / N[(1.0 + N[(0.5 * N[Power[N[(kx / N[Sin[ky], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 0.001:\\
\;\;\;\;\frac{\sin th}{1 + 0.5 \cdot {\left(\frac{kx}{\sin ky}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
Taylor expanded in ky around 0 15.4%
add-sqr-sqrt9.9%
sqrt-unprod24.5%
pow224.5%
Applied egg-rr24.5%
unpow224.5%
rem-sqrt-square35.6%
Simplified35.6%
Taylor expanded in ky around 0 31.3%
if -0.050000000000000003 < (sin.f64 kx) < 1e-3Initial program 88.8%
clear-num88.8%
associate-*l/88.8%
*-un-lft-identity88.8%
unpow288.8%
unpow288.8%
hypot-def99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 37.5%
expm1-log1p-u37.5%
expm1-udef37.5%
add-sqr-sqrt37.5%
pow237.5%
sqrt-div37.5%
unpow237.5%
sqrt-prod22.3%
add-sqr-sqrt38.0%
unpow238.0%
sqrt-prod39.2%
add-sqr-sqrt40.7%
Applied egg-rr40.7%
expm1-def40.7%
expm1-log1p40.7%
Simplified40.7%
if 1e-3 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 63.3%
associate-*l/63.3%
*-commutative63.3%
Applied egg-rr63.3%
Final simplification43.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.05)
(* (sin th) (fabs (/ (sin ky) (sin kx))))
(if (<= (sin kx) 0.001)
(/ (sin th) (+ 1.0 (* 0.5 (pow (/ kx (sin ky)) 2.0))))
(/ (* (sin ky) (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
} else if (sin(kx) <= 0.001) {
tmp = sin(th) / (1.0 + (0.5 * pow((kx / sin(ky)), 2.0)));
} 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.05d0)) then
tmp = sin(th) * abs((sin(ky) / sin(kx)))
else if (sin(kx) <= 0.001d0) then
tmp = sin(th) / (1.0d0 + (0.5d0 * ((kx / sin(ky)) ** 2.0d0)))
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.05) {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
} else if (Math.sin(kx) <= 0.001) {
tmp = Math.sin(th) / (1.0 + (0.5 * Math.pow((kx / Math.sin(ky)), 2.0)));
} 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.05: tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) elif math.sin(kx) <= 0.001: tmp = math.sin(th) / (1.0 + (0.5 * math.pow((kx / math.sin(ky)), 2.0))) 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.05) tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = Float64(sin(th) / Float64(1.0 + Float64(0.5 * (Float64(kx / sin(ky)) ^ 2.0)))); else tmp = Float64(Float64(sin(ky) * sin(th)) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = sin(th) * abs((sin(ky) / sin(kx))); elseif (sin(kx) <= 0.001) tmp = sin(th) / (1.0 + (0.5 * ((kx / sin(ky)) ^ 2.0))); else tmp = (sin(ky) * sin(th)) / sin(kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.001], N[(N[Sin[th], $MachinePrecision] / N[(1.0 + N[(0.5 * N[Power[N[(kx / N[Sin[ky], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 0.001:\\
\;\;\;\;\frac{\sin th}{1 + 0.5 \cdot {\left(\frac{kx}{\sin ky}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
Taylor expanded in ky around 0 15.4%
add-sqr-sqrt9.9%
sqrt-unprod24.5%
pow224.5%
Applied egg-rr24.5%
unpow224.5%
rem-sqrt-square35.6%
Simplified35.6%
if -0.050000000000000003 < (sin.f64 kx) < 1e-3Initial program 88.8%
clear-num88.8%
associate-*l/88.8%
*-un-lft-identity88.8%
unpow288.8%
unpow288.8%
hypot-def99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 37.5%
expm1-log1p-u37.5%
expm1-udef37.5%
add-sqr-sqrt37.5%
pow237.5%
sqrt-div37.5%
unpow237.5%
sqrt-prod22.3%
add-sqr-sqrt38.0%
unpow238.0%
sqrt-prod39.2%
add-sqr-sqrt40.7%
Applied egg-rr40.7%
expm1-def40.7%
expm1-log1p40.7%
Simplified40.7%
if 1e-3 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 63.3%
associate-*l/63.3%
*-commutative63.3%
Applied egg-rr63.3%
Final simplification44.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.05) (* (sin th) (fabs (/ ky (sin kx)))) (if (<= (sin kx) 2e-11) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = sin(th) * fabs((ky / sin(kx)));
} else if (sin(kx) <= 2e-11) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.05d0)) then
tmp = sin(th) * abs((ky / sin(kx)))
else if (sin(kx) <= 2d-11) then
tmp = sin(th)
else
tmp = sin(th) * (sin(ky) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.05) {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-11) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.05: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) elif math.sin(kx) <= 2e-11: tmp = math.sin(th) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.05) tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); elseif (sin(kx) <= 2e-11) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = sin(th) * abs((ky / sin(kx))); elseif (sin(kx) <= 2e-11) tmp = sin(th); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-11], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-11}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
Taylor expanded in ky around 0 15.4%
add-sqr-sqrt9.9%
sqrt-unprod24.5%
pow224.5%
Applied egg-rr24.5%
unpow224.5%
rem-sqrt-square35.6%
Simplified35.6%
Taylor expanded in ky around 0 31.3%
if -0.050000000000000003 < (sin.f64 kx) < 1.99999999999999988e-11Initial program 88.5%
Taylor expanded in kx around 0 37.4%
if 1.99999999999999988e-11 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 60.8%
Final simplification41.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 93.6%
expm1-log1p-u93.4%
expm1-udef41.6%
Applied egg-rr43.4%
expm1-def99.6%
expm1-log1p99.7%
*-commutative99.7%
associate-*r/95.0%
associate-*l/99.6%
*-commutative99.6%
hypot-def93.5%
unpow293.5%
unpow293.5%
+-commutative93.5%
unpow293.5%
unpow293.5%
hypot-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00043)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(if (or (<= th 1.45e+41) (not (<= th 1.14e+101)))
(* (sin th) (fabs (/ (sin ky) (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00043) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else if ((th <= 1.45e+41) || !(th <= 1.14e+101)) {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00043) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else if ((th <= 1.45e+41) || !(th <= 1.14e+101)) {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00043: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * th elif (th <= 1.45e+41) or not (th <= 1.14e+101): tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00043) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); elseif ((th <= 1.45e+41) || !(th <= 1.14e+101)) tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00043) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; elseif ((th <= 1.45e+41) || ~((th <= 1.14e+101))) tmp = sin(th) * abs((sin(ky) / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00043], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], If[Or[LessEqual[th, 1.45e+41], N[Not[LessEqual[th, 1.14e+101]], $MachinePrecision]], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00043:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{elif}\;th \leq 1.45 \cdot 10^{+41} \lor \neg \left(th \leq 1.14 \cdot 10^{+101}\right):\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if th < 4.29999999999999989e-4Initial program 92.8%
Taylor expanded in th around 0 59.5%
expm1-log1p-u58.9%
expm1-udef13.0%
Applied egg-rr13.2%
expm1-def67.4%
expm1-log1p67.9%
hypot-def63.1%
unpow263.1%
unpow263.1%
+-commutative63.1%
unpow263.1%
unpow263.1%
hypot-def67.9%
Simplified67.9%
if 4.29999999999999989e-4 < th < 1.44999999999999994e41 or 1.13999999999999997e101 < th Initial program 94.7%
Taylor expanded in ky around 0 30.2%
add-sqr-sqrt12.7%
sqrt-unprod9.8%
pow29.8%
Applied egg-rr9.8%
unpow29.8%
rem-sqrt-square22.4%
Simplified22.4%
if 1.44999999999999994e41 < th < 1.13999999999999997e101Initial program 99.7%
Taylor expanded in kx around 0 33.3%
Final simplification55.5%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.1586) (fabs (* ky (/ th (sin kx)))) (if (<= (sin kx) 0.001) (sin th) (* (sin th) (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.1586) {
tmp = fabs((ky * (th / sin(kx))));
} else if (sin(kx) <= 0.001) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.1586d0)) then
tmp = abs((ky * (th / sin(kx))))
else if (sin(kx) <= 0.001d0) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.1586) {
tmp = Math.abs((ky * (th / Math.sin(kx))));
} else if (Math.sin(kx) <= 0.001) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.1586: tmp = math.fabs((ky * (th / math.sin(kx)))) elif math.sin(kx) <= 0.001: tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.1586) tmp = abs(Float64(ky * Float64(th / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.1586) tmp = abs((ky * (th / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.1586], N[Abs[N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.001], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.1586:\\
\;\;\;\;\left|ky \cdot \frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 0.001:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.158599999999999991Initial program 99.4%
Taylor expanded in th around 0 57.9%
Taylor expanded in ky around 0 16.7%
associate-/l*16.7%
Simplified16.7%
add-cube-cbrt16.7%
pow316.7%
Applied egg-rr16.7%
rem-square-sqrt12.5%
sqrt-unprod18.6%
pow218.6%
rem-cube-cbrt18.6%
div-inv18.6%
clear-num18.6%
Applied egg-rr18.6%
unpow218.6%
rem-sqrt-square26.4%
Simplified26.4%
if -0.158599999999999991 < (sin.f64 kx) < 1e-3Initial program 89.0%
Taylor expanded in kx around 0 37.2%
if 1e-3 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 55.2%
associate-/l*55.1%
associate-/r/55.2%
Simplified55.2%
Final simplification39.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.1586) (fabs (* ky (/ th (sin kx)))) (if (<= (sin kx) 0.001) (sin th) (/ (* ky (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.1586) {
tmp = fabs((ky * (th / sin(kx))));
} else if (sin(kx) <= 0.001) {
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.1586d0)) then
tmp = abs((ky * (th / sin(kx))))
else if (sin(kx) <= 0.001d0) 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.1586) {
tmp = Math.abs((ky * (th / Math.sin(kx))));
} else if (Math.sin(kx) <= 0.001) {
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.1586: tmp = math.fabs((ky * (th / math.sin(kx)))) elif math.sin(kx) <= 0.001: 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.1586) tmp = abs(Float64(ky * Float64(th / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = sin(th); else tmp = Float64(Float64(ky * sin(th)) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.1586) tmp = abs((ky * (th / sin(kx)))); elseif (sin(kx) <= 0.001) 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.1586], N[Abs[N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.001], N[Sin[th], $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.1586:\\
\;\;\;\;\left|ky \cdot \frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 0.001:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.158599999999999991Initial program 99.4%
Taylor expanded in th around 0 57.9%
Taylor expanded in ky around 0 16.7%
associate-/l*16.7%
Simplified16.7%
add-cube-cbrt16.7%
pow316.7%
Applied egg-rr16.7%
rem-square-sqrt12.5%
sqrt-unprod18.6%
pow218.6%
rem-cube-cbrt18.6%
div-inv18.6%
clear-num18.6%
Applied egg-rr18.6%
unpow218.6%
rem-sqrt-square26.4%
Simplified26.4%
if -0.158599999999999991 < (sin.f64 kx) < 1e-3Initial program 89.0%
Taylor expanded in kx around 0 37.2%
if 1e-3 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 55.2%
Final simplification39.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.1586) (fabs (* (sin ky) (/ th (sin kx)))) (if (<= (sin kx) 0.001) (sin th) (/ (* ky (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.1586) {
tmp = fabs((sin(ky) * (th / sin(kx))));
} else if (sin(kx) <= 0.001) {
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.1586d0)) then
tmp = abs((sin(ky) * (th / sin(kx))))
else if (sin(kx) <= 0.001d0) 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.1586) {
tmp = Math.abs((Math.sin(ky) * (th / Math.sin(kx))));
} else if (Math.sin(kx) <= 0.001) {
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.1586: tmp = math.fabs((math.sin(ky) * (th / math.sin(kx)))) elif math.sin(kx) <= 0.001: 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.1586) tmp = abs(Float64(sin(ky) * Float64(th / sin(kx)))); elseif (sin(kx) <= 0.001) tmp = sin(th); else tmp = Float64(Float64(ky * sin(th)) / sin(kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.1586) tmp = abs((sin(ky) * (th / sin(kx)))); elseif (sin(kx) <= 0.001) 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.1586], N[Abs[N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.001], N[Sin[th], $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.1586:\\
\;\;\;\;\left|\sin ky \cdot \frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 0.001:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.158599999999999991Initial program 99.4%
Taylor expanded in ky around 0 16.3%
Taylor expanded in th around 0 16.5%
associate-/l*16.5%
Simplified16.5%
add-sqr-sqrt12.7%
sqrt-unprod20.6%
pow220.6%
associate-/r/20.6%
*-commutative20.6%
Applied egg-rr20.6%
unpow220.6%
rem-sqrt-square28.5%
Simplified28.5%
if -0.158599999999999991 < (sin.f64 kx) < 1e-3Initial program 89.0%
Taylor expanded in kx around 0 37.2%
if 1e-3 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 55.2%
Final simplification39.5%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.000475) (* (/ (sin ky) (hypot (sin ky) (sin kx))) th) (/ (* ky (sin th)) (hypot (sin kx) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.000475) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else {
tmp = (ky * sin(th)) / hypot(sin(kx), sin(ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.000475) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(kx), Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.000475: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * th else: tmp = (ky * math.sin(th)) / math.hypot(math.sin(kx), math.sin(ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.000475) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); else tmp = Float64(Float64(ky * sin(th)) / hypot(sin(kx), sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.000475) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; else tmp = (ky * sin(th)) / hypot(sin(kx), sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.000475], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.000475:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin kx, \sin ky\right)}\\
\end{array}
\end{array}
if th < 4.74999999999999999e-4Initial program 92.8%
Taylor expanded in th around 0 59.5%
expm1-log1p-u58.9%
expm1-udef13.0%
Applied egg-rr13.2%
expm1-def67.4%
expm1-log1p67.9%
hypot-def63.1%
unpow263.1%
unpow263.1%
+-commutative63.1%
unpow263.1%
unpow263.1%
hypot-def67.9%
Simplified67.9%
if 4.74999999999999999e-4 < th Initial program 95.7%
expm1-log1p-u95.5%
expm1-udef59.4%
Applied egg-rr62.0%
expm1-def99.5%
expm1-log1p99.7%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.8%
Final simplification63.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.0008) (sin th) (* (sin th) (fabs (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0008) {
tmp = sin(th);
} else {
tmp = sin(th) * fabs((ky / sin(kx)));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 0.0008d0) then
tmp = sin(th)
else
tmp = sin(th) * abs((ky / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0008) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.0008: tmp = math.sin(th) else: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.0008) tmp = sin(th); else tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.0008) tmp = sin(th); else tmp = sin(th) * abs((ky / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.0008], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.0008:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 8.00000000000000038e-4Initial program 91.9%
Taylor expanded in kx around 0 28.7%
if 8.00000000000000038e-4 < kx Initial program 99.4%
Taylor expanded in ky around 0 31.2%
add-sqr-sqrt11.1%
sqrt-unprod20.6%
pow220.6%
Applied egg-rr20.6%
unpow220.6%
rem-sqrt-square28.4%
Simplified28.4%
Taylor expanded in ky around 0 23.4%
Final simplification27.5%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.5e+18) (sin th) (fabs (* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.5e+18) {
tmp = sin(th);
} else {
tmp = fabs((ky * (th / sin(kx))));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.5d+18) then
tmp = sin(th)
else
tmp = abs((ky * (th / sin(kx))))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.5e+18) {
tmp = Math.sin(th);
} else {
tmp = Math.abs((ky * (th / Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.5e+18: tmp = math.sin(th) else: tmp = math.fabs((ky * (th / math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.5e+18) tmp = sin(th); else tmp = abs(Float64(ky * Float64(th / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.5e+18) tmp = sin(th); else tmp = abs((ky * (th / sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.5e+18], N[Sin[th], $MachinePrecision], N[Abs[N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.5 \cdot 10^{+18}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|ky \cdot \frac{th}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 1.5e18Initial program 92.2%
Taylor expanded in kx around 0 28.2%
if 1.5e18 < kx Initial program 99.4%
Taylor expanded in th around 0 46.7%
Taylor expanded in ky around 0 14.9%
associate-/l*14.9%
Simplified14.9%
add-cube-cbrt14.8%
pow314.9%
Applied egg-rr14.9%
rem-square-sqrt13.3%
sqrt-unprod14.8%
pow214.8%
rem-cube-cbrt14.8%
div-inv14.8%
clear-num14.8%
Applied egg-rr14.8%
unpow214.8%
rem-sqrt-square18.9%
Simplified18.9%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.7e+18) (sin th) (fabs (* th (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e+18) {
tmp = sin(th);
} else {
tmp = fabs((th * (ky / sin(kx))));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.7d+18) then
tmp = sin(th)
else
tmp = abs((th * (ky / sin(kx))))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e+18) {
tmp = Math.sin(th);
} else {
tmp = Math.abs((th * (ky / Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e+18: tmp = math.sin(th) else: tmp = math.fabs((th * (ky / math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e+18) tmp = sin(th); else tmp = abs(Float64(th * Float64(ky / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.7e+18) tmp = sin(th); else tmp = abs((th * (ky / sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e+18], N[Sin[th], $MachinePrecision], N[Abs[N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{+18}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|th \cdot \frac{ky}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 1.7e18Initial program 92.2%
Taylor expanded in kx around 0 28.2%
if 1.7e18 < kx Initial program 99.4%
Taylor expanded in th around 0 46.7%
Taylor expanded in ky around 0 14.9%
associate-/l*14.9%
Simplified14.9%
add-sqr-sqrt13.3%
sqrt-unprod14.8%
pow214.8%
div-inv14.8%
clear-num14.8%
Applied egg-rr14.8%
unpow214.8%
rem-sqrt-square18.9%
*-commutative18.9%
associate-*l/18.9%
associate-*r/18.9%
Simplified18.9%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.75e+18) (sin th) (* th (/ ky (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.75e+18) {
tmp = sin(th);
} else {
tmp = th * (ky / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.75d+18) then
tmp = sin(th)
else
tmp = th * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.75e+18) {
tmp = Math.sin(th);
} else {
tmp = th * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.75e+18: tmp = math.sin(th) else: tmp = th * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.75e+18) tmp = sin(th); else tmp = Float64(th * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.75e+18) tmp = sin(th); else tmp = th * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.75e+18], N[Sin[th], $MachinePrecision], N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.75 \cdot 10^{+18}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.75e18Initial program 92.2%
Taylor expanded in kx around 0 28.2%
if 1.75e18 < kx Initial program 99.4%
Taylor expanded in th around 0 46.7%
Taylor expanded in ky around 0 14.9%
associate-/l*14.9%
Simplified14.9%
associate-/r/14.9%
Applied egg-rr14.9%
Final simplification25.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.5e-174) (* th (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.5e-174) {
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 <= 5.5d-174) 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 <= 5.5e-174) {
tmp = th * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.5e-174: tmp = th * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.5e-174) 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 <= 5.5e-174) tmp = th * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.5e-174], N[(th * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.5 \cdot 10^{-174}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 5.4999999999999999e-174Initial program 89.6%
Taylor expanded in th around 0 40.4%
Taylor expanded in ky around 0 15.9%
associate-/l*16.3%
Simplified16.3%
Taylor expanded in kx around 0 13.2%
associate-/l*13.6%
Simplified13.6%
associate-/r/13.7%
Applied egg-rr13.7%
if 5.4999999999999999e-174 < ky Initial program 99.7%
Taylor expanded in kx around 0 36.6%
Final simplification22.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.2e-168) (* th (/ ky kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.2e-168) {
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 <= 2.2d-168) 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 <= 2.2e-168) {
tmp = th * (ky / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.2e-168: tmp = th * (ky / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.2e-168) 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 <= 2.2e-168) tmp = th * (ky / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.2e-168], N[(th * N[(ky / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.2 \cdot 10^{-168}:\\
\;\;\;\;th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 2.1999999999999998e-168Initial program 89.7%
Taylor expanded in th around 0 40.1%
Taylor expanded in ky around 0 15.8%
associate-/l*16.2%
Simplified16.2%
Taylor expanded in kx around 0 13.2%
associate-/l*13.6%
Simplified13.6%
associate-/r/13.6%
Applied egg-rr13.6%
if 2.1999999999999998e-168 < ky Initial program 99.7%
Taylor expanded in th around 0 49.7%
Taylor expanded in kx around 0 17.5%
Final simplification15.2%
(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.6%
Taylor expanded in th around 0 43.9%
Taylor expanded in kx around 0 11.7%
Final simplification11.7%
herbie shell --seed 2024016
(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)))