
(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 th) (/ (hypot (sin ky) (sin kx)) (sin ky))))
double code(double kx, double ky, double th) {
return sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
def code(kx, ky, th): return math.sin(th) / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky))
function code(kx, ky, th) return Float64(sin(th) / Float64(hypot(sin(ky), sin(kx)) / sin(ky))) end
function tmp = code(kx, ky, th) tmp = sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky)); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\end{array}
Initial program 95.1%
unpow295.1%
sqr-neg95.1%
sin-neg95.1%
sin-neg95.1%
unpow295.1%
associate-*l/93.3%
associate-/l*95.1%
+-commutative95.1%
unpow295.1%
sin-neg95.1%
sin-neg95.1%
Simplified99.6%
associate-*r/97.1%
hypot-undefine93.3%
unpow293.3%
unpow293.3%
+-commutative93.3%
associate-*l/95.1%
*-commutative95.1%
clear-num95.1%
un-div-inv95.1%
+-commutative95.1%
unpow295.1%
unpow295.1%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.0005) (/ (* th (sin ky)) (hypot (sin ky) kx)) (if (<= (sin ky) 0.002) (/ (* (sin th) ky) (fabs (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.0005) {
tmp = (th * sin(ky)) / hypot(sin(ky), kx);
} else if (sin(ky) <= 0.002) {
tmp = (sin(th) * ky) / fabs(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.0005) {
tmp = (th * Math.sin(ky)) / Math.hypot(Math.sin(ky), kx);
} else if (Math.sin(ky) <= 0.002) {
tmp = (Math.sin(th) * ky) / Math.abs(Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.0005: tmp = (th * math.sin(ky)) / math.hypot(math.sin(ky), kx) elif math.sin(ky) <= 0.002: tmp = (math.sin(th) * ky) / math.fabs(math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.0005) tmp = Float64(Float64(th * sin(ky)) / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.002) tmp = Float64(Float64(sin(th) * ky) / abs(sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.0005) tmp = (th * sin(ky)) / hypot(sin(ky), kx); elseif (sin(ky) <= 0.002) tmp = (sin(th) * ky) / abs(sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.0005], N[(N[(th * N[Sin[ky], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.002], N[(N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\frac{th \cdot \sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.002:\\
\;\;\;\;\frac{\sin th \cdot ky}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -5.0000000000000001e-4Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in th around 0 58.1%
rem-square-sqrt58.1%
+-commutative58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
+-commutative58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
unpow258.1%
Simplified58.1%
associate-*r*58.3%
sqrt-div58.2%
metadata-eval58.2%
sqrt-pow158.2%
metadata-eval58.2%
pow158.2%
un-div-inv58.3%
*-commutative58.3%
hypot-undefine58.3%
+-commutative58.3%
hypot-undefine58.3%
Applied egg-rr58.3%
Taylor expanded in kx around 0 29.7%
if -5.0000000000000001e-4 < (sin.f64 ky) < 2e-3Initial program 90.2%
unpow290.2%
sqr-neg90.2%
sin-neg90.2%
sin-neg90.2%
unpow290.2%
associate-*l/86.6%
associate-/l*90.3%
+-commutative90.3%
unpow290.3%
sin-neg90.3%
sin-neg90.3%
Simplified99.7%
Taylor expanded in ky around 0 45.4%
add-sqr-sqrt38.2%
sqrt-prod75.2%
rem-sqrt-square81.9%
Applied egg-rr78.9%
if 2e-3 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 59.7%
Final simplification60.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.0005) (* (sin ky) (/ th (hypot (sin ky) kx))) (if (<= (sin ky) 0.002) (/ (* (sin th) ky) (fabs (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.0005) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 0.002) {
tmp = (sin(th) * ky) / fabs(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.0005) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 0.002) {
tmp = (Math.sin(th) * ky) / Math.abs(Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.0005: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 0.002: tmp = (math.sin(th) * ky) / math.fabs(math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.0005) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 0.002) tmp = Float64(Float64(sin(th) * ky) / abs(sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.0005) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.002) tmp = (sin(th) * ky) / abs(sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.0005], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.002], N[(N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.002:\\
\;\;\;\;\frac{\sin th \cdot ky}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -5.0000000000000001e-4Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 46.7%
Taylor expanded in th around 0 29.7%
if -5.0000000000000001e-4 < (sin.f64 ky) < 2e-3Initial program 90.2%
unpow290.2%
sqr-neg90.2%
sin-neg90.2%
sin-neg90.2%
unpow290.2%
associate-*l/86.6%
associate-/l*90.3%
+-commutative90.3%
unpow290.3%
sin-neg90.3%
sin-neg90.3%
Simplified99.7%
Taylor expanded in ky around 0 45.4%
add-sqr-sqrt38.2%
sqrt-prod75.2%
rem-sqrt-square81.9%
Applied egg-rr78.9%
if 2e-3 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 59.7%
Final simplification60.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.0005) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 0.002) (/ (* (sin th) ky) (fabs (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.0005) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 0.002) {
tmp = (sin(th) * ky) / fabs(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.0005d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 0.002d0) then
tmp = (sin(th) * ky) / abs(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.0005) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 0.002) {
tmp = (Math.sin(th) * ky) / Math.abs(Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.0005: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 0.002: tmp = (math.sin(th) * ky) / math.fabs(math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.0005) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.002) tmp = Float64(Float64(sin(th) * ky) / abs(sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.0005) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 0.002) tmp = (sin(th) * ky) / abs(sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.0005], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.002], N[(N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.0005:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 0.002:\\
\;\;\;\;\frac{\sin th \cdot ky}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -5.0000000000000001e-4Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.9%
add-sqr-sqrt1.3%
sqrt-unprod26.5%
pow226.5%
Applied egg-rr26.5%
if -5.0000000000000001e-4 < (sin.f64 ky) < 2e-3Initial program 90.2%
unpow290.2%
sqr-neg90.2%
sin-neg90.2%
sin-neg90.2%
unpow290.2%
associate-*l/86.6%
associate-/l*90.3%
+-commutative90.3%
unpow290.3%
sin-neg90.3%
sin-neg90.3%
Simplified99.7%
Taylor expanded in ky around 0 45.4%
add-sqr-sqrt38.2%
sqrt-prod75.2%
rem-sqrt-square81.9%
Applied egg-rr78.9%
if 2e-3 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 59.7%
Final simplification59.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.02) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 2e-119) (sin th) (/ (sin th) (/ (sin kx) (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 2e-119) {
tmp = sin(th);
} else {
tmp = sin(th) / (sin(kx) / sin(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.02d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 2d-119) then
tmp = sin(th)
else
tmp = sin(th) / (sin(kx) / sin(ky))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 2e-119) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) / (Math.sin(kx) / Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.02: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 2e-119: tmp = math.sin(th) else: tmp = math.sin(th) / (math.sin(kx) / math.sin(ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.02) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 2e-119) tmp = sin(th); else tmp = Float64(sin(th) / Float64(sin(kx) / sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.02) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 2e-119) tmp = sin(th); else tmp = sin(th) / (sin(kx) / sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-119], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-119}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in ky around 0 14.7%
add-sqr-sqrt12.0%
sqrt-unprod25.6%
pow225.6%
associate-/l*25.6%
Applied egg-rr25.6%
unpow225.6%
rem-sqrt-square41.9%
Simplified41.9%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000003e-119Initial program 88.2%
unpow288.2%
sqr-neg88.2%
sin-neg88.2%
sin-neg88.2%
unpow288.2%
associate-*l/85.3%
associate-/l*88.1%
+-commutative88.1%
unpow288.1%
sin-neg88.1%
sin-neg88.1%
Simplified99.7%
Taylor expanded in kx around 0 40.6%
if 2.00000000000000003e-119 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/97.7%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
associate-*r/97.7%
hypot-undefine97.7%
unpow297.7%
unpow297.7%
+-commutative97.7%
associate-*l/99.5%
*-commutative99.5%
clear-num99.4%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
expm1-log1p-u99.5%
expm1-undefine90.0%
Applied egg-rr90.0%
expm1-define99.5%
Simplified99.5%
Taylor expanded in ky around 0 54.1%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.02)
(fabs (* ky t_1))
(if (<= (sin kx) 2e-119) (sin th) (* (sin ky) t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 2e-119) {
tmp = sin(th);
} else {
tmp = sin(ky) * t_1;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.02d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 2d-119) then
tmp = sin(th)
else
tmp = sin(ky) * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.02) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 2e-119) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.02: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 2e-119: tmp = math.sin(th) else: tmp = math.sin(ky) * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.02) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 2e-119) tmp = sin(th); else tmp = Float64(sin(ky) * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.02) tmp = abs((ky * t_1)); elseif (sin(kx) <= 2e-119) tmp = sin(th); else tmp = sin(ky) * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.02], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-119], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.02:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-119}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in ky around 0 14.7%
add-sqr-sqrt12.0%
sqrt-unprod25.6%
pow225.6%
associate-/l*25.6%
Applied egg-rr25.6%
unpow225.6%
rem-sqrt-square41.9%
Simplified41.9%
if -0.0200000000000000004 < (sin.f64 kx) < 2.00000000000000003e-119Initial program 88.2%
unpow288.2%
sqr-neg88.2%
sin-neg88.2%
sin-neg88.2%
unpow288.2%
associate-*l/85.3%
associate-/l*88.1%
+-commutative88.1%
unpow288.1%
sin-neg88.1%
sin-neg88.1%
Simplified99.7%
Taylor expanded in kx around 0 40.6%
if 2.00000000000000003e-119 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/97.7%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in ky around 0 54.1%
(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/93.3%
associate-/l*95.1%
+-commutative95.1%
unpow295.1%
sin-neg95.1%
sin-neg95.1%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 0.005)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(if (<= ky 5.5e+204)
(* (sin ky) (/ (sin th) (fabs (sin ky))))
(/ th (/ (hypot (sin ky) (sin kx)) (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.005) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else if (ky <= 5.5e+204) {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
} else {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.005) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else if (ky <= 5.5e+204) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
} else {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.005: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) elif ky <= 5.5e+204: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) else: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.005) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); elseif (ky <= 5.5e+204) tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); else tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.005) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); elseif (ky <= 5.5e+204) tmp = sin(ky) * (sin(th) / abs(sin(ky))); else tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.005], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 5.5e+204], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.005:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;ky \leq 5.5 \cdot 10^{+204}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\end{array}
\end{array}
if ky < 0.0050000000000000001Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
Taylor expanded in ky around 0 64.1%
if 0.0050000000000000001 < ky < 5.4999999999999996e204Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.5%
Taylor expanded in kx around 0 28.5%
add-sqr-sqrt27.3%
sqrt-prod58.0%
rem-sqrt-square58.0%
Applied egg-rr58.0%
if 5.4999999999999996e204 < 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.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
associate-*r/99.6%
hypot-undefine99.6%
unpow299.6%
unpow299.6%
+-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
clear-num99.8%
un-div-inv99.9%
+-commutative99.9%
unpow299.9%
unpow299.9%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in th around 0 72.0%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 0.00185)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(if (<= ky 2.7e+205)
(* (sin ky) (/ (sin th) (fabs (sin ky))))
(* (sin ky) (/ th (hypot (sin ky) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.00185) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else if (ky <= 2.7e+205) {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
} else {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.00185) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else if (ky <= 2.7e+205) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
} else {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.00185: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) elif ky <= 2.7e+205: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) else: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.00185) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); elseif (ky <= 2.7e+205) tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); else tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.00185) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); elseif (ky <= 2.7e+205) tmp = sin(ky) * (sin(th) / abs(sin(ky))); else tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.00185], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 2.7e+205], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.00185:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;ky \leq 2.7 \cdot 10^{+205}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\end{array}
\end{array}
if ky < 0.0018500000000000001Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
Taylor expanded in ky around 0 64.1%
if 0.0018500000000000001 < ky < 2.70000000000000012e205Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.5%
Taylor expanded in kx around 0 28.5%
add-sqr-sqrt27.3%
sqrt-prod58.0%
rem-sqrt-square58.0%
Applied egg-rr58.0%
if 2.70000000000000012e205 < 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.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in th around 0 71.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.02) (fabs (* ky (/ (sin th) (sin kx)))) (if (<= (sin kx) 4e-119) (sin th) (/ (sin th) (/ (sin kx) ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.02) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else if (sin(kx) <= 4e-119) {
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.02d0)) then
tmp = abs((ky * (sin(th) / sin(kx))))
else if (sin(kx) <= 4d-119) 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.02) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 4e-119) {
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.02: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 4e-119: 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.02) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 4e-119) 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.02) tmp = abs((ky * (sin(th) / sin(kx)))); elseif (sin(kx) <= 4e-119) 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.02], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 4e-119], 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.02:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-119}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0200000000000000004Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in ky around 0 14.7%
add-sqr-sqrt12.0%
sqrt-unprod25.6%
pow225.6%
associate-/l*25.6%
Applied egg-rr25.6%
unpow225.6%
rem-sqrt-square41.9%
Simplified41.9%
if -0.0200000000000000004 < (sin.f64 kx) < 4.00000000000000005e-119Initial program 88.2%
unpow288.2%
sqr-neg88.2%
sin-neg88.2%
sin-neg88.2%
unpow288.2%
associate-*l/85.3%
associate-/l*88.1%
+-commutative88.1%
unpow288.1%
sin-neg88.1%
sin-neg88.1%
Simplified99.7%
Taylor expanded in kx around 0 40.6%
if 4.00000000000000005e-119 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/97.7%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
associate-*r/97.7%
hypot-undefine97.7%
unpow297.7%
unpow297.7%
+-commutative97.7%
associate-*l/99.5%
*-commutative99.5%
clear-num99.4%
un-div-inv99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 45.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.0005) (sqrt (pow (sin th) 2.0)) (if (<= (sin ky) 1e-35) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.0005) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 1e-35) {
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.0005d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 1d-35) 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.0005) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 1e-35) {
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.0005: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 1e-35: 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.0005) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-35) 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.0005) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 1e-35) 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.0005], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-35], 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.0005:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 10^{-35}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -5.0000000000000001e-4Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.9%
add-sqr-sqrt1.3%
sqrt-unprod26.5%
pow226.5%
Applied egg-rr26.5%
if -5.0000000000000001e-4 < (sin.f64 ky) < 1.00000000000000001e-35Initial program 89.6%
unpow289.6%
sqr-neg89.6%
sin-neg89.6%
sin-neg89.6%
unpow289.6%
associate-*l/85.8%
associate-/l*89.7%
+-commutative89.7%
unpow289.7%
sin-neg89.7%
sin-neg89.7%
Simplified99.7%
Taylor expanded in ky around 0 47.2%
associate-/l*49.6%
Simplified49.6%
if 1.00000000000000001e-35 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 61.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.0005) (fabs (sin th)) (if (<= (sin ky) 1e-35) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.0005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-35) {
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.0005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-35) 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.0005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-35) {
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.0005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-35: 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.0005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-35) 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.0005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-35) 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.0005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-35], 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.0005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-35}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -5.0000000000000001e-4Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.9%
add-sqr-sqrt1.3%
sqrt-unprod26.5%
pow226.5%
clear-num26.5%
un-div-inv26.5%
Applied egg-rr26.5%
unpow226.5%
rem-sqrt-square34.5%
associate-/r/34.6%
*-inverses34.6%
*-lft-identity34.6%
Simplified34.6%
if -5.0000000000000001e-4 < (sin.f64 ky) < 1.00000000000000001e-35Initial program 89.6%
unpow289.6%
sqr-neg89.6%
sin-neg89.6%
sin-neg89.6%
unpow289.6%
associate-*l/85.8%
associate-/l*89.7%
+-commutative89.7%
unpow289.7%
sin-neg89.7%
sin-neg89.7%
Simplified99.7%
Taylor expanded in ky around 0 47.2%
associate-/l*49.6%
Simplified49.6%
if 1.00000000000000001e-35 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 61.2%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.37) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (/ (sin ky) (/ (fabs (sin kx)) (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.37) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.37) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.37: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.37) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.37) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) / (abs(sin(kx)) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.37], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.37:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\end{array}
\end{array}
if th < 0.37Initial program 96.2%
unpow296.2%
sqr-neg96.2%
sin-neg96.2%
sin-neg96.2%
unpow296.2%
associate-*l/93.8%
associate-/l*96.2%
+-commutative96.2%
unpow296.2%
sin-neg96.2%
sin-neg96.2%
Simplified99.6%
Taylor expanded in th around 0 68.0%
if 0.37 < th Initial program 92.1%
unpow292.1%
sqr-neg92.1%
sin-neg92.1%
sin-neg92.1%
unpow292.1%
associate-*l/92.2%
associate-/l*92.2%
+-commutative92.2%
unpow292.2%
sin-neg92.2%
sin-neg92.2%
Simplified99.7%
clear-num99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 23.7%
add-sqr-sqrt22.5%
sqrt-prod43.7%
rem-sqrt-square51.3%
Applied egg-rr51.3%
(FPCore (kx ky th) :precision binary64 (if (<= ky 0.0018) (/ (sin ky) (/ (fabs (sin kx)) (sin th))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0018) {
tmp = sin(ky) / (fabs(sin(kx)) / sin(th));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(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 (ky <= 0.0018d0) then
tmp = sin(ky) / (abs(sin(kx)) / sin(th))
else
tmp = sin(ky) * (sin(th) / abs(sin(ky)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0018) {
tmp = Math.sin(ky) / (Math.abs(Math.sin(kx)) / Math.sin(th));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.0018: tmp = math.sin(ky) / (math.fabs(math.sin(kx)) / math.sin(th)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.0018) tmp = Float64(sin(ky) / Float64(abs(sin(kx)) / sin(th))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.0018) tmp = sin(ky) / (abs(sin(kx)) / sin(th)); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.0018], N[(N[Sin[ky], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.0018:\\
\;\;\;\;\frac{\sin ky}{\frac{\left|\sin kx\right|}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 0.0018Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 33.6%
add-sqr-sqrt27.6%
sqrt-prod51.9%
rem-sqrt-square56.1%
Applied egg-rr56.1%
if 0.0018 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 25.1%
add-sqr-sqrt23.6%
sqrt-prod56.6%
rem-sqrt-square56.6%
Applied egg-rr56.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 0.0018) (/ (* (sin th) ky) (fabs (sin kx))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0018) {
tmp = (sin(th) * ky) / fabs(sin(kx));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(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 (ky <= 0.0018d0) then
tmp = (sin(th) * ky) / abs(sin(kx))
else
tmp = sin(ky) * (sin(th) / abs(sin(ky)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0018) {
tmp = (Math.sin(th) * ky) / Math.abs(Math.sin(kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 0.0018: tmp = (math.sin(th) * ky) / math.fabs(math.sin(kx)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 0.0018) tmp = Float64(Float64(sin(th) * ky) / abs(sin(kx))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 0.0018) tmp = (sin(th) * ky) / abs(sin(kx)); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.0018], N[(N[(N[Sin[th], $MachinePrecision] * ky), $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 0.0018:\\
\;\;\;\;\frac{\sin th \cdot ky}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 0.0018Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.5%
associate-/l*93.8%
+-commutative93.8%
unpow293.8%
sin-neg93.8%
sin-neg93.8%
Simplified99.6%
Taylor expanded in ky around 0 29.6%
add-sqr-sqrt27.6%
sqrt-prod51.9%
rem-sqrt-square56.1%
Applied egg-rr50.3%
if 0.0018 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 25.1%
add-sqr-sqrt23.6%
sqrt-prod56.6%
rem-sqrt-square56.6%
Applied egg-rr56.6%
Final simplification51.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.1) (fabs (sin th)) (if (<= (sin ky) 1e-68) (* ky (/ (sin th) kx)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.1) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-68) {
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 (sin(ky) <= (-0.1d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-68) 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 (Math.sin(ky) <= -0.1) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-68) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.1: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-68: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.1) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-68) 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 (sin(ky) <= -0.1) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-68) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.1], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-68], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.1:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-68}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.10000000000000001Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.8%
add-sqr-sqrt1.1%
sqrt-unprod29.1%
pow229.1%
clear-num29.1%
un-div-inv29.2%
Applied egg-rr29.2%
unpow229.2%
rem-sqrt-square38.3%
associate-/r/38.3%
*-inverses38.3%
*-lft-identity38.3%
Simplified38.3%
if -0.10000000000000001 < (sin.f64 ky) < 1.00000000000000007e-68Initial program 89.5%
unpow289.5%
sqr-neg89.5%
sin-neg89.5%
sin-neg89.5%
unpow289.5%
associate-*l/85.7%
associate-/l*89.6%
+-commutative89.6%
unpow289.6%
sin-neg89.6%
sin-neg89.6%
Simplified99.6%
Taylor expanded in ky around 0 47.4%
Taylor expanded in kx around 0 28.0%
associate-/l*30.4%
Simplified30.4%
if 1.00000000000000007e-68 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 58.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 6.5e-69) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6.5e-69) {
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 <= 6.5d-69) 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 <= 6.5e-69) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 6.5e-69: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 6.5e-69) 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 <= 6.5e-69) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 6.5e-69], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 6.5 \cdot 10^{-69}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 6.49999999999999951e-69Initial program 93.3%
unpow293.3%
sqr-neg93.3%
sin-neg93.3%
sin-neg93.3%
unpow293.3%
associate-*l/90.9%
associate-/l*93.3%
+-commutative93.3%
unpow293.3%
sin-neg93.3%
sin-neg93.3%
Simplified99.6%
Taylor expanded in ky around 0 30.7%
Taylor expanded in kx around 0 19.0%
associate-/l*20.5%
Simplified20.5%
if 6.49999999999999951e-69 < 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%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 30.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.2e-89) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.2e-89) {
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 <= 6.2d-89) 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 <= 6.2e-89) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.2e-89: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.2e-89) 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 <= 6.2e-89) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.2e-89], 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.2 \cdot 10^{-89}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 6.19999999999999993e-89Initial program 93.3%
unpow293.3%
sqr-neg93.3%
sin-neg93.3%
sin-neg93.3%
unpow293.3%
associate-*l/91.4%
associate-/l*93.4%
+-commutative93.4%
unpow293.4%
sin-neg93.4%
sin-neg93.4%
Simplified99.7%
Taylor expanded in kx around 0 25.5%
if 6.19999999999999993e-89 < kx Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.3%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.4%
Taylor expanded in th around 0 58.7%
rem-square-sqrt58.8%
+-commutative58.8%
unpow258.8%
unpow258.8%
hypot-undefine58.8%
+-commutative58.8%
unpow258.8%
unpow258.8%
hypot-undefine58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in ky around 0 18.5%
associate-/l*19.7%
Simplified19.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.9e-126) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.9e-126) {
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 <= 1.9d-126) 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 <= 1.9e-126) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.9e-126: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.9e-126) 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 <= 1.9e-126) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.9e-126], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.9 \cdot 10^{-126}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.8999999999999999e-126Initial program 92.9%
unpow292.9%
sqr-neg92.9%
sin-neg92.9%
sin-neg92.9%
unpow292.9%
associate-*l/90.3%
associate-/l*92.9%
+-commutative92.9%
unpow292.9%
sin-neg92.9%
sin-neg92.9%
Simplified99.6%
Taylor expanded in th around 0 49.6%
rem-square-sqrt49.6%
+-commutative49.6%
unpow249.6%
unpow249.6%
hypot-undefine49.6%
+-commutative49.6%
unpow249.6%
unpow249.6%
hypot-undefine49.6%
unpow249.6%
Simplified49.6%
Taylor expanded in ky around 0 15.7%
associate-/l*17.3%
Simplified17.3%
Taylor expanded in kx around 0 14.5%
associate-/l*16.1%
Simplified16.1%
if 1.8999999999999999e-126 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 28.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.95e-32) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.95e-32) {
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.95d-32) 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.95e-32) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.95e-32: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.95e-32) 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.95e-32) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.95e-32], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.95 \cdot 10^{-32}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 1.9500000000000001e-32Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/91.3%
associate-/l*93.7%
+-commutative93.7%
unpow293.7%
sin-neg93.7%
sin-neg93.7%
Simplified99.6%
Taylor expanded in th around 0 49.1%
rem-square-sqrt49.0%
+-commutative49.0%
unpow249.0%
unpow249.0%
hypot-undefine49.0%
+-commutative49.0%
unpow249.0%
unpow249.0%
hypot-undefine49.0%
unpow249.0%
Simplified49.0%
Taylor expanded in ky around 0 15.5%
associate-/l*16.9%
Simplified16.9%
Taylor expanded in kx around 0 14.5%
associate-/l*15.9%
Simplified15.9%
if 1.9500000000000001e-32 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 28.3%
Taylor expanded in th around 0 11.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/93.3%
associate-/l*95.1%
+-commutative95.1%
unpow295.1%
sin-neg95.1%
sin-neg95.1%
Simplified99.6%
Taylor expanded in kx around 0 21.4%
Taylor expanded in th around 0 11.2%
herbie shell --seed 2024163
(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)))