
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 93.8%
+-commutative93.8%
unpow293.8%
unpow293.8%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.004)
(/ th (/ (hypot (sin ky) (sin kx)) (sin ky)))
(if (<= (sin ky) 0.0001)
(/ (sin ky) (/ (hypot ky (sin kx)) (sin th)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
} else if (sin(ky) <= 0.0001) {
tmp = sin(ky) / (hypot(ky, sin(kx)) / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.004) {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
} else if (Math.sin(ky) <= 0.0001) {
tmp = Math.sin(ky) / (Math.hypot(ky, Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.004: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) elif math.sin(ky) <= 0.0001: tmp = math.sin(ky) / (math.hypot(ky, math.sin(kx)) / math.sin(th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.004) tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); elseif (sin(ky) <= 0.0001) tmp = Float64(sin(ky) / Float64(hypot(ky, sin(kx)) / sin(th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.004) tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); elseif (sin(ky) <= 0.0001) tmp = sin(ky) / (hypot(ky, sin(kx)) / sin(th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.004], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0001], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.0001:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(ky, \sin kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.5%
hypot-undefine99.5%
unpow299.5%
unpow299.5%
+-commutative99.5%
associate-*l/99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 49.1%
if -0.0040000000000000001 < (sin.f64 ky) < 1.00000000000000005e-4Initial program 87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
associate-*l/83.0%
associate-/l*87.1%
unpow287.1%
Simplified99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 99.7%
if 1.00000000000000005e-4 < (sin.f64 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.6%
Taylor expanded in kx around 0 51.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.004)
(/ th (/ (hypot (sin ky) (sin kx)) (sin ky)))
(if (<= (sin ky) 0.0001)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
} else if (sin(ky) <= 0.0001) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.004) {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
} else if (Math.sin(ky) <= 0.0001) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.004: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) elif math.sin(ky) <= 0.0001: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.004) tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); elseif (sin(ky) <= 0.0001) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.004) tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); elseif (sin(ky) <= 0.0001) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.004], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0001], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.0001:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.5%
hypot-undefine99.5%
unpow299.5%
unpow299.5%
+-commutative99.5%
associate-*l/99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 49.1%
if -0.0040000000000000001 < (sin.f64 ky) < 1.00000000000000005e-4Initial program 87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
associate-*l/83.0%
associate-/l*87.1%
unpow287.1%
Simplified99.6%
Taylor expanded in ky around 0 99.6%
if 1.00000000000000005e-4 < (sin.f64 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.6%
Taylor expanded in kx around 0 51.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.004)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= (sin ky) 0.0001)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (sin(ky) <= 0.0001) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.004) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (Math.sin(ky) <= 0.0001) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.004: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif math.sin(ky) <= 0.0001: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.004) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (sin(ky) <= 0.0001) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.004) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (sin(ky) <= 0.0001) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.004], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0001], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.0001:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in th around 0 49.0%
if -0.0040000000000000001 < (sin.f64 ky) < 1.00000000000000005e-4Initial program 87.1%
unpow287.1%
sqr-neg87.1%
sin-neg87.1%
sin-neg87.1%
unpow287.1%
associate-*l/83.0%
associate-/l*87.1%
unpow287.1%
Simplified99.6%
Taylor expanded in ky around 0 99.6%
if 1.00000000000000005e-4 < (sin.f64 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.6%
Taylor expanded in kx around 0 51.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.004)
(sqrt (pow (sin th) 2.0))
(if (<= (sin ky) 0.0325)
(* (sin th) (fabs (/ (sin ky) (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 0.0325) {
tmp = sin(th) * fabs((sin(ky) / 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.004d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 0.0325d0) then
tmp = sin(th) * abs((sin(ky) / 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.004) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 0.0325) {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.004: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 0.0325: tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.0325) tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.0325) tmp = sin(th) * abs((sin(ky) / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.004], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0325], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 0.0325:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.5%
pow229.5%
Applied egg-rr29.5%
if -0.0040000000000000001 < (sin.f64 ky) < 0.032500000000000001Initial program 87.2%
clear-num87.2%
associate-/r/87.1%
+-commutative87.1%
unpow287.1%
unpow287.1%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 47.3%
add-sqr-sqrt25.1%
sqrt-unprod34.9%
pow234.9%
associate-*l/34.9%
*-un-lft-identity34.9%
Applied egg-rr34.9%
unpow234.9%
rem-sqrt-square44.0%
Simplified44.0%
if 0.032500000000000001 < (sin.f64 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.6%
Taylor expanded in kx around 0 50.4%
Final simplification41.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.004) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 0.0001) (* (sin th) (fabs (/ ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 0.0001) {
tmp = sin(th) * fabs((ky / 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.004d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 0.0001d0) then
tmp = sin(th) * abs((ky / 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.004) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 0.0001) {
tmp = Math.sin(th) * Math.abs((ky / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.004: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 0.0001: tmp = math.sin(th) * math.fabs((ky / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.0001) tmp = Float64(sin(th) * abs(Float64(ky / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.0001) tmp = sin(th) * abs((ky / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.004], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0001], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.004:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 0.0001:\\
\;\;\;\;\sin th \cdot \left|\frac{ky}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.5%
pow229.5%
Applied egg-rr29.5%
if -0.0040000000000000001 < (sin.f64 ky) < 1.00000000000000005e-4Initial program 87.1%
clear-num87.1%
associate-/r/87.0%
+-commutative87.0%
unpow287.0%
unpow287.0%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 47.7%
Taylor expanded in ky around 0 47.7%
add-sqr-sqrt25.3%
sqrt-unprod35.1%
pow235.1%
associate-*l/35.1%
*-un-lft-identity35.1%
Applied egg-rr35.1%
unpow235.1%
rem-sqrt-square44.3%
Simplified44.3%
if 1.00000000000000005e-4 < (sin.f64 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.6%
Taylor expanded in kx around 0 51.1%
Final simplification42.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 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.8%
associate-/l*93.8%
unpow293.8%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00036)
(/ (sin ky) (/ (hypot (sin ky) (sin kx)) th))
(if (<= th 1.2e+252)
(/ (sin ky) (/ (hypot (sin ky) kx) (sin th)))
(* (sin ky) (/ (sin th) (hypot ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00036) {
tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th);
} else if (th <= 1.2e+252) {
tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00036) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / th);
} else if (th <= 1.2e+252) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), kx) / Math.sin(th));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00036: tmp = math.sin(ky) / (math.hypot(math.sin(ky), math.sin(kx)) / th) elif th <= 1.2e+252: tmp = math.sin(ky) / (math.hypot(math.sin(ky), kx) / math.sin(th)) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00036) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), sin(kx)) / th)); elseif (th <= 1.2e+252) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), kx) / sin(th))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00036) tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th); elseif (th <= 1.2e+252) tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th)); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00036], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.2e+252], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00036:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{th}}\\
\mathbf{elif}\;th \leq 1.2 \cdot 10^{+252}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 3.60000000000000023e-4Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/91.0%
associate-/l*93.5%
unpow293.5%
Simplified99.6%
Taylor expanded in th around 0 65.4%
clear-num65.3%
un-div-inv65.4%
Applied egg-rr65.4%
if 3.60000000000000023e-4 < th < 1.2e252Initial program 95.4%
unpow295.4%
sqr-neg95.4%
sin-neg95.4%
sin-neg95.4%
unpow295.4%
associate-*l/95.4%
associate-/l*95.3%
unpow295.3%
Simplified99.4%
clear-num99.3%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 50.7%
if 1.2e252 < th Initial program 91.8%
unpow291.8%
sqr-neg91.8%
sin-neg91.8%
sin-neg91.8%
unpow291.8%
associate-*l/91.8%
associate-/l*92.1%
unpow292.1%
Simplified99.6%
Taylor expanded in ky around 0 42.4%
(FPCore (kx ky th)
:precision binary64
(if (<= th 2.4e-5)
(/ th (/ (hypot (sin ky) (sin kx)) (sin ky)))
(if (<= th 1.25e+258)
(/ (sin ky) (/ (hypot (sin ky) kx) (sin th)))
(* (sin ky) (/ (sin th) (hypot ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 2.4e-5) {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
} else if (th <= 1.25e+258) {
tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 2.4e-5) {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
} else if (th <= 1.25e+258) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), kx) / Math.sin(th));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 2.4e-5: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) elif th <= 1.25e+258: tmp = math.sin(ky) / (math.hypot(math.sin(ky), kx) / math.sin(th)) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 2.4e-5) tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); elseif (th <= 1.25e+258) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), kx) / sin(th))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 2.4e-5) tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); elseif (th <= 1.25e+258) tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th)); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 2.4e-5], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.25e+258], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 2.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\mathbf{elif}\;th \leq 1.25 \cdot 10^{+258}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 2.4000000000000001e-5Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/91.0%
associate-/l*93.5%
unpow293.5%
Simplified99.6%
associate-*r/95.0%
hypot-undefine91.0%
unpow291.0%
unpow291.0%
+-commutative91.0%
associate-*l/93.6%
*-commutative93.6%
clear-num93.5%
un-div-inv93.5%
+-commutative93.5%
unpow293.5%
unpow293.5%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 65.4%
if 2.4000000000000001e-5 < th < 1.25e258Initial program 95.4%
unpow295.4%
sqr-neg95.4%
sin-neg95.4%
sin-neg95.4%
unpow295.4%
associate-*l/95.4%
associate-/l*95.3%
unpow295.3%
Simplified99.4%
clear-num99.3%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 50.7%
if 1.25e258 < th Initial program 91.8%
unpow291.8%
sqr-neg91.8%
sin-neg91.8%
sin-neg91.8%
unpow291.8%
associate-*l/91.8%
associate-/l*92.1%
unpow292.1%
Simplified99.6%
Taylor expanded in ky around 0 42.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.03) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 5e-108) (sin th) (/ (sin th) (/ (sin kx) ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 5e-108) {
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.03d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 5d-108) 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.03) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-108) {
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.03: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 5e-108: 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.03) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-108) 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.03) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 5e-108) 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.03], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-108], 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.03:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-108}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
clear-num99.4%
associate-/r/99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 10.2%
Taylor expanded in ky around 0 11.1%
add-sqr-sqrt8.4%
sqrt-unprod20.5%
pow220.5%
*-commutative20.5%
associate-*l/20.5%
*-un-lft-identity20.5%
Applied egg-rr20.5%
unpow220.5%
rem-sqrt-square28.4%
associate-*r/28.3%
*-commutative28.3%
associate-/l*28.3%
Simplified28.3%
if -0.029999999999999999 < (sin.f64 kx) < 5e-108Initial program 83.9%
unpow283.9%
sqr-neg83.9%
sin-neg83.9%
sin-neg83.9%
unpow283.9%
associate-*l/78.5%
associate-/l*83.8%
unpow283.8%
Simplified99.8%
Taylor expanded in kx around 0 38.6%
if 5e-108 < (sin.f64 kx) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.6%
hypot-undefine99.6%
unpow299.6%
unpow299.6%
+-commutative99.6%
associate-*l/99.6%
*-commutative99.6%
clear-num99.3%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 44.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.004) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 1e-112) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 1e-112) {
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.004d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 1d-112) 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.004) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 1e-112) {
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.004: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 1e-112: 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.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-112) 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.004) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-112) 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.004], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-112], 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.004:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 10^{-112}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.5%
pow229.5%
Applied egg-rr29.5%
if -0.0040000000000000001 < (sin.f64 ky) < 9.9999999999999995e-113Initial program 85.3%
unpow285.3%
sqr-neg85.3%
sin-neg85.3%
sin-neg85.3%
unpow285.3%
associate-*l/81.5%
associate-/l*85.3%
unpow285.3%
Simplified99.6%
associate-*r/92.0%
hypot-undefine81.5%
unpow281.5%
unpow281.5%
+-commutative81.5%
associate-*l/85.3%
*-commutative85.3%
clear-num85.3%
un-div-inv85.4%
+-commutative85.4%
unpow285.4%
unpow285.4%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 49.4%
if 9.9999999999999995e-113 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 48.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.004) (fabs (sin th)) (if (<= (sin ky) 1e-112) (/ (sin th) (/ (sin kx) ky)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-112) {
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.004d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-112) 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.004) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-112) {
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.004: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-112: 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.004) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-112) 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.004) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-112) 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.004], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-112], 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.004:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-112}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-log-exp3.4%
Applied egg-rr3.4%
rem-log-exp2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.5%
pow229.5%
Applied egg-rr29.5%
unpow229.5%
rem-sqrt-square35.5%
Simplified35.5%
if -0.0040000000000000001 < (sin.f64 ky) < 9.9999999999999995e-113Initial program 85.3%
unpow285.3%
sqr-neg85.3%
sin-neg85.3%
sin-neg85.3%
unpow285.3%
associate-*l/81.5%
associate-/l*85.3%
unpow285.3%
Simplified99.6%
associate-*r/92.0%
hypot-undefine81.5%
unpow281.5%
unpow281.5%
+-commutative81.5%
associate-*l/85.3%
*-commutative85.3%
clear-num85.3%
un-div-inv85.4%
+-commutative85.4%
unpow285.4%
unpow285.4%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 49.4%
if 9.9999999999999995e-113 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 48.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.004) (fabs (sin th)) (if (<= (sin ky) 1e-112) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.004) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-112) {
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.004d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-112) 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.004) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-112) {
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.004: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-112: 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.004) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-112) 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.004) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-112) 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.004], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-112], 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.004:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-112}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0040000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-log-exp3.4%
Applied egg-rr3.4%
rem-log-exp2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.5%
pow229.5%
Applied egg-rr29.5%
unpow229.5%
rem-sqrt-square35.5%
Simplified35.5%
if -0.0040000000000000001 < (sin.f64 ky) < 9.9999999999999995e-113Initial program 85.3%
unpow285.3%
sqr-neg85.3%
sin-neg85.3%
sin-neg85.3%
unpow285.3%
associate-*l/81.5%
associate-/l*85.3%
unpow285.3%
Simplified99.6%
Taylor expanded in ky around 0 46.2%
associate-/l*49.4%
Simplified49.4%
if 9.9999999999999995e-113 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 48.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.52) (/ (sin ky) (/ (hypot (sin ky) kx) (sin th))) (* (sin th) (* (sin ky) (/ 1.0 (fabs (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.52) {
tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th));
} else {
tmp = sin(th) * (sin(ky) * (1.0 / fabs(sin(kx))));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.52) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), kx) / Math.sin(th));
} else {
tmp = Math.sin(th) * (Math.sin(ky) * (1.0 / Math.abs(Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.52: tmp = math.sin(ky) / (math.hypot(math.sin(ky), kx) / math.sin(th)) else: tmp = math.sin(th) * (math.sin(ky) * (1.0 / math.fabs(math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.52) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), kx) / sin(th))); else tmp = Float64(sin(th) * Float64(sin(ky) * Float64(1.0 / abs(sin(kx))))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.52) tmp = sin(ky) / (hypot(sin(ky), kx) / sin(th)); else tmp = sin(th) * (sin(ky) * (1.0 / abs(sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.52], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] * N[(1.0 / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.52:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left(\sin ky \cdot \frac{1}{\left|\sin kx\right|}\right)\\
\end{array}
\end{array}
if kx < 0.52000000000000002Initial program 91.6%
unpow291.6%
sqr-neg91.6%
sin-neg91.6%
sin-neg91.6%
unpow291.6%
associate-*l/88.9%
associate-/l*91.6%
unpow291.6%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0 69.4%
if 0.52000000000000002 < kx Initial program 99.5%
clear-num99.3%
associate-/r/99.3%
+-commutative99.3%
unpow299.3%
unpow299.3%
hypot-undefine99.3%
Applied egg-rr99.3%
Taylor expanded in ky around 0 31.5%
add-sqr-sqrt23.7%
sqrt-unprod51.1%
pow251.1%
Applied egg-rr51.1%
unpow251.1%
rem-sqrt-square51.1%
Simplified51.1%
Final simplification64.3%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.135) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin th) (fabs (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.135) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(th) * fabs((sin(ky) / sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.135) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(th) * Math.abs((Math.sin(ky) / Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.135: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(th) * math.fabs((math.sin(ky) / math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.135) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(th) * abs(Float64(sin(ky) / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.135) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(th) * abs((sin(ky) / sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.135], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.135:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \left|\frac{\sin ky}{\sin kx}\right|\\
\end{array}
\end{array}
if th < 0.13500000000000001Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/91.0%
associate-/l*93.5%
unpow293.5%
Simplified99.6%
Taylor expanded in th around 0 65.4%
if 0.13500000000000001 < th Initial program 94.6%
clear-num94.6%
associate-/r/94.4%
+-commutative94.4%
unpow294.4%
unpow294.4%
hypot-undefine99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 26.4%
add-sqr-sqrt15.4%
sqrt-unprod19.0%
pow219.0%
associate-*l/19.1%
*-un-lft-identity19.1%
Applied egg-rr19.1%
unpow219.1%
rem-sqrt-square25.0%
Simplified25.0%
Final simplification55.8%
(FPCore (kx ky th) :precision binary64 (if (<= ky 7e-113) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-113) {
tmp = ky * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 7d-113) then
tmp = ky * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-113) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 7e-113: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 7e-113) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 7e-113) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 7e-113], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 7 \cdot 10^{-113}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 7.00000000000000057e-113Initial program 91.7%
clear-num91.6%
associate-/r/91.5%
+-commutative91.5%
unpow291.5%
unpow291.5%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 30.7%
Taylor expanded in ky around 0 28.9%
Taylor expanded in kx around 0 17.7%
associate-/l*19.5%
Simplified19.5%
if 7.00000000000000057e-113 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 24.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.01e-112) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.01e-112) {
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 <= 1.01d-112) 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 <= 1.01e-112) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.01e-112: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.01e-112) 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 <= 1.01e-112) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.01e-112], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.01 \cdot 10^{-112}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.01e-112Initial program 91.7%
unpow291.7%
sqr-neg91.7%
sin-neg91.7%
sin-neg91.7%
unpow291.7%
associate-*l/89.5%
associate-/l*91.6%
unpow291.6%
Simplified99.6%
Taylor expanded in th around 0 55.0%
Taylor expanded in ky around 0 16.2%
associate-/l*17.9%
Simplified17.9%
if 1.01e-112 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 24.0%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.0072) (sin th) (log (+ th 1.0))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0072) {
tmp = sin(th);
} else {
tmp = log((th + 1.0));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 0.0072d0) then
tmp = sin(th)
else
tmp = log((th + 1.0d0))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0072) {
tmp = Math.sin(th);
} else {
tmp = Math.log((th + 1.0));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.0072: tmp = math.sin(th) else: tmp = math.log((th + 1.0)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.0072) tmp = sin(th); else tmp = log(Float64(th + 1.0)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.0072) tmp = sin(th); else tmp = log((th + 1.0)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.0072], N[Sin[th], $MachinePrecision], N[Log[N[(th + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.0072:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\log \left(th + 1\right)\\
\end{array}
\end{array}
if kx < 0.0071999999999999998Initial program 91.5%
unpow291.5%
sqr-neg91.5%
sin-neg91.5%
sin-neg91.5%
unpow291.5%
associate-*l/88.8%
associate-/l*91.5%
unpow291.5%
Simplified99.7%
Taylor expanded in kx around 0 26.6%
if 0.0071999999999999998 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 8.6%
add-log-exp15.6%
Applied egg-rr15.6%
Taylor expanded in th around 0 12.2%
+-commutative12.2%
Simplified12.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.85e-260) 0.0 (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.85e-260) {
tmp = 0.0;
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 2.85d-260) then
tmp = 0.0d0
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.85e-260) {
tmp = 0.0;
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.85e-260: tmp = 0.0 else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.85e-260) tmp = 0.0; else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.85e-260) tmp = 0.0; else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.85e-260], 0.0, N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.85 \cdot 10^{-260}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.8499999999999999e-260Initial program 96.3%
unpow296.3%
sqr-neg96.3%
sin-neg96.3%
sin-neg96.3%
unpow296.3%
associate-*l/94.8%
associate-/l*96.2%
unpow296.2%
Simplified99.6%
Taylor expanded in kx around 0 18.3%
add-log-exp14.5%
Applied egg-rr14.5%
Taylor expanded in th around 0 9.6%
metadata-eval9.6%
Applied egg-rr9.6%
if 2.8499999999999999e-260 < ky Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/87.6%
associate-/l*90.2%
unpow290.2%
Simplified99.6%
Taylor expanded in kx around 0 25.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.15e-70) th 0.0))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.15e-70) {
tmp = th;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.15d-70) then
tmp = th
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.15e-70) {
tmp = th;
} else {
tmp = 0.0;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.15e-70: tmp = th else: tmp = 0.0 return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.15e-70) tmp = th; else tmp = 0.0; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.15e-70) tmp = th; else tmp = 0.0; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.15e-70], th, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.15 \cdot 10^{-70}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if kx < 1.15e-70Initial program 90.8%
unpow290.8%
sqr-neg90.8%
sin-neg90.8%
sin-neg90.8%
unpow290.8%
associate-*l/87.7%
associate-/l*90.7%
unpow290.7%
Simplified99.6%
Taylor expanded in th around 0 50.4%
Taylor expanded in kx around 0 14.5%
if 1.15e-70 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 11.4%
add-log-exp15.7%
Applied egg-rr15.7%
Taylor expanded in th around 0 12.8%
metadata-eval12.8%
Applied egg-rr12.8%
(FPCore (kx ky th) :precision binary64 0.0)
double code(double kx, double ky, double th) {
return 0.0;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = 0.0d0
end function
public static double code(double kx, double ky, double th) {
return 0.0;
}
def code(kx, ky, th): return 0.0
function code(kx, ky, th) return 0.0 end
function tmp = code(kx, ky, th) tmp = 0.0; end
code[kx_, ky_, th_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.8%
associate-/l*93.8%
unpow293.8%
Simplified99.6%
Taylor expanded in kx around 0 21.4%
add-log-exp18.2%
Applied egg-rr18.2%
Taylor expanded in th around 0 9.4%
metadata-eval9.4%
Applied egg-rr9.4%
herbie shell --seed 2024113
(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)))