
(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 95.1%
+-commutative95.1%
unpow295.1%
unpow295.1%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.4)
(fabs (/ (* (sin ky) th) (sin kx)))
(if (<= (sin kx) 1e-133)
(sin th)
(if (<= (sin kx) 1e-69)
(/ (* (sin ky) (sin th)) (sin ky))
(/ (sin ky) (/ (sin kx) (sin th)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = fabs(((sin(ky) * th) / sin(kx)));
} else if (sin(kx) <= 1e-133) {
tmp = sin(th);
} else if (sin(kx) <= 1e-69) {
tmp = (sin(ky) * sin(th)) / sin(ky);
} 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.4d0)) then
tmp = abs(((sin(ky) * th) / sin(kx)))
else if (sin(kx) <= 1d-133) then
tmp = sin(th)
else if (sin(kx) <= 1d-69) then
tmp = (sin(ky) * sin(th)) / sin(ky)
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.4) {
tmp = Math.abs(((Math.sin(ky) * th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-133) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 1e-69) {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.sin(ky);
} 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.4: tmp = math.fabs(((math.sin(ky) * th) / math.sin(kx))) elif math.sin(kx) <= 1e-133: tmp = math.sin(th) elif math.sin(kx) <= 1e-69: tmp = (math.sin(ky) * math.sin(th)) / math.sin(ky) 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.4) tmp = abs(Float64(Float64(sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-133) tmp = sin(th); elseif (sin(kx) <= 1e-69) tmp = Float64(Float64(sin(ky) * sin(th)) / sin(ky)); 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.4) tmp = abs(((sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-133) tmp = sin(th); elseif (sin(kx) <= 1e-69) tmp = (sin(ky) * sin(th)) / sin(ky); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.4], N[Abs[N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-133], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-69], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $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.4:\\
\;\;\;\;\left|\frac{\sin ky \cdot th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-133}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-69}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin ky}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.0%
Taylor expanded in th around 0 16.2%
add-sqr-sqrt14.9%
sqrt-unprod22.3%
pow222.3%
associate-/l*22.3%
Applied egg-rr22.3%
unpow222.3%
rem-sqrt-square28.7%
*-commutative28.7%
associate-*l/28.7%
Simplified28.7%
if -0.40000000000000002 < (sin.f64 kx) < 1.0000000000000001e-133Initial program 89.7%
unpow289.7%
sqr-neg89.7%
sin-neg89.7%
sin-neg89.7%
unpow289.7%
associate-*l/87.2%
associate-/l*89.7%
unpow289.7%
Simplified99.8%
Taylor expanded in kx around 0 34.5%
if 1.0000000000000001e-133 < (sin.f64 kx) < 9.9999999999999996e-70Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/99.9%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
*-commutative99.6%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 39.9%
if 9.9999999999999996e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 54.2%
clear-num54.2%
un-div-inv54.2%
Applied egg-rr54.2%
Final simplification40.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= (sin ky) -0.05)
(* (/ (sin ky) t_1) th)
(if (<= (sin ky) 1e-15) (/ (* ky (sin th)) t_1) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (sin(ky) <= -0.05) {
tmp = (sin(ky) / t_1) * th;
} else if (sin(ky) <= 1e-15) {
tmp = (ky * sin(th)) / t_1;
} else {
tmp = sin(th);
}
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 (Math.sin(ky) <= -0.05) {
tmp = (Math.sin(ky) / t_1) * th;
} else if (Math.sin(ky) <= 1e-15) {
tmp = (ky * Math.sin(th)) / t_1;
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if math.sin(ky) <= -0.05: tmp = (math.sin(ky) / t_1) * th elif math.sin(ky) <= 1e-15: tmp = (ky * math.sin(th)) / t_1 else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (sin(ky) <= -0.05) tmp = Float64(Float64(sin(ky) / t_1) * th); elseif (sin(ky) <= 1e-15) tmp = Float64(Float64(ky * sin(th)) / t_1); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (sin(ky) <= -0.05) tmp = (sin(ky) / t_1) * th; elseif (sin(ky) <= 1e-15) tmp = (ky * sin(th)) / t_1; else tmp = sin(th); 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[N[Sin[ky], $MachinePrecision], -0.05], N[(N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision] * th), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-15], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\frac{\sin ky}{t\_1} \cdot th\\
\mathbf{elif}\;\sin ky \leq 10^{-15}:\\
\;\;\;\;\frac{ky \cdot \sin th}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in th around 0 44.0%
*-un-lft-identity44.0%
sqrt-div44.0%
metadata-eval44.0%
+-commutative44.0%
unpow244.0%
unpow244.0%
hypot-undefine44.0%
Applied egg-rr44.0%
*-lft-identity44.0%
Simplified44.0%
*-commutative44.0%
un-div-inv44.0%
associate-*l/44.0%
Applied egg-rr44.0%
associate-*r/44.1%
Simplified44.1%
if -0.050000000000000003 < (sin.f64 ky) < 1.0000000000000001e-15Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/87.7%
associate-/l*90.0%
unpow290.0%
Simplified99.7%
*-commutative99.7%
associate-*l/96.7%
Applied egg-rr96.7%
Taylor expanded in ky around 0 95.2%
if 1.0000000000000001e-15 < (sin.f64 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 57.4%
Final simplification71.8%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (fabs (/ (* (sin ky) th) (sin kx))) (if (<= (sin kx) 1e-91) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = fabs(((sin(ky) * th) / sin(kx)));
} else if (sin(kx) <= 1e-91) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.4d0)) then
tmp = abs(((sin(ky) * th) / sin(kx)))
else if (sin(kx) <= 1d-91) then
tmp = sin(th)
else
tmp = sin(ky) * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.4) {
tmp = Math.abs(((Math.sin(ky) * th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-91) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.4: tmp = math.fabs(((math.sin(ky) * th) / math.sin(kx))) elif math.sin(kx) <= 1e-91: tmp = math.sin(th) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.4) tmp = abs(Float64(Float64(sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.4) tmp = abs(((sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.4], N[Abs[N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-91], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.4:\\
\;\;\;\;\left|\frac{\sin ky \cdot th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-91}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.0%
Taylor expanded in th around 0 16.2%
add-sqr-sqrt14.9%
sqrt-unprod22.3%
pow222.3%
associate-/l*22.3%
Applied egg-rr22.3%
unpow222.3%
rem-sqrt-square28.7%
*-commutative28.7%
associate-*l/28.7%
Simplified28.7%
if -0.40000000000000002 < (sin.f64 kx) < 1.00000000000000002e-91Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/87.8%
associate-/l*90.2%
unpow290.2%
Simplified99.8%
Taylor expanded in kx around 0 34.5%
if 1.00000000000000002e-91 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 53.7%
Final simplification40.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (fabs (/ (* (sin ky) th) (sin kx))) (if (<= (sin kx) 1e-91) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = fabs(((sin(ky) * th) / sin(kx)));
} else if (sin(kx) <= 1e-91) {
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.4d0)) then
tmp = abs(((sin(ky) * th) / sin(kx)))
else if (sin(kx) <= 1d-91) 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.4) {
tmp = Math.abs(((Math.sin(ky) * th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-91) {
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.4: tmp = math.fabs(((math.sin(ky) * th) / math.sin(kx))) elif math.sin(kx) <= 1e-91: 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.4) tmp = abs(Float64(Float64(sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) 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.4) tmp = abs(((sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) 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.4], N[Abs[N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-91], 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.4:\\
\;\;\;\;\left|\frac{\sin ky \cdot th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-91}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.0%
Taylor expanded in th around 0 16.2%
add-sqr-sqrt14.9%
sqrt-unprod22.3%
pow222.3%
associate-/l*22.3%
Applied egg-rr22.3%
unpow222.3%
rem-sqrt-square28.7%
*-commutative28.7%
associate-*l/28.7%
Simplified28.7%
if -0.40000000000000002 < (sin.f64 kx) < 1.00000000000000002e-91Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/87.8%
associate-/l*90.2%
unpow290.2%
Simplified99.8%
Taylor expanded in kx around 0 34.5%
if 1.00000000000000002e-91 < (sin.f64 kx) Initial program 99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 53.6%
Final simplification40.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (fabs (/ (* (sin ky) th) (sin kx))) (if (<= (sin kx) 1e-91) (sin th) (/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = fabs(((sin(ky) * th) / sin(kx)));
} else if (sin(kx) <= 1e-91) {
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.4d0)) then
tmp = abs(((sin(ky) * th) / sin(kx)))
else if (sin(kx) <= 1d-91) 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.4) {
tmp = Math.abs(((Math.sin(ky) * th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-91) {
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.4: tmp = math.fabs(((math.sin(ky) * th) / math.sin(kx))) elif math.sin(kx) <= 1e-91: 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.4) tmp = abs(Float64(Float64(sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) 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.4) tmp = abs(((sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 1e-91) 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.4], N[Abs[N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-91], 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.4:\\
\;\;\;\;\left|\frac{\sin ky \cdot th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-91}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.0%
Taylor expanded in th around 0 16.2%
add-sqr-sqrt14.9%
sqrt-unprod22.3%
pow222.3%
associate-/l*22.3%
Applied egg-rr22.3%
unpow222.3%
rem-sqrt-square28.7%
*-commutative28.7%
associate-*l/28.7%
Simplified28.7%
if -0.40000000000000002 < (sin.f64 kx) < 1.00000000000000002e-91Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/87.8%
associate-/l*90.2%
unpow290.2%
Simplified99.8%
Taylor expanded in kx around 0 34.5%
if 1.00000000000000002e-91 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 53.7%
clear-num53.6%
un-div-inv53.7%
Applied egg-rr53.7%
Final simplification40.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.282)
(fabs (* (sin ky) (/ (sin th) (sin kx))))
(if (<= (sin kx) 1e-69)
(/ (* (sin ky) (sin th)) (sin ky))
(/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.282) {
tmp = fabs((sin(ky) * (sin(th) / sin(kx))));
} else if (sin(kx) <= 1e-69) {
tmp = (sin(ky) * sin(th)) / sin(ky);
} 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.282d0)) then
tmp = abs((sin(ky) * (sin(th) / sin(kx))))
else if (sin(kx) <= 1d-69) then
tmp = (sin(ky) * sin(th)) / sin(ky)
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.282) {
tmp = Math.abs((Math.sin(ky) * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 1e-69) {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.sin(ky);
} 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.282: tmp = math.fabs((math.sin(ky) * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 1e-69: tmp = (math.sin(ky) * math.sin(th)) / math.sin(ky) 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.282) tmp = abs(Float64(sin(ky) * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 1e-69) tmp = Float64(Float64(sin(ky) * sin(th)) / sin(ky)); 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.282) tmp = abs((sin(ky) * (sin(th) / sin(kx)))); elseif (sin(kx) <= 1e-69) tmp = (sin(ky) * sin(th)) / sin(ky); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.282], N[Abs[N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-69], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $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.282:\\
\;\;\;\;\left|\sin ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-69}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin ky}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.281999999999999973Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.9%
associate-*r/16.9%
*-commutative16.9%
sin-mult18.5%
associate-/l/18.5%
+-commutative18.5%
Applied egg-rr18.5%
*-commutative18.5%
associate-/r*18.5%
+-commutative18.5%
sin-mult16.9%
associate-*r/16.9%
add-sqr-sqrt15.6%
sqrt-unprod25.8%
pow225.8%
Applied egg-rr25.8%
unpow225.8%
rem-sqrt-square37.2%
*-commutative37.2%
associate-*l/37.2%
associate-/l*37.2%
Simplified37.2%
if -0.281999999999999973 < (sin.f64 kx) < 9.9999999999999996e-70Initial program 90.5%
unpow290.5%
sqr-neg90.5%
sin-neg90.5%
sin-neg90.5%
unpow290.5%
associate-*l/88.1%
associate-/l*90.4%
unpow290.4%
Simplified99.8%
*-commutative99.8%
associate-*l/96.9%
Applied egg-rr96.9%
Taylor expanded in kx around 0 39.6%
if 9.9999999999999996e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 54.2%
clear-num54.2%
un-div-inv54.2%
Applied egg-rr54.2%
Final simplification43.8%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.28)
(* (sin ky) (fabs (/ (sin th) (sin kx))))
(if (<= (sin kx) 1e-69)
(/ (* (sin ky) (sin th)) (sin ky))
(/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.28) {
tmp = sin(ky) * fabs((sin(th) / sin(kx)));
} else if (sin(kx) <= 1e-69) {
tmp = (sin(ky) * sin(th)) / sin(ky);
} 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.28d0)) then
tmp = sin(ky) * abs((sin(th) / sin(kx)))
else if (sin(kx) <= 1d-69) then
tmp = (sin(ky) * sin(th)) / sin(ky)
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.28) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 1e-69) {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.sin(ky);
} 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.28: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(kx))) elif math.sin(kx) <= 1e-69: tmp = (math.sin(ky) * math.sin(th)) / math.sin(ky) 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.28) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 1e-69) tmp = Float64(Float64(sin(ky) * sin(th)) / sin(ky)); 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.28) tmp = sin(ky) * abs((sin(th) / sin(kx))); elseif (sin(kx) <= 1e-69) tmp = (sin(ky) * sin(th)) / sin(ky); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.28], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-69], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $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.28:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-69}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin ky}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.28000000000000003Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.6%
add-sqr-sqrt5.1%
sqrt-unprod38.6%
pow238.6%
Applied egg-rr38.6%
unpow238.6%
rem-sqrt-square42.1%
Simplified42.1%
if -0.28000000000000003 < (sin.f64 kx) < 9.9999999999999996e-70Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.0%
associate-/l*90.3%
unpow290.3%
Simplified99.8%
*-commutative99.8%
associate-*l/96.9%
Applied egg-rr96.9%
Taylor expanded in kx around 0 39.9%
if 9.9999999999999996e-70 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 54.2%
clear-num54.2%
un-div-inv54.2%
Applied egg-rr54.2%
Final simplification44.9%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 95.1%
unpow295.1%
sqr-neg95.1%
sin-neg95.1%
sin-neg95.1%
unpow295.1%
associate-*l/94.0%
associate-/l*95.1%
unpow295.1%
Simplified99.7%
Final simplification99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (* ky (fabs (/ th (sin kx)))) (if (<= (sin kx) 5e-69) (sin th) (* ky (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = ky * fabs((th / sin(kx)));
} else if (sin(kx) <= 5e-69) {
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.4d0)) then
tmp = ky * abs((th / sin(kx)))
else if (sin(kx) <= 5d-69) 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.4) {
tmp = ky * Math.abs((th / Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-69) {
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.4: tmp = ky * math.fabs((th / math.sin(kx))) elif math.sin(kx) <= 5e-69: 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.4) tmp = Float64(ky * abs(Float64(th / sin(kx)))); elseif (sin(kx) <= 5e-69) tmp = sin(th); else tmp = Float64(ky * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.4) tmp = ky * abs((th / sin(kx))); elseif (sin(kx) <= 5e-69) 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.4], N[(ky * N[Abs[N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-69], N[Sin[th], $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.4:\\
\;\;\;\;ky \cdot \left|\frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in th around 0 62.5%
Taylor expanded in ky around 0 16.4%
associate-/l*16.4%
Simplified16.4%
add-sqr-sqrt3.1%
sqrt-unprod26.6%
pow226.6%
Applied egg-rr26.6%
unpow226.6%
rem-sqrt-square28.3%
Simplified28.3%
if -0.40000000000000002 < (sin.f64 kx) < 5.00000000000000033e-69Initial program 90.9%
unpow290.9%
sqr-neg90.9%
sin-neg90.9%
sin-neg90.9%
unpow290.9%
associate-*l/88.5%
associate-/l*90.8%
unpow290.8%
Simplified99.8%
Taylor expanded in kx around 0 34.1%
if 5.00000000000000033e-69 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 46.2%
associate-/l*46.2%
Simplified46.2%
Final simplification36.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (* ky (fabs (/ th (sin kx)))) (if (<= (sin kx) 5e-69) (sin th) (* (sin th) (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = ky * fabs((th / sin(kx)));
} else if (sin(kx) <= 5e-69) {
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.4d0)) then
tmp = ky * abs((th / sin(kx)))
else if (sin(kx) <= 5d-69) 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.4) {
tmp = ky * Math.abs((th / Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-69) {
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.4: tmp = ky * math.fabs((th / math.sin(kx))) elif math.sin(kx) <= 5e-69: 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.4) tmp = Float64(ky * abs(Float64(th / sin(kx)))); elseif (sin(kx) <= 5e-69) 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.4) tmp = ky * abs((th / sin(kx))); elseif (sin(kx) <= 5e-69) 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.4], N[(ky * N[Abs[N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-69], 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.4:\\
\;\;\;\;ky \cdot \left|\frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in th around 0 62.5%
Taylor expanded in ky around 0 16.4%
associate-/l*16.4%
Simplified16.4%
add-sqr-sqrt3.1%
sqrt-unprod26.6%
pow226.6%
Applied egg-rr26.6%
unpow226.6%
rem-sqrt-square28.3%
Simplified28.3%
if -0.40000000000000002 < (sin.f64 kx) < 5.00000000000000033e-69Initial program 90.9%
unpow290.9%
sqr-neg90.9%
sin-neg90.9%
sin-neg90.9%
unpow290.9%
associate-*l/88.5%
associate-/l*90.8%
unpow290.8%
Simplified99.8%
Taylor expanded in kx around 0 34.1%
if 5.00000000000000033e-69 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0 46.1%
Final simplification36.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (* ky (fabs (/ th (sin kx)))) (if (<= (sin kx) 5e-69) (sin th) (/ (* ky (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = ky * fabs((th / sin(kx)));
} else if (sin(kx) <= 5e-69) {
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.4d0)) then
tmp = ky * abs((th / sin(kx)))
else if (sin(kx) <= 5d-69) 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.4) {
tmp = ky * Math.abs((th / Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-69) {
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.4: tmp = ky * math.fabs((th / math.sin(kx))) elif math.sin(kx) <= 5e-69: 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.4) tmp = Float64(ky * abs(Float64(th / sin(kx)))); elseif (sin(kx) <= 5e-69) 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.4) tmp = ky * abs((th / sin(kx))); elseif (sin(kx) <= 5e-69) 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.4], N[(ky * N[Abs[N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-69], 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.4:\\
\;\;\;\;ky \cdot \left|\frac{th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in th around 0 62.5%
Taylor expanded in ky around 0 16.4%
associate-/l*16.4%
Simplified16.4%
add-sqr-sqrt3.1%
sqrt-unprod26.6%
pow226.6%
Applied egg-rr26.6%
unpow226.6%
rem-sqrt-square28.3%
Simplified28.3%
if -0.40000000000000002 < (sin.f64 kx) < 5.00000000000000033e-69Initial program 90.9%
unpow290.9%
sqr-neg90.9%
sin-neg90.9%
sin-neg90.9%
unpow290.9%
associate-*l/88.5%
associate-/l*90.8%
unpow290.8%
Simplified99.8%
Taylor expanded in kx around 0 34.1%
if 5.00000000000000033e-69 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 46.2%
Final simplification36.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.4) (fabs (/ (* (sin ky) th) (sin kx))) (if (<= (sin kx) 5e-69) (sin th) (/ (* ky (sin th)) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.4) {
tmp = fabs(((sin(ky) * th) / sin(kx)));
} else if (sin(kx) <= 5e-69) {
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.4d0)) then
tmp = abs(((sin(ky) * th) / sin(kx)))
else if (sin(kx) <= 5d-69) 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.4) {
tmp = Math.abs(((Math.sin(ky) * th) / Math.sin(kx)));
} else if (Math.sin(kx) <= 5e-69) {
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.4: tmp = math.fabs(((math.sin(ky) * th) / math.sin(kx))) elif math.sin(kx) <= 5e-69: 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.4) tmp = abs(Float64(Float64(sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 5e-69) 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.4) tmp = abs(((sin(ky) * th) / sin(kx))); elseif (sin(kx) <= 5e-69) 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.4], N[Abs[N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-69], 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.4:\\
\;\;\;\;\left|\frac{\sin ky \cdot th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-69}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.40000000000000002Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in ky around 0 16.0%
Taylor expanded in th around 0 16.2%
add-sqr-sqrt14.9%
sqrt-unprod22.3%
pow222.3%
associate-/l*22.3%
Applied egg-rr22.3%
unpow222.3%
rem-sqrt-square28.7%
*-commutative28.7%
associate-*l/28.7%
Simplified28.7%
if -0.40000000000000002 < (sin.f64 kx) < 5.00000000000000033e-69Initial program 90.9%
unpow290.9%
sqr-neg90.9%
sin-neg90.9%
sin-neg90.9%
unpow290.9%
associate-*l/88.5%
associate-/l*90.8%
unpow290.8%
Simplified99.8%
Taylor expanded in kx around 0 34.1%
if 5.00000000000000033e-69 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 46.2%
Final simplification37.0%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.8)
(* (/ (sin ky) (hypot (sin ky) (sin kx))) th)
(if (or (<= th 5e+76) (not (<= th 3e+121)))
(sin th)
(/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.8) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th;
} else if ((th <= 5e+76) || !(th <= 3e+121)) {
tmp = sin(th);
} else {
tmp = sin(ky) / (sin(kx) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.8) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else if ((th <= 5e+76) || !(th <= 3e+121)) {
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 th <= 0.8: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * th elif (th <= 5e+76) or not (th <= 3e+121): 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 (th <= 0.8) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * th); elseif ((th <= 5e+76) || !(th <= 3e+121)) 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 (th <= 0.8) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; elseif ((th <= 5e+76) || ~((th <= 3e+121))) tmp = sin(th); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.8], 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, 5e+76], N[Not[LessEqual[th, 3e+121]], $MachinePrecision]], 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}\;th \leq 0.8:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{elif}\;th \leq 5 \cdot 10^{+76} \lor \neg \left(th \leq 3 \cdot 10^{+121}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if th < 0.80000000000000004Initial program 95.6%
unpow295.6%
sqr-neg95.6%
sin-neg95.6%
sin-neg95.6%
unpow295.6%
associate-*l/94.0%
associate-/l*95.5%
unpow295.5%
Simplified99.7%
Taylor expanded in th around 0 65.9%
*-un-lft-identity65.9%
sqrt-div66.4%
metadata-eval66.4%
+-commutative66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.2%
Applied egg-rr68.2%
*-lft-identity68.2%
Simplified68.2%
*-commutative68.2%
un-div-inv68.3%
associate-*l/66.4%
Applied egg-rr66.4%
associate-*r/68.4%
Simplified68.4%
if 0.80000000000000004 < th < 4.99999999999999991e76 or 3.0000000000000002e121 < th Initial program 94.5%
unpow294.5%
sqr-neg94.5%
sin-neg94.5%
sin-neg94.5%
unpow294.5%
associate-*l/94.6%
associate-/l*94.5%
unpow294.5%
Simplified99.6%
Taylor expanded in kx around 0 21.6%
if 4.99999999999999991e76 < th < 3.0000000000000002e121Initial program 91.4%
unpow291.4%
sqr-neg91.4%
sin-neg91.4%
sin-neg91.4%
unpow291.4%
associate-*l/91.4%
associate-/l*91.7%
unpow291.7%
Simplified99.7%
Taylor expanded in ky around 0 26.8%
clear-num26.8%
un-div-inv26.8%
Applied egg-rr26.8%
Final simplification56.0%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.2e-20) (sin th) (* ky (fabs (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.2e-20) {
tmp = sin(th);
} else {
tmp = ky * fabs((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 <= 6.2d-20) then
tmp = sin(th)
else
tmp = ky * abs((th / sin(kx)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.2e-20) {
tmp = Math.sin(th);
} else {
tmp = ky * Math.abs((th / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.2e-20: tmp = math.sin(th) else: tmp = ky * math.fabs((th / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.2e-20) tmp = sin(th); else tmp = Float64(ky * abs(Float64(th / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.2e-20) tmp = sin(th); else tmp = ky * abs((th / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.2e-20], N[Sin[th], $MachinePrecision], N[(ky * N[Abs[N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.2 \cdot 10^{-20}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \left|\frac{th}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 6.19999999999999999e-20Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.9%
associate-/l*93.4%
unpow293.4%
Simplified99.7%
Taylor expanded in kx around 0 27.5%
if 6.19999999999999999e-20 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in th around 0 54.7%
Taylor expanded in ky around 0 23.6%
associate-/l*23.5%
Simplified23.5%
add-sqr-sqrt8.1%
sqrt-unprod21.2%
pow221.2%
Applied egg-rr21.2%
unpow221.2%
rem-sqrt-square23.7%
Simplified23.7%
Final simplification26.5%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6e-20) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6e-20) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6d-20) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6e-20) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6e-20: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6e-20) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6e-20) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6e-20], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6 \cdot 10^{-20}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 6.00000000000000057e-20Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.9%
associate-/l*93.4%
unpow293.4%
Simplified99.7%
Taylor expanded in kx around 0 27.5%
if 6.00000000000000057e-20 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in th around 0 54.7%
Taylor expanded in ky around 0 23.6%
associate-/l*23.5%
Simplified23.5%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.3e-20) (sin th) (/ ky (/ (sin kx) th))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.3e-20) {
tmp = sin(th);
} else {
tmp = ky / (sin(kx) / th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 4.3d-20) then
tmp = sin(th)
else
tmp = ky / (sin(kx) / th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.3e-20) {
tmp = Math.sin(th);
} else {
tmp = ky / (Math.sin(kx) / th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.3e-20: tmp = math.sin(th) else: tmp = ky / (math.sin(kx) / th) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.3e-20) tmp = sin(th); else tmp = Float64(ky / Float64(sin(kx) / th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.3e-20) tmp = sin(th); else tmp = ky / (sin(kx) / th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.3e-20], N[Sin[th], $MachinePrecision], N[(ky / N[(N[Sin[kx], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.3 \cdot 10^{-20}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\end{array}
\end{array}
if kx < 4.30000000000000011e-20Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.9%
associate-/l*93.4%
unpow293.4%
Simplified99.7%
Taylor expanded in kx around 0 27.5%
if 4.30000000000000011e-20 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in th around 0 54.7%
Taylor expanded in ky around 0 23.6%
associate-/l*23.5%
Simplified23.5%
clear-num23.5%
un-div-inv23.6%
Applied egg-rr23.6%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1e-152) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-152) {
tmp = ky * (th / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1d-152) then
tmp = ky * (th / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-152) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1e-152: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1e-152) tmp = Float64(ky * Float64(th / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1e-152) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1e-152], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 10^{-152}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.00000000000000007e-152Initial program 92.7%
unpow292.7%
sqr-neg92.7%
sin-neg92.7%
sin-neg92.7%
unpow292.7%
associate-*l/91.6%
associate-/l*92.7%
unpow292.7%
Simplified99.6%
Taylor expanded in th around 0 49.6%
Taylor expanded in ky around 0 22.7%
associate-/l*23.6%
Simplified23.6%
Taylor expanded in kx around 0 22.9%
if 1.00000000000000007e-152 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.5%
associate-/l*99.6%
unpow299.6%
Simplified99.7%
Taylor expanded in kx around 0 30.7%
Final simplification25.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.55e-42) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.55e-42) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.55d-42) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.55e-42) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.55e-42: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.55e-42) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.55e-42) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.55e-42], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.55 \cdot 10^{-42}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 1.5500000000000001e-42Initial program 93.5%
unpow293.5%
sqr-neg93.5%
sin-neg93.5%
sin-neg93.5%
unpow293.5%
associate-*l/92.0%
associate-/l*93.4%
unpow293.4%
Simplified99.6%
Taylor expanded in th around 0 49.2%
Taylor expanded in ky around 0 23.2%
associate-/l*24.0%
Simplified24.0%
Taylor expanded in kx around 0 22.3%
if 1.5500000000000001e-42 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.6%
unpow299.6%
Simplified99.8%
Taylor expanded in th around 0 48.1%
Taylor expanded in kx around 0 18.2%
Final simplification21.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 95.1%
unpow295.1%
sqr-neg95.1%
sin-neg95.1%
sin-neg95.1%
unpow295.1%
associate-*l/94.0%
associate-/l*95.1%
unpow295.1%
Simplified99.7%
Taylor expanded in th around 0 48.9%
Taylor expanded in kx around 0 14.2%
Final simplification14.2%
herbie shell --seed 2024096
(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)))