
(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 th) (/ (hypot (sin ky) (sin kx)) (sin ky))))
double code(double kx, double ky, double th) {
return sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
def code(kx, ky, th): return math.sin(th) / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky))
function code(kx, ky, th) return Float64(sin(th) / Float64(hypot(sin(ky), sin(kx)) / sin(ky))) end
function tmp = code(kx, ky, th) tmp = sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky)); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\end{array}
Initial program 92.3%
unpow292.3%
sqr-neg92.3%
sin-neg92.3%
sin-neg92.3%
unpow292.3%
associate-*l/90.8%
associate-/l*92.3%
unpow292.3%
Simplified99.6%
associate-*r/95.3%
hypot-undefine90.8%
unpow290.8%
unpow290.8%
+-commutative90.8%
associate-*l/92.3%
*-commutative92.3%
clear-num92.3%
un-div-inv92.4%
+-commutative92.4%
unpow292.4%
unpow292.4%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.05)
(fabs (* ky t_1))
(if (<= (sin kx) 5e-70) (sin th) (* (sin ky) t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.05) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 5e-70) {
tmp = sin(th);
} else {
tmp = sin(ky) * t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.05d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 5d-70) then
tmp = sin(th)
else
tmp = sin(ky) * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.05) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 5e-70) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.05: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 5e-70: tmp = math.sin(th) else: tmp = math.sin(ky) * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.05) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = Float64(sin(ky) * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.05) tmp = abs((ky * t_1)); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = sin(ky) * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-70], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-70}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
associate-*r/99.5%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
clear-num99.2%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 10.5%
add-sqr-sqrt9.0%
sqrt-unprod16.8%
pow216.8%
associate-/r/16.7%
*-commutative16.7%
Applied egg-rr16.7%
unpow216.7%
rem-sqrt-square24.7%
Simplified24.7%
if -0.050000000000000003 < (sin.f64 kx) < 4.9999999999999998e-70Initial program 84.4%
unpow284.4%
sqr-neg84.4%
sin-neg84.4%
sin-neg84.4%
unpow284.4%
associate-*l/81.9%
associate-/l*84.3%
unpow284.3%
Simplified99.8%
Taylor expanded in kx around 0 38.9%
if 4.9999999999999998e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.0%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 68.9%
Final simplification42.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.05) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 5e-70) (sin th) (/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 5e-70) {
tmp = sin(th);
} else {
tmp = sin(ky) / (sin(kx) / sin(th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.05d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 5d-70) then
tmp = sin(th)
else
tmp = sin(ky) / (sin(kx) / sin(th))
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.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-70) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.05: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 5e-70: tmp = math.sin(th) else: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.05) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-70], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-70}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
associate-*r/99.5%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
clear-num99.2%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 10.5%
add-sqr-sqrt9.0%
sqrt-unprod16.8%
pow216.8%
associate-/r/16.7%
*-commutative16.7%
Applied egg-rr16.7%
unpow216.7%
rem-sqrt-square24.7%
Simplified24.7%
if -0.050000000000000003 < (sin.f64 kx) < 4.9999999999999998e-70Initial program 84.4%
unpow284.4%
sqr-neg84.4%
sin-neg84.4%
sin-neg84.4%
unpow284.4%
associate-*l/81.9%
associate-/l*84.3%
unpow284.3%
Simplified99.8%
Taylor expanded in kx around 0 38.9%
if 4.9999999999999998e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.0%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in ky around 0 68.9%
clear-num68.8%
un-div-inv68.9%
Applied egg-rr68.9%
Final simplification42.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 1e-15) (/ (sin th) (fabs (/ (sin kx) ky))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 1e-15) {
tmp = sin(th) / fabs((sin(kx) / ky));
} 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.01d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 1d-15) then
tmp = sin(th) / abs((sin(kx) / ky))
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.01) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 1e-15) {
tmp = Math.sin(th) / Math.abs((Math.sin(kx) / ky));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 1e-15: tmp = math.sin(th) / math.fabs((math.sin(kx) / ky)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-15) tmp = Float64(sin(th) / abs(Float64(sin(kx) / 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 = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-15) tmp = sin(th) / abs((sin(kx) / ky)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-15], N[(N[Sin[th], $MachinePrecision] / N[Abs[N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 10^{-15}:\\
\;\;\;\;\frac{\sin th}{\left|\frac{\sin kx}{ky}\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 2.8%
add-sqr-sqrt1.6%
sqrt-unprod26.4%
pow226.4%
Applied egg-rr26.4%
if -0.0100000000000000002 < (sin.f64 ky) < 1.0000000000000001e-15Initial program 85.0%
unpow285.0%
sqr-neg85.0%
sin-neg85.0%
sin-neg85.0%
unpow285.0%
associate-*l/82.0%
associate-/l*85.0%
unpow285.0%
Simplified99.7%
associate-*r/91.1%
hypot-undefine82.0%
unpow282.0%
unpow282.0%
+-commutative82.0%
associate-*l/85.0%
*-commutative85.0%
clear-num85.0%
un-div-inv85.1%
+-commutative85.1%
unpow285.1%
unpow285.1%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in ky around 0 43.7%
add-sqr-sqrt19.8%
sqrt-unprod35.4%
pow235.4%
Applied egg-rr35.4%
unpow235.4%
rem-sqrt-square44.6%
Simplified44.6%
if 1.0000000000000001e-15 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
Taylor expanded in kx around 0 56.8%
Final simplification43.0%
(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 92.3%
unpow292.3%
sqr-neg92.3%
sin-neg92.3%
sin-neg92.3%
unpow292.3%
associate-*l/90.8%
associate-/l*92.3%
unpow292.3%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th) :precision binary64 (* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(th) * (sin(ky) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(th) * (sin(ky) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 92.3%
+-commutative92.3%
unpow292.3%
unpow292.3%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (fabs (sin th)) (if (<= (sin ky) 1e-39) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-39) {
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.01d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-39) 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.01) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-39) {
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.01: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-39: 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.01) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-39) 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.01) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-39) 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.01], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-39], 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.01:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-39}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 2.8%
add-exp-log1.6%
Applied egg-rr1.6%
rem-exp-log2.8%
add-sqr-sqrt1.6%
sqrt-unprod26.4%
pow226.4%
Applied egg-rr26.4%
unpow226.4%
rem-sqrt-square32.7%
Simplified32.7%
if -0.0100000000000000002 < (sin.f64 ky) < 9.99999999999999929e-40Initial program 83.9%
unpow283.9%
sqr-neg83.9%
sin-neg83.9%
sin-neg83.9%
unpow283.9%
associate-*l/80.7%
associate-/l*84.0%
unpow284.0%
Simplified99.7%
Taylor expanded in ky around 0 40.8%
associate-/l*42.6%
Simplified42.6%
if 9.99999999999999929e-40 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 53.4%
Final simplification43.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (fabs (sin th)) (if (<= (sin ky) 1e-39) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-39) {
tmp = sin(th) / (sin(kx) / ky);
} 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.01d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-39) then
tmp = sin(th) / (sin(kx) / ky)
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.01) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-39) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-39: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-39) tmp = Float64(sin(th) / Float64(sin(kx) / 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 = abs(sin(th)); elseif (sin(ky) <= 1e-39) tmp = sin(th) / (sin(kx) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-39], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-39}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 2.8%
add-exp-log1.6%
Applied egg-rr1.6%
rem-exp-log2.8%
add-sqr-sqrt1.6%
sqrt-unprod26.4%
pow226.4%
Applied egg-rr26.4%
unpow226.4%
rem-sqrt-square32.7%
Simplified32.7%
if -0.0100000000000000002 < (sin.f64 ky) < 9.99999999999999929e-40Initial program 83.9%
unpow283.9%
sqr-neg83.9%
sin-neg83.9%
sin-neg83.9%
unpow283.9%
associate-*l/80.7%
associate-/l*84.0%
unpow284.0%
Simplified99.7%
associate-*r/90.5%
hypot-undefine80.7%
unpow280.7%
unpow280.7%
+-commutative80.7%
associate-*l/83.9%
*-commutative83.9%
clear-num83.9%
un-div-inv84.0%
+-commutative84.0%
unpow284.0%
unpow284.0%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in ky around 0 42.7%
if 9.99999999999999929e-40 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 53.4%
Final simplification43.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 1e-39) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 1e-39) {
tmp = sin(th) / (sin(kx) / ky);
} 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.01d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 1d-39) then
tmp = sin(th) / (sin(kx) / ky)
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.01) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 1e-39) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 1e-39: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-39) tmp = Float64(sin(th) / Float64(sin(kx) / 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 = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-39) tmp = sin(th) / (sin(kx) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-39], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 10^{-39}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.7%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 2.8%
add-sqr-sqrt1.6%
sqrt-unprod26.4%
pow226.4%
Applied egg-rr26.4%
if -0.0100000000000000002 < (sin.f64 ky) < 9.99999999999999929e-40Initial program 83.9%
unpow283.9%
sqr-neg83.9%
sin-neg83.9%
sin-neg83.9%
unpow283.9%
associate-*l/80.7%
associate-/l*84.0%
unpow284.0%
Simplified99.7%
associate-*r/90.5%
hypot-undefine80.7%
unpow280.7%
unpow280.7%
+-commutative80.7%
associate-*l/83.9%
*-commutative83.9%
clear-num83.9%
un-div-inv84.0%
+-commutative84.0%
unpow284.0%
unpow284.0%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in ky around 0 42.7%
if 9.99999999999999929e-40 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 53.4%
Final simplification41.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.05) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 5e-70) (sin th) (/ (sin th) (/ (sin kx) ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 5e-70) {
tmp = sin(th);
} else {
tmp = sin(th) / (sin(kx) / ky);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.05d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 5d-70) then
tmp = sin(th)
else
tmp = sin(th) / (sin(kx) / ky)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.05) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-70) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.05: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 5e-70: tmp = math.sin(th) else: tmp = math.sin(th) / (math.sin(kx) / ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.05) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = Float64(sin(th) / Float64(sin(kx) / ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-70) tmp = sin(th); else tmp = sin(th) / (sin(kx) / ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-70], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-70}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
associate-*r/99.5%
hypot-undefine99.4%
unpow299.4%
unpow299.4%
+-commutative99.4%
associate-*l/99.4%
*-commutative99.4%
clear-num99.2%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 10.5%
add-sqr-sqrt9.0%
sqrt-unprod16.8%
pow216.8%
associate-/r/16.7%
*-commutative16.7%
Applied egg-rr16.7%
unpow216.7%
rem-sqrt-square24.7%
Simplified24.7%
if -0.050000000000000003 < (sin.f64 kx) < 4.9999999999999998e-70Initial program 84.4%
unpow284.4%
sqr-neg84.4%
sin-neg84.4%
sin-neg84.4%
unpow284.4%
associate-*l/81.9%
associate-/l*84.3%
unpow284.3%
Simplified99.8%
Taylor expanded in kx around 0 38.9%
if 4.9999999999999998e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.0%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
associate-*r/98.0%
hypot-undefine98.0%
unpow298.0%
unpow298.0%
+-commutative98.0%
associate-*l/99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 63.4%
Final simplification40.8%
(FPCore (kx ky th) :precision binary64 (let* ((t_1 (hypot (sin ky) (sin kx)))) (if (<= th 0.025) (* th (/ (sin ky) t_1)) (/ 1.0 (/ t_1 (* (sin th) ky))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (th <= 0.025) {
tmp = th * (sin(ky) / t_1);
} else {
tmp = 1.0 / (t_1 / (sin(th) * ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (th <= 0.025) {
tmp = th * (Math.sin(ky) / t_1);
} else {
tmp = 1.0 / (t_1 / (Math.sin(th) * ky));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if th <= 0.025: tmp = th * (math.sin(ky) / t_1) else: tmp = 1.0 / (t_1 / (math.sin(th) * ky)) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (th <= 0.025) tmp = Float64(th * Float64(sin(ky) / t_1)); else tmp = Float64(1.0 / Float64(t_1 / Float64(sin(th) * ky))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (th <= 0.025) tmp = th * (sin(ky) / t_1); else tmp = 1.0 / (t_1 / (sin(th) * ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[th, 0.025], N[(th * N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 / N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;th \leq 0.025:\\
\;\;\;\;th \cdot \frac{\sin ky}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{\sin th \cdot ky}}\\
\end{array}
\end{array}
if th < 0.025000000000000001Initial program 92.6%
+-commutative92.6%
unpow292.6%
unpow292.6%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 66.1%
if 0.025000000000000001 < th Initial program 91.5%
unpow291.5%
sqr-neg91.5%
sin-neg91.5%
sin-neg91.5%
unpow291.5%
associate-*l/91.5%
associate-/l*91.6%
unpow291.6%
Simplified99.6%
associate-*r/99.5%
hypot-undefine91.5%
unpow291.5%
unpow291.5%
+-commutative91.5%
clear-num91.4%
+-commutative91.4%
unpow291.4%
unpow291.4%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 53.7%
Final simplification63.1%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= th 0.0078)
(* th (/ (sin ky) t_1))
(/ (sin th) (* t_1 (/ 1.0 ky))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (th <= 0.0078) {
tmp = th * (sin(ky) / t_1);
} else {
tmp = sin(th) / (t_1 * (1.0 / ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (th <= 0.0078) {
tmp = th * (Math.sin(ky) / t_1);
} else {
tmp = Math.sin(th) / (t_1 * (1.0 / ky));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if th <= 0.0078: tmp = th * (math.sin(ky) / t_1) else: tmp = math.sin(th) / (t_1 * (1.0 / ky)) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (th <= 0.0078) tmp = Float64(th * Float64(sin(ky) / t_1)); else tmp = Float64(sin(th) / Float64(t_1 * Float64(1.0 / ky))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (th <= 0.0078) tmp = th * (sin(ky) / t_1); else tmp = sin(th) / (t_1 * (1.0 / ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[th, 0.0078], N[(th * N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 * N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;th \leq 0.0078:\\
\;\;\;\;th \cdot \frac{\sin ky}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{t\_1 \cdot \frac{1}{ky}}\\
\end{array}
\end{array}
if th < 0.0077999999999999996Initial program 92.6%
+-commutative92.6%
unpow292.6%
unpow292.6%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 66.1%
if 0.0077999999999999996 < th Initial program 91.5%
unpow291.5%
sqr-neg91.5%
sin-neg91.5%
sin-neg91.5%
unpow291.5%
associate-*l/91.5%
associate-/l*91.6%
unpow291.6%
Simplified99.6%
associate-*r/99.5%
hypot-undefine91.5%
unpow291.5%
unpow291.5%
+-commutative91.5%
associate-*l/91.5%
*-commutative91.5%
clear-num91.4%
un-div-inv91.6%
+-commutative91.6%
unpow291.6%
unpow291.6%
hypot-undefine99.6%
Applied egg-rr99.6%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 53.7%
Final simplification63.1%
(FPCore (kx ky th) :precision binary64 (if (<= th 1.25) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (if (<= th 1.55e+64) (sin th) (/ (sin th) (fabs (/ (sin kx) ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.25) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (th <= 1.55e+64) {
tmp = sin(th);
} else {
tmp = sin(th) / fabs((sin(kx) / ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.25) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 1.55e+64) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / Math.abs((Math.sin(kx) / ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 1.25: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 1.55e+64: tmp = math.sin(th) else: tmp = math.sin(th) / math.fabs((math.sin(kx) / ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 1.25) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (th <= 1.55e+64) tmp = sin(th); else tmp = Float64(sin(th) / abs(Float64(sin(kx) / ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 1.25) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (th <= 1.55e+64) tmp = sin(th); else tmp = sin(th) / abs((sin(kx) / ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 1.25], 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.55e+64], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[Abs[N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 1.25:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 1.55 \cdot 10^{+64}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\left|\frac{\sin kx}{ky}\right|}\\
\end{array}
\end{array}
if th < 1.25Initial program 92.7%
unpow292.7%
sqr-neg92.7%
sin-neg92.7%
sin-neg92.7%
unpow292.7%
associate-*l/90.6%
associate-/l*92.6%
unpow292.6%
Simplified99.6%
Taylor expanded in th around 0 65.8%
if 1.25 < th < 1.55e64Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/96.9%
associate-/l*96.9%
unpow296.9%
Simplified100.0%
Taylor expanded in kx around 0 26.6%
if 1.55e64 < th Initial program 90.5%
unpow290.5%
sqr-neg90.5%
sin-neg90.5%
sin-neg90.5%
unpow290.5%
associate-*l/90.6%
associate-/l*90.6%
unpow290.6%
Simplified99.5%
associate-*r/99.5%
hypot-undefine90.6%
unpow290.6%
unpow290.6%
+-commutative90.6%
associate-*l/90.5%
*-commutative90.5%
clear-num90.4%
un-div-inv90.6%
+-commutative90.6%
unpow290.6%
unpow290.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 18.0%
add-sqr-sqrt5.8%
sqrt-unprod11.0%
pow211.0%
Applied egg-rr11.0%
unpow211.0%
rem-sqrt-square16.1%
Simplified16.1%
Final simplification54.1%
(FPCore (kx ky th) :precision binary64 (if (<= th 1.25) (* th (/ (sin ky) (hypot (sin ky) (sin kx)))) (if (<= th 1.96e+65) (sin th) (/ (sin th) (fabs (/ (sin kx) ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.25) {
tmp = th * (sin(ky) / hypot(sin(ky), sin(kx)));
} else if (th <= 1.96e+65) {
tmp = sin(th);
} else {
tmp = sin(th) / fabs((sin(kx) / ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.25) {
tmp = th * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 1.96e+65) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / Math.abs((Math.sin(kx) / ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 1.25: tmp = th * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 1.96e+65: tmp = math.sin(th) else: tmp = math.sin(th) / math.fabs((math.sin(kx) / ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 1.25) tmp = Float64(th * Float64(sin(ky) / hypot(sin(ky), sin(kx)))); elseif (th <= 1.96e+65) tmp = sin(th); else tmp = Float64(sin(th) / abs(Float64(sin(kx) / ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 1.25) tmp = th * (sin(ky) / hypot(sin(ky), sin(kx))); elseif (th <= 1.96e+65) tmp = sin(th); else tmp = sin(th) / abs((sin(kx) / ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 1.25], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.96e+65], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[Abs[N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 1.25:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 1.96 \cdot 10^{+65}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\left|\frac{\sin kx}{ky}\right|}\\
\end{array}
\end{array}
if th < 1.25Initial program 92.7%
+-commutative92.7%
unpow292.7%
unpow292.7%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 65.9%
if 1.25 < th < 1.9600000000000001e65Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/96.9%
associate-/l*96.9%
unpow296.9%
Simplified100.0%
Taylor expanded in kx around 0 26.6%
if 1.9600000000000001e65 < th Initial program 90.5%
unpow290.5%
sqr-neg90.5%
sin-neg90.5%
sin-neg90.5%
unpow290.5%
associate-*l/90.6%
associate-/l*90.6%
unpow290.6%
Simplified99.5%
associate-*r/99.5%
hypot-undefine90.6%
unpow290.6%
unpow290.6%
+-commutative90.6%
associate-*l/90.5%
*-commutative90.5%
clear-num90.4%
un-div-inv90.6%
+-commutative90.6%
unpow290.6%
unpow290.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 18.0%
add-sqr-sqrt5.8%
sqrt-unprod11.0%
pow211.0%
Applied egg-rr11.0%
unpow211.0%
rem-sqrt-square16.1%
Simplified16.1%
Final simplification54.2%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 1e-177)
(/ (sin th) (/ kx ky))
(if (<= ky 9e-121)
(sin th)
(if (<= ky 2.1e-100)
(* ky (/ th (sin kx)))
(if (<= ky 6.2e+93) (sin th) (fabs (sin th)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-177) {
tmp = sin(th) / (kx / ky);
} else if (ky <= 9e-121) {
tmp = sin(th);
} else if (ky <= 2.1e-100) {
tmp = ky * (th / sin(kx));
} else if (ky <= 6.2e+93) {
tmp = sin(th);
} else {
tmp = fabs(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 <= 1d-177) then
tmp = sin(th) / (kx / ky)
else if (ky <= 9d-121) then
tmp = sin(th)
else if (ky <= 2.1d-100) then
tmp = ky * (th / sin(kx))
else if (ky <= 6.2d+93) then
tmp = sin(th)
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-177) {
tmp = Math.sin(th) / (kx / ky);
} else if (ky <= 9e-121) {
tmp = Math.sin(th);
} else if (ky <= 2.1e-100) {
tmp = ky * (th / Math.sin(kx));
} else if (ky <= 6.2e+93) {
tmp = Math.sin(th);
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1e-177: tmp = math.sin(th) / (kx / ky) elif ky <= 9e-121: tmp = math.sin(th) elif ky <= 2.1e-100: tmp = ky * (th / math.sin(kx)) elif ky <= 6.2e+93: tmp = math.sin(th) else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1e-177) tmp = Float64(sin(th) / Float64(kx / ky)); elseif (ky <= 9e-121) tmp = sin(th); elseif (ky <= 2.1e-100) tmp = Float64(ky * Float64(th / sin(kx))); elseif (ky <= 6.2e+93) tmp = sin(th); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1e-177) tmp = sin(th) / (kx / ky); elseif (ky <= 9e-121) tmp = sin(th); elseif (ky <= 2.1e-100) tmp = ky * (th / sin(kx)); elseif (ky <= 6.2e+93) tmp = sin(th); else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1e-177], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 9e-121], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 2.1e-100], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 6.2e+93], N[Sin[th], $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 10^{-177}:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{elif}\;ky \leq 9 \cdot 10^{-121}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 2.1 \cdot 10^{-100}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{elif}\;ky \leq 6.2 \cdot 10^{+93}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < 9.99999999999999952e-178Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/86.8%
associate-/l*89.2%
unpow289.2%
Simplified99.7%
associate-*r/93.4%
hypot-undefine86.8%
unpow286.8%
unpow286.8%
+-commutative86.8%
associate-*l/89.2%
*-commutative89.2%
clear-num89.2%
un-div-inv89.3%
+-commutative89.3%
unpow289.3%
unpow289.3%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 27.5%
Taylor expanded in kx around 0 18.8%
if 9.99999999999999952e-178 < ky < 9.0000000000000007e-121 or 2.10000000000000009e-100 < ky < 6.20000000000000038e93Initial program 96.0%
unpow296.0%
sqr-neg96.0%
sin-neg96.0%
sin-neg96.0%
unpow296.0%
associate-*l/95.9%
associate-/l*95.8%
unpow295.8%
Simplified99.5%
Taylor expanded in kx around 0 47.5%
if 9.0000000000000007e-121 < ky < 2.10000000000000009e-100Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
associate-*r/99.0%
hypot-undefine99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
clear-num73.2%
+-commutative73.2%
unpow273.2%
unpow273.2%
hypot-undefine73.2%
Applied egg-rr73.2%
Taylor expanded in th around 0 73.2%
associate-/r*73.7%
+-commutative73.7%
unpow273.7%
unpow273.7%
hypot-undefine73.7%
Simplified73.7%
Taylor expanded in ky around 0 67.3%
associate-/l*67.8%
Simplified67.8%
if 6.20000000000000038e93 < 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 19.5%
add-exp-log6.5%
Applied egg-rr6.5%
rem-exp-log19.5%
add-sqr-sqrt6.6%
sqrt-unprod21.5%
pow221.5%
Applied egg-rr21.5%
unpow221.5%
rem-sqrt-square26.3%
Simplified26.3%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (or (<= ky 5.2e-220) (and (not (<= ky 1.35e-121)) (<= ky 1.35e-100))) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if ((ky <= 5.2e-220) || (!(ky <= 1.35e-121) && (ky <= 1.35e-100))) {
tmp = ky * (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 ((ky <= 5.2d-220) .or. (.not. (ky <= 1.35d-121)) .and. (ky <= 1.35d-100)) then
tmp = ky * (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 ((ky <= 5.2e-220) || (!(ky <= 1.35e-121) && (ky <= 1.35e-100))) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if (ky <= 5.2e-220) or (not (ky <= 1.35e-121) and (ky <= 1.35e-100)): tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if ((ky <= 5.2e-220) || (!(ky <= 1.35e-121) && (ky <= 1.35e-100))) tmp = Float64(ky * Float64(th / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if ((ky <= 5.2e-220) || (~((ky <= 1.35e-121)) && (ky <= 1.35e-100))) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[Or[LessEqual[ky, 5.2e-220], And[N[Not[LessEqual[ky, 1.35e-121]], $MachinePrecision], LessEqual[ky, 1.35e-100]]], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.2 \cdot 10^{-220} \lor \neg \left(ky \leq 1.35 \cdot 10^{-121}\right) \land ky \leq 1.35 \cdot 10^{-100}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 5.2e-220 or 1.3500000000000001e-121 < ky < 1.35000000000000008e-100Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.0%
associate-/l*90.4%
unpow290.4%
Simplified99.7%
associate-*r/93.4%
hypot-undefine88.0%
unpow288.0%
unpow288.0%
+-commutative88.0%
clear-num87.0%
+-commutative87.0%
unpow287.0%
unpow287.0%
hypot-undefine92.4%
Applied egg-rr92.4%
Taylor expanded in th around 0 44.4%
associate-/r*44.4%
+-commutative44.4%
unpow244.4%
unpow244.4%
hypot-undefine46.1%
Simplified46.1%
Taylor expanded in ky around 0 15.9%
associate-/l*17.2%
Simplified17.2%
if 5.2e-220 < ky < 1.3500000000000001e-121 or 1.35000000000000008e-100 < ky Initial program 95.6%
unpow295.6%
sqr-neg95.6%
sin-neg95.6%
sin-neg95.6%
unpow295.6%
associate-*l/95.5%
associate-/l*95.5%
unpow295.5%
Simplified99.5%
Taylor expanded in kx around 0 34.8%
Final simplification23.7%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 9e-187)
(* ky (/ (sin th) kx))
(if (or (<= ky 1e-120) (not (<= ky 2.1e-100)))
(sin th)
(* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9e-187) {
tmp = ky * (sin(th) / kx);
} else if ((ky <= 1e-120) || !(ky <= 2.1e-100)) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 9d-187) then
tmp = ky * (sin(th) / kx)
else if ((ky <= 1d-120) .or. (.not. (ky <= 2.1d-100))) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9e-187) {
tmp = ky * (Math.sin(th) / kx);
} else if ((ky <= 1e-120) || !(ky <= 2.1e-100)) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 9e-187: tmp = ky * (math.sin(th) / kx) elif (ky <= 1e-120) or not (ky <= 2.1e-100): tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 9e-187) tmp = Float64(ky * Float64(sin(th) / kx)); elseif ((ky <= 1e-120) || !(ky <= 2.1e-100)) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 9e-187) tmp = ky * (sin(th) / kx); elseif ((ky <= 1e-120) || ~((ky <= 2.1e-100))) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 9e-187], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 1e-120], N[Not[LessEqual[ky, 2.1e-100]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 9 \cdot 10^{-187}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;ky \leq 10^{-120} \lor \neg \left(ky \leq 2.1 \cdot 10^{-100}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if ky < 8.9999999999999996e-187Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/86.8%
associate-/l*89.2%
unpow289.2%
Simplified99.7%
associate-*r/93.4%
hypot-undefine86.8%
unpow286.8%
unpow286.8%
+-commutative86.8%
associate-*l/89.2%
*-commutative89.2%
clear-num89.2%
un-div-inv89.3%
+-commutative89.3%
unpow289.3%
unpow289.3%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 27.5%
Taylor expanded in kx around 0 17.4%
associate-/l*18.8%
Simplified18.8%
if 8.9999999999999996e-187 < ky < 9.99999999999999979e-121 or 2.10000000000000009e-100 < ky Initial program 97.6%
unpow297.6%
sqr-neg97.6%
sin-neg97.6%
sin-neg97.6%
unpow297.6%
associate-*l/97.5%
associate-/l*97.4%
unpow297.4%
Simplified99.5%
Taylor expanded in kx around 0 35.6%
if 9.99999999999999979e-121 < ky < 2.10000000000000009e-100Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
associate-*r/99.0%
hypot-undefine99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
clear-num73.2%
+-commutative73.2%
unpow273.2%
unpow273.2%
hypot-undefine73.2%
Applied egg-rr73.2%
Taylor expanded in th around 0 73.2%
associate-/r*73.7%
+-commutative73.7%
unpow273.7%
unpow273.7%
hypot-undefine73.7%
Simplified73.7%
Taylor expanded in ky around 0 67.3%
associate-/l*67.8%
Simplified67.8%
Final simplification25.4%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 8.5e-178)
(/ (sin th) (/ kx ky))
(if (or (<= ky 7.6e-121) (not (<= ky 1.35e-100)))
(sin th)
(* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8.5e-178) {
tmp = sin(th) / (kx / ky);
} else if ((ky <= 7.6e-121) || !(ky <= 1.35e-100)) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 8.5d-178) then
tmp = sin(th) / (kx / ky)
else if ((ky <= 7.6d-121) .or. (.not. (ky <= 1.35d-100))) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8.5e-178) {
tmp = Math.sin(th) / (kx / ky);
} else if ((ky <= 7.6e-121) || !(ky <= 1.35e-100)) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 8.5e-178: tmp = math.sin(th) / (kx / ky) elif (ky <= 7.6e-121) or not (ky <= 1.35e-100): tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 8.5e-178) tmp = Float64(sin(th) / Float64(kx / ky)); elseif ((ky <= 7.6e-121) || !(ky <= 1.35e-100)) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 8.5e-178) tmp = sin(th) / (kx / ky); elseif ((ky <= 7.6e-121) || ~((ky <= 1.35e-100))) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 8.5e-178], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 7.6e-121], N[Not[LessEqual[ky, 1.35e-100]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 8.5 \cdot 10^{-178}:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{elif}\;ky \leq 7.6 \cdot 10^{-121} \lor \neg \left(ky \leq 1.35 \cdot 10^{-100}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if ky < 8.5000000000000001e-178Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/86.8%
associate-/l*89.2%
unpow289.2%
Simplified99.7%
associate-*r/93.4%
hypot-undefine86.8%
unpow286.8%
unpow286.8%
+-commutative86.8%
associate-*l/89.2%
*-commutative89.2%
clear-num89.2%
un-div-inv89.3%
+-commutative89.3%
unpow289.3%
unpow289.3%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 27.5%
Taylor expanded in kx around 0 18.8%
if 8.5000000000000001e-178 < ky < 7.6000000000000002e-121 or 1.35000000000000008e-100 < ky Initial program 97.6%
unpow297.6%
sqr-neg97.6%
sin-neg97.6%
sin-neg97.6%
unpow297.6%
associate-*l/97.5%
associate-/l*97.4%
unpow297.4%
Simplified99.5%
Taylor expanded in kx around 0 35.6%
if 7.6000000000000002e-121 < ky < 1.35000000000000008e-100Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
associate-*r/99.0%
hypot-undefine99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
clear-num73.2%
+-commutative73.2%
unpow273.2%
unpow273.2%
hypot-undefine73.2%
Applied egg-rr73.2%
Taylor expanded in th around 0 73.2%
associate-/r*73.7%
+-commutative73.7%
unpow273.7%
unpow273.7%
hypot-undefine73.7%
Simplified73.7%
Taylor expanded in ky around 0 67.3%
associate-/l*67.8%
Simplified67.8%
Final simplification25.4%
(FPCore (kx ky th) :precision binary64 (sin th))
double code(double kx, double ky, double th) {
return 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(th)
end function
public static double code(double kx, double ky, double th) {
return Math.sin(th);
}
def code(kx, ky, th): return math.sin(th)
function code(kx, ky, th) return sin(th) end
function tmp = code(kx, ky, th) tmp = sin(th); end
code[kx_, ky_, th_] := N[Sin[th], $MachinePrecision]
\begin{array}{l}
\\
\sin th
\end{array}
Initial program 92.3%
unpow292.3%
sqr-neg92.3%
sin-neg92.3%
sin-neg92.3%
unpow292.3%
associate-*l/90.8%
associate-/l*92.3%
unpow292.3%
Simplified99.6%
Taylor expanded in kx around 0 23.1%
Final simplification23.1%
(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 92.3%
unpow292.3%
sqr-neg92.3%
sin-neg92.3%
sin-neg92.3%
unpow292.3%
associate-*l/90.8%
associate-/l*92.3%
unpow292.3%
Simplified99.6%
Taylor expanded in kx around 0 23.1%
Taylor expanded in th around 0 13.4%
Final simplification13.4%
herbie shell --seed 2024078
(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)))