
(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 23 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.4%
+-commutative93.4%
unpow293.4%
unpow293.4%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.16)
(- th)
(if (or (<= (sin ky) 4e-93)
(and (not (<= (sin ky) 5e-30)) (<= (sin ky) 1e-11)))
(/ (sin ky) (/ (sin kx) (sin th)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.16) {
tmp = -th;
} else if ((sin(ky) <= 4e-93) || (!(sin(ky) <= 5e-30) && (sin(ky) <= 1e-11))) {
tmp = sin(ky) / (sin(kx) / sin(th));
} 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.16d0)) then
tmp = -th
else if ((sin(ky) <= 4d-93) .or. (.not. (sin(ky) <= 5d-30)) .and. (sin(ky) <= 1d-11)) then
tmp = sin(ky) / (sin(kx) / sin(th))
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.16) {
tmp = -th;
} else if ((Math.sin(ky) <= 4e-93) || (!(Math.sin(ky) <= 5e-30) && (Math.sin(ky) <= 1e-11))) {
tmp = Math.sin(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.16: tmp = -th elif (math.sin(ky) <= 4e-93) or (not (math.sin(ky) <= 5e-30) and (math.sin(ky) <= 1e-11)): tmp = math.sin(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.16) tmp = Float64(-th); elseif ((sin(ky) <= 4e-93) || (!(sin(ky) <= 5e-30) && (sin(ky) <= 1e-11))) tmp = Float64(sin(ky) / Float64(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.16) tmp = -th; elseif ((sin(ky) <= 4e-93) || (~((sin(ky) <= 5e-30)) && (sin(ky) <= 1e-11))) tmp = sin(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.16], (-th), If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 4e-93], And[N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 5e-30]], $MachinePrecision], LessEqual[N[Sin[ky], $MachinePrecision], 1e-11]]], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.16:\\
\;\;\;\;-th\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-93} \lor \neg \left(\sin ky \leq 5 \cdot 10^{-30}\right) \land \sin ky \leq 10^{-11}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.160000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 2.6%
expm1-log1p-u2.6%
expm1-undefine3.4%
Applied egg-rr3.4%
expm1-define2.6%
associate-*r/2.6%
associate-*l/2.6%
*-inverses2.6%
*-lft-identity2.6%
Simplified2.6%
expm1-undefine3.4%
log1p-undefine3.4%
rem-exp-log3.4%
+-commutative3.4%
Applied egg-rr3.4%
Taylor expanded in th around 0 4.3%
add-exp-log3.2%
expm1-define3.2%
log1p-define2.4%
add-sqr-sqrt1.6%
expm1-log1p-u1.6%
sqrt-unprod10.4%
pow210.4%
Applied egg-rr10.4%
Taylor expanded in th around -inf 35.6%
neg-mul-135.6%
Simplified35.6%
if -0.160000000000000003 < (sin.f64 ky) < 3.9999999999999996e-93 or 4.99999999999999972e-30 < (sin.f64 ky) < 9.99999999999999939e-12Initial program 84.5%
unpow284.5%
sqr-neg84.5%
sin-neg84.5%
sin-neg84.5%
unpow284.5%
associate-*l/81.2%
associate-/l*84.4%
unpow284.4%
Simplified99.6%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 50.5%
if 3.9999999999999996e-93 < (sin.f64 ky) < 4.99999999999999972e-30 or 9.99999999999999939e-12 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.6%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 57.7%
Final simplification49.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= (sin kx) -0.0638)
(* (/ (sin ky) t_1) th)
(if (<= (sin kx) 1e-7)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (<= (sin kx) 0.42)
(/ (* (sin ky) th) t_1)
(/ (sin ky) (* (sin kx) (/ 1.0 (sin th)))))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (sin(kx) <= -0.0638) {
tmp = (sin(ky) / t_1) * th;
} else if (sin(kx) <= 1e-7) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if (sin(kx) <= 0.42) {
tmp = (sin(ky) * th) / t_1;
} else {
tmp = sin(ky) / (sin(kx) * (1.0 / sin(th)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (Math.sin(kx) <= -0.0638) {
tmp = (Math.sin(ky) / t_1) * th;
} else if (Math.sin(kx) <= 1e-7) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(kx) <= 0.42) {
tmp = (Math.sin(ky) * th) / t_1;
} else {
tmp = Math.sin(ky) / (Math.sin(kx) * (1.0 / Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if math.sin(kx) <= -0.0638: tmp = (math.sin(ky) / t_1) * th elif math.sin(kx) <= 1e-7: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif math.sin(kx) <= 0.42: tmp = (math.sin(ky) * th) / t_1 else: tmp = math.sin(ky) / (math.sin(kx) * (1.0 / math.sin(th))) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (sin(kx) <= -0.0638) tmp = Float64(Float64(sin(ky) / t_1) * th); elseif (sin(kx) <= 1e-7) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (sin(kx) <= 0.42) tmp = Float64(Float64(sin(ky) * th) / t_1); else tmp = Float64(sin(ky) / Float64(sin(kx) * Float64(1.0 / sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (sin(kx) <= -0.0638) tmp = (sin(ky) / t_1) * th; elseif (sin(kx) <= 1e-7) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); elseif (sin(kx) <= 0.42) tmp = (sin(ky) * th) / t_1; else tmp = sin(ky) / (sin(kx) * (1.0 / sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.0638], N[(N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision] * th), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.42], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] * N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;\sin kx \leq -0.0638:\\
\;\;\;\;\frac{\sin ky}{t\_1} \cdot th\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.42:\\
\;\;\;\;\frac{\sin ky \cdot th}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx \cdot \frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.063799999999999996Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.3%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
associate-*r/99.4%
clear-num97.7%
*-commutative97.7%
Applied egg-rr97.7%
Taylor expanded in th around 0 49.4%
*-commutative49.4%
Simplified49.4%
associate-/r*49.4%
associate-/r/51.2%
clear-num51.2%
Applied egg-rr51.2%
if -0.063799999999999996 < (sin.f64 kx) < 9.9999999999999995e-8Initial program 86.5%
+-commutative86.5%
unpow286.5%
unpow286.5%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 98.3%
if 9.9999999999999995e-8 < (sin.f64 kx) < 0.419999999999999984Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.1%
associate-/l*99.5%
unpow299.5%
Simplified99.6%
associate-*r/99.3%
clear-num99.3%
*-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in th around 0 54.4%
*-commutative54.4%
Simplified54.4%
associate-/r*54.6%
associate-/r/54.6%
clear-num54.7%
Applied egg-rr54.7%
associate-*l/54.5%
Applied egg-rr54.5%
if 0.419999999999999984 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 61.7%
Final simplification75.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= (sin kx) -0.0638)
(* (/ (sin ky) t_1) th)
(if (<= (sin kx) 1e-7)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (<= (sin kx) 0.42)
(* (sin ky) (/ th t_1))
(/ (sin ky) (* (sin kx) (/ 1.0 (sin th)))))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (sin(kx) <= -0.0638) {
tmp = (sin(ky) / t_1) * th;
} else if (sin(kx) <= 1e-7) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if (sin(kx) <= 0.42) {
tmp = sin(ky) * (th / t_1);
} else {
tmp = sin(ky) / (sin(kx) * (1.0 / sin(th)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (Math.sin(kx) <= -0.0638) {
tmp = (Math.sin(ky) / t_1) * th;
} else if (Math.sin(kx) <= 1e-7) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(kx) <= 0.42) {
tmp = Math.sin(ky) * (th / t_1);
} else {
tmp = Math.sin(ky) / (Math.sin(kx) * (1.0 / Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if math.sin(kx) <= -0.0638: tmp = (math.sin(ky) / t_1) * th elif math.sin(kx) <= 1e-7: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif math.sin(kx) <= 0.42: tmp = math.sin(ky) * (th / t_1) else: tmp = math.sin(ky) / (math.sin(kx) * (1.0 / math.sin(th))) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (sin(kx) <= -0.0638) tmp = Float64(Float64(sin(ky) / t_1) * th); elseif (sin(kx) <= 1e-7) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (sin(kx) <= 0.42) tmp = Float64(sin(ky) * Float64(th / t_1)); else tmp = Float64(sin(ky) / Float64(sin(kx) * Float64(1.0 / sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (sin(kx) <= -0.0638) tmp = (sin(ky) / t_1) * th; elseif (sin(kx) <= 1e-7) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); elseif (sin(kx) <= 0.42) tmp = sin(ky) * (th / t_1); else tmp = sin(ky) / (sin(kx) * (1.0 / sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.0638], N[(N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision] * th), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.42], N[(N[Sin[ky], $MachinePrecision] * N[(th / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] * N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;\sin kx \leq -0.0638:\\
\;\;\;\;\frac{\sin ky}{t\_1} \cdot th\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.42:\\
\;\;\;\;\sin ky \cdot \frac{th}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx \cdot \frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.063799999999999996Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.3%
associate-/l*99.5%
unpow299.5%
Simplified99.4%
associate-*r/99.4%
clear-num97.7%
*-commutative97.7%
Applied egg-rr97.7%
Taylor expanded in th around 0 49.4%
*-commutative49.4%
Simplified49.4%
associate-/r*49.4%
associate-/r/51.2%
clear-num51.2%
Applied egg-rr51.2%
if -0.063799999999999996 < (sin.f64 kx) < 9.9999999999999995e-8Initial program 86.5%
+-commutative86.5%
unpow286.5%
unpow286.5%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 98.3%
if 9.9999999999999995e-8 < (sin.f64 kx) < 0.419999999999999984Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/99.1%
associate-/l*99.5%
unpow299.5%
Simplified99.6%
associate-*r/99.3%
clear-num99.3%
*-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in th around 0 54.4%
*-commutative54.4%
Simplified54.4%
*-un-lft-identity54.4%
associate-/r*54.6%
associate-/r/54.6%
clear-num54.7%
Applied egg-rr54.7%
*-lft-identity54.7%
associate-*l/54.5%
associate-*r/54.7%
Simplified54.7%
if 0.419999999999999984 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 61.7%
Final simplification75.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* (sin ky) (/ th (hypot (sin ky) (sin kx))))))
(if (<= (sin kx) -0.0638)
t_1
(if (<= (sin kx) 1e-7)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(if (<= (sin kx) 0.42)
t_1
(/ (sin ky) (* (sin kx) (/ 1.0 (sin th)))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) * (th / hypot(sin(ky), sin(kx)));
double tmp;
if (sin(kx) <= -0.0638) {
tmp = t_1;
} else if (sin(kx) <= 1e-7) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else if (sin(kx) <= 0.42) {
tmp = t_1;
} else {
tmp = sin(ky) / (sin(kx) * (1.0 / sin(th)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
double tmp;
if (Math.sin(kx) <= -0.0638) {
tmp = t_1;
} else if (Math.sin(kx) <= 1e-7) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(kx) <= 0.42) {
tmp = t_1;
} else {
tmp = Math.sin(ky) / (Math.sin(kx) * (1.0 / Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) tmp = 0 if math.sin(kx) <= -0.0638: tmp = t_1 elif math.sin(kx) <= 1e-7: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif math.sin(kx) <= 0.42: tmp = t_1 else: tmp = math.sin(ky) / (math.sin(kx) * (1.0 / math.sin(th))) return tmp
function code(kx, ky, th) t_1 = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))) tmp = 0.0 if (sin(kx) <= -0.0638) tmp = t_1; elseif (sin(kx) <= 1e-7) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (sin(kx) <= 0.42) tmp = t_1; else tmp = Float64(sin(ky) / Float64(sin(kx) * Float64(1.0 / sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(ky) * (th / hypot(sin(ky), sin(kx))); tmp = 0.0; if (sin(kx) <= -0.0638) tmp = t_1; elseif (sin(kx) <= 1e-7) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); elseif (sin(kx) <= 0.42) tmp = t_1; else tmp = sin(ky) / (sin(kx) * (1.0 / sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = 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[kx], $MachinePrecision], -0.0638], t$95$1, If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-7], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.42], t$95$1, N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] * N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{if}\;\sin kx \leq -0.0638:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.42:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx \cdot \frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.063799999999999996 or 9.9999999999999995e-8 < (sin.f64 kx) < 0.419999999999999984Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.3%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.3%
clear-num98.0%
*-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in th around 0 50.5%
*-commutative50.5%
Simplified50.5%
*-un-lft-identity50.5%
associate-/r*50.5%
associate-/r/51.9%
clear-num52.0%
Applied egg-rr52.0%
*-lft-identity52.0%
associate-*l/51.8%
associate-*r/51.9%
Simplified51.9%
if -0.063799999999999996 < (sin.f64 kx) < 9.9999999999999995e-8Initial program 86.5%
+-commutative86.5%
unpow286.5%
unpow286.5%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 98.3%
if 0.419999999999999984 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 61.7%
Final simplification75.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* (sin ky) (/ th (hypot (sin ky) (sin kx))))))
(if (<= (sin kx) -0.0638)
t_1
(if (<= (sin kx) 1e-7)
(* (sin ky) (/ (sin th) (hypot (sin ky) kx)))
(if (<= (sin kx) 0.42)
t_1
(/ (sin ky) (* (sin kx) (/ 1.0 (sin th)))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(ky) * (th / hypot(sin(ky), sin(kx)));
double tmp;
if (sin(kx) <= -0.0638) {
tmp = t_1;
} else if (sin(kx) <= 1e-7) {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
} else if (sin(kx) <= 0.42) {
tmp = t_1;
} else {
tmp = sin(ky) / (sin(kx) * (1.0 / sin(th)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
double tmp;
if (Math.sin(kx) <= -0.0638) {
tmp = t_1;
} else if (Math.sin(kx) <= 1e-7) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(kx) <= 0.42) {
tmp = t_1;
} else {
tmp = Math.sin(ky) / (Math.sin(kx) * (1.0 / Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) tmp = 0 if math.sin(kx) <= -0.0638: tmp = t_1 elif math.sin(kx) <= 1e-7: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) elif math.sin(kx) <= 0.42: tmp = t_1 else: tmp = math.sin(ky) / (math.sin(kx) * (1.0 / math.sin(th))) return tmp
function code(kx, ky, th) t_1 = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))) tmp = 0.0 if (sin(kx) <= -0.0638) tmp = t_1; elseif (sin(kx) <= 1e-7) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); elseif (sin(kx) <= 0.42) tmp = t_1; else tmp = Float64(sin(ky) / Float64(sin(kx) * Float64(1.0 / sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(ky) * (th / hypot(sin(ky), sin(kx))); tmp = 0.0; if (sin(kx) <= -0.0638) tmp = t_1; elseif (sin(kx) <= 1e-7) tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); elseif (sin(kx) <= 0.42) tmp = t_1; else tmp = sin(ky) / (sin(kx) * (1.0 / sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = 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[kx], $MachinePrecision], -0.0638], t$95$1, If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-7], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 0.42], t$95$1, N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] * N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{if}\;\sin kx \leq -0.0638:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\sin kx \leq 10^{-7}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin kx \leq 0.42:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\sin kx \cdot \frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.063799999999999996 or 9.9999999999999995e-8 < (sin.f64 kx) < 0.419999999999999984Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.3%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
associate-*r/99.3%
clear-num98.0%
*-commutative98.0%
Applied egg-rr98.0%
Taylor expanded in th around 0 50.5%
*-commutative50.5%
Simplified50.5%
*-un-lft-identity50.5%
associate-/r*50.5%
associate-/r/51.9%
clear-num52.0%
Applied egg-rr52.0%
*-lft-identity52.0%
associate-*l/51.8%
associate-*r/51.9%
Simplified51.9%
if -0.063799999999999996 < (sin.f64 kx) < 9.9999999999999995e-8Initial program 86.5%
unpow286.5%
sqr-neg86.5%
sin-neg86.5%
sin-neg86.5%
unpow286.5%
associate-*l/83.0%
associate-/l*86.5%
unpow286.5%
Simplified99.8%
Taylor expanded in kx around 0 98.2%
if 0.419999999999999984 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.6%
Applied egg-rr99.6%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 61.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ 1.0 (/ (fabs (sin kx)) (* ky (sin th))))))
(if (<= (sin th) -0.54)
t_1
(if (<= (sin th) 1e-9)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= (sin th) 0.77)
t_1
(* (sin ky) (fabs (/ (sin th) (sin ky)))))))))
double code(double kx, double ky, double th) {
double t_1 = 1.0 / (fabs(sin(kx)) / (ky * sin(th)));
double tmp;
if (sin(th) <= -0.54) {
tmp = t_1;
} else if (sin(th) <= 1e-9) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (sin(th) <= 0.77) {
tmp = t_1;
} else {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = 1.0 / (Math.abs(Math.sin(kx)) / (ky * Math.sin(th)));
double tmp;
if (Math.sin(th) <= -0.54) {
tmp = t_1;
} else if (Math.sin(th) <= 1e-9) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (Math.sin(th) <= 0.77) {
tmp = t_1;
} else {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): t_1 = 1.0 / (math.fabs(math.sin(kx)) / (ky * math.sin(th))) tmp = 0 if math.sin(th) <= -0.54: tmp = t_1 elif math.sin(th) <= 1e-9: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif math.sin(th) <= 0.77: tmp = t_1 else: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) return tmp
function code(kx, ky, th) t_1 = Float64(1.0 / Float64(abs(sin(kx)) / Float64(ky * sin(th)))) tmp = 0.0 if (sin(th) <= -0.54) tmp = t_1; elseif (sin(th) <= 1e-9) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (sin(th) <= 0.77) tmp = t_1; else tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = 1.0 / (abs(sin(kx)) / (ky * sin(th))); tmp = 0.0; if (sin(th) <= -0.54) tmp = t_1; elseif (sin(th) <= 1e-9) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (sin(th) <= 0.77) tmp = t_1; else tmp = sin(ky) * abs((sin(th) / sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(1.0 / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[th], $MachinePrecision], -0.54], t$95$1, If[LessEqual[N[Sin[th], $MachinePrecision], 1e-9], 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[th], $MachinePrecision], 0.77], t$95$1, N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{\left|\sin kx\right|}{ky \cdot \sin th}}\\
\mathbf{if}\;\sin th \leq -0.54:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\sin th \leq 10^{-9}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;\sin th \leq 0.77:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.54000000000000004 or 1.00000000000000006e-9 < (sin.f64 th) < 0.77000000000000002Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/93.8%
associate-/l*93.8%
unpow293.8%
Simplified99.5%
associate-*r/99.5%
clear-num99.4%
*-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 20.6%
add-sqr-sqrt18.6%
sqrt-prod36.7%
rem-sqrt-square41.3%
Applied egg-rr41.3%
if -0.54000000000000004 < (sin.f64 th) < 1.00000000000000006e-9Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/90.4%
associate-/l*93.1%
unpow293.1%
Simplified99.7%
associate-*r/92.9%
clear-num91.5%
*-commutative91.5%
Applied egg-rr91.5%
Taylor expanded in th around 0 79.9%
*-commutative79.9%
Simplified79.9%
*-un-lft-identity79.9%
associate-/r*86.2%
associate-/r/88.0%
clear-num88.1%
Applied egg-rr88.1%
*-lft-identity88.1%
associate-*l/81.3%
associate-*r/88.0%
Simplified88.0%
if 0.77000000000000002 < (sin.f64 th) Initial program 93.3%
unpow293.3%
sqr-neg93.3%
sin-neg93.3%
sin-neg93.3%
unpow293.3%
associate-*l/93.3%
associate-/l*93.3%
unpow293.3%
Simplified99.5%
Taylor expanded in kx around 0 20.9%
add-sqr-sqrt19.9%
sqrt-unprod37.5%
pow237.5%
Applied egg-rr37.5%
unpow237.5%
rem-sqrt-square41.3%
Simplified41.3%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.16)
(- th)
(if (<= (sin ky) 4e-93)
(* (sin th) (/ (sin ky) (sin kx)))
(if (or (<= (sin ky) 5e-30) (not (<= (sin ky) 2e-29)))
(sin th)
(* ky (/ (sin th) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.16) {
tmp = -th;
} else if (sin(ky) <= 4e-93) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if ((sin(ky) <= 5e-30) || !(sin(ky) <= 2e-29)) {
tmp = sin(th);
} else {
tmp = ky * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.16d0)) then
tmp = -th
else if (sin(ky) <= 4d-93) then
tmp = sin(th) * (sin(ky) / sin(kx))
else if ((sin(ky) <= 5d-30) .or. (.not. (sin(ky) <= 2d-29))) then
tmp = sin(th)
else
tmp = ky * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.16) {
tmp = -th;
} else if (Math.sin(ky) <= 4e-93) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if ((Math.sin(ky) <= 5e-30) || !(Math.sin(ky) <= 2e-29)) {
tmp = Math.sin(th);
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.16: tmp = -th elif math.sin(ky) <= 4e-93: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) elif (math.sin(ky) <= 5e-30) or not (math.sin(ky) <= 2e-29): tmp = math.sin(th) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.16) tmp = Float64(-th); elseif (sin(ky) <= 4e-93) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif ((sin(ky) <= 5e-30) || !(sin(ky) <= 2e-29)) tmp = sin(th); else tmp = Float64(ky * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.16) tmp = -th; elseif (sin(ky) <= 4e-93) tmp = sin(th) * (sin(ky) / sin(kx)); elseif ((sin(ky) <= 5e-30) || ~((sin(ky) <= 2e-29))) tmp = sin(th); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.16], (-th), If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-93], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 5e-30], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 2e-29]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.16:\\
\;\;\;\;-th\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-93}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-30} \lor \neg \left(\sin ky \leq 2 \cdot 10^{-29}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.160000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 2.6%
expm1-log1p-u2.6%
expm1-undefine3.4%
Applied egg-rr3.4%
expm1-define2.6%
associate-*r/2.6%
associate-*l/2.6%
*-inverses2.6%
*-lft-identity2.6%
Simplified2.6%
expm1-undefine3.4%
log1p-undefine3.4%
rem-exp-log3.4%
+-commutative3.4%
Applied egg-rr3.4%
Taylor expanded in th around 0 4.3%
add-exp-log3.2%
expm1-define3.2%
log1p-define2.4%
add-sqr-sqrt1.6%
expm1-log1p-u1.6%
sqrt-unprod10.4%
pow210.4%
Applied egg-rr10.4%
Taylor expanded in th around -inf 35.6%
neg-mul-135.6%
Simplified35.6%
if -0.160000000000000003 < (sin.f64 ky) < 3.9999999999999996e-93Initial program 84.0%
+-commutative84.0%
unpow284.0%
unpow284.0%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 50.8%
if 3.9999999999999996e-93 < (sin.f64 ky) < 4.99999999999999972e-30 or 1.99999999999999989e-29 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.6%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 58.1%
if 4.99999999999999972e-30 < (sin.f64 ky) < 1.99999999999999989e-29Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.6%
associate-/l*93.3%
unpow293.3%
Simplified99.6%
Taylor expanded in ky around 0 20.4%
associate-/l*22.2%
Simplified22.2%
Final simplification50.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin ky) -0.16)
(- th)
(if (<= (sin ky) 4e-93)
(* (sin ky) t_1)
(if (or (<= (sin ky) 5e-30) (not (<= (sin ky) 2e-29)))
(sin th)
(* ky t_1))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(ky) <= -0.16) {
tmp = -th;
} else if (sin(ky) <= 4e-93) {
tmp = sin(ky) * t_1;
} else if ((sin(ky) <= 5e-30) || !(sin(ky) <= 2e-29)) {
tmp = sin(th);
} else {
tmp = 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(ky) <= (-0.16d0)) then
tmp = -th
else if (sin(ky) <= 4d-93) then
tmp = sin(ky) * t_1
else if ((sin(ky) <= 5d-30) .or. (.not. (sin(ky) <= 2d-29))) then
tmp = sin(th)
else
tmp = 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(ky) <= -0.16) {
tmp = -th;
} else if (Math.sin(ky) <= 4e-93) {
tmp = Math.sin(ky) * t_1;
} else if ((Math.sin(ky) <= 5e-30) || !(Math.sin(ky) <= 2e-29)) {
tmp = Math.sin(th);
} else {
tmp = ky * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(ky) <= -0.16: tmp = -th elif math.sin(ky) <= 4e-93: tmp = math.sin(ky) * t_1 elif (math.sin(ky) <= 5e-30) or not (math.sin(ky) <= 2e-29): tmp = math.sin(th) else: tmp = ky * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(ky) <= -0.16) tmp = Float64(-th); elseif (sin(ky) <= 4e-93) tmp = Float64(sin(ky) * t_1); elseif ((sin(ky) <= 5e-30) || !(sin(ky) <= 2e-29)) tmp = sin(th); else tmp = Float64(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(ky) <= -0.16) tmp = -th; elseif (sin(ky) <= 4e-93) tmp = sin(ky) * t_1; elseif ((sin(ky) <= 5e-30) || ~((sin(ky) <= 2e-29))) tmp = sin(th); else tmp = 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[ky], $MachinePrecision], -0.16], (-th), If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-93], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 5e-30], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 2e-29]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin ky \leq -0.16:\\
\;\;\;\;-th\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-93}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-30} \lor \neg \left(\sin ky \leq 2 \cdot 10^{-29}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.160000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 2.6%
expm1-log1p-u2.6%
expm1-undefine3.4%
Applied egg-rr3.4%
expm1-define2.6%
associate-*r/2.6%
associate-*l/2.6%
*-inverses2.6%
*-lft-identity2.6%
Simplified2.6%
expm1-undefine3.4%
log1p-undefine3.4%
rem-exp-log3.4%
+-commutative3.4%
Applied egg-rr3.4%
Taylor expanded in th around 0 4.3%
add-exp-log3.2%
expm1-define3.2%
log1p-define2.4%
add-sqr-sqrt1.6%
expm1-log1p-u1.6%
sqrt-unprod10.4%
pow210.4%
Applied egg-rr10.4%
Taylor expanded in th around -inf 35.6%
neg-mul-135.6%
Simplified35.6%
if -0.160000000000000003 < (sin.f64 ky) < 3.9999999999999996e-93Initial program 84.0%
unpow284.0%
sqr-neg84.0%
sin-neg84.0%
sin-neg84.0%
unpow284.0%
associate-*l/80.7%
associate-/l*83.9%
unpow283.9%
Simplified99.6%
Taylor expanded in ky around 0 50.8%
if 3.9999999999999996e-93 < (sin.f64 ky) < 4.99999999999999972e-30 or 1.99999999999999989e-29 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.6%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 58.1%
if 4.99999999999999972e-30 < (sin.f64 ky) < 1.99999999999999989e-29Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.6%
associate-/l*93.3%
unpow293.3%
Simplified99.6%
Taylor expanded in ky around 0 20.4%
associate-/l*22.2%
Simplified22.2%
Final simplification50.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.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.6%
associate-/l*93.3%
unpow293.3%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= ky 0.00033)
(/ (sin th) (* t_1 (/ 1.0 ky)))
(if (<= ky 1.02e+111)
(* (sin ky) (/ th t_1))
(if (<= ky 2.7e+188)
(* (sin th) (/ (sin ky) (hypot (sin ky) kx)))
(* (/ (sin ky) t_1) th))))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (ky <= 0.00033) {
tmp = sin(th) / (t_1 * (1.0 / ky));
} else if (ky <= 1.02e+111) {
tmp = sin(ky) * (th / t_1);
} else if (ky <= 2.7e+188) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = (sin(ky) / t_1) * th;
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (ky <= 0.00033) {
tmp = Math.sin(th) / (t_1 * (1.0 / ky));
} else if (ky <= 1.02e+111) {
tmp = Math.sin(ky) * (th / t_1);
} else if (ky <= 2.7e+188) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = (Math.sin(ky) / t_1) * th;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if ky <= 0.00033: tmp = math.sin(th) / (t_1 * (1.0 / ky)) elif ky <= 1.02e+111: tmp = math.sin(ky) * (th / t_1) elif ky <= 2.7e+188: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) else: tmp = (math.sin(ky) / t_1) * th return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (ky <= 0.00033) tmp = Float64(sin(th) / Float64(t_1 * Float64(1.0 / ky))); elseif (ky <= 1.02e+111) tmp = Float64(sin(ky) * Float64(th / t_1)); elseif (ky <= 2.7e+188) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(Float64(sin(ky) / t_1) * th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (ky <= 0.00033) tmp = sin(th) / (t_1 * (1.0 / ky)); elseif (ky <= 1.02e+111) tmp = sin(ky) * (th / t_1); elseif (ky <= 2.7e+188) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); else tmp = (sin(ky) / t_1) * th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[ky, 0.00033], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 * N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 1.02e+111], N[(N[Sin[ky], $MachinePrecision] * N[(th / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 2.7e+188], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] / t$95$1), $MachinePrecision] * th), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;ky \leq 0.00033:\\
\;\;\;\;\frac{\sin th}{t\_1 \cdot \frac{1}{ky}}\\
\mathbf{elif}\;ky \leq 1.02 \cdot 10^{+111}:\\
\;\;\;\;\sin ky \cdot \frac{th}{t\_1}\\
\mathbf{elif}\;ky \leq 2.7 \cdot 10^{+188}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{t\_1} \cdot th\\
\end{array}
\end{array}
if ky < 3.3e-4Initial program 91.1%
+-commutative91.1%
unpow291.1%
unpow291.1%
hypot-undefine99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0 59.5%
if 3.3e-4 < ky < 1.02e111Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
associate-*r/99.6%
clear-num97.2%
*-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in th around 0 65.0%
*-commutative65.0%
Simplified65.0%
*-un-lft-identity65.0%
associate-/r*65.0%
associate-/r/67.6%
clear-num67.6%
Applied egg-rr67.6%
*-lft-identity67.6%
associate-*l/67.5%
associate-*r/67.5%
Simplified67.5%
if 1.02e111 < ky < 2.7e188Initial program 99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 45.1%
if 2.7e188 < 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.7%
unpow299.7%
Simplified99.6%
associate-*r/99.6%
clear-num99.2%
*-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in th around 0 65.2%
*-commutative65.2%
Simplified65.2%
associate-/r*65.2%
associate-/r/65.3%
clear-num65.4%
Applied egg-rr65.4%
Final simplification60.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.2e-84) (/ 1.0 (/ (fabs (sin kx)) (* ky (sin th)))) (if (<= ky 1.6e-35) (sin th) (* (sin ky) (fabs (/ (sin th) (sin ky)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.2e-84) {
tmp = 1.0 / (fabs(sin(kx)) / (ky * sin(th)));
} else if (ky <= 1.6e-35) {
tmp = sin(th);
} else {
tmp = sin(ky) * fabs((sin(th) / 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 <= 1.2d-84) then
tmp = 1.0d0 / (abs(sin(kx)) / (ky * sin(th)))
else if (ky <= 1.6d-35) then
tmp = sin(th)
else
tmp = sin(ky) * abs((sin(th) / sin(ky)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.2e-84) {
tmp = 1.0 / (Math.abs(Math.sin(kx)) / (ky * Math.sin(th)));
} else if (ky <= 1.6e-35) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.2e-84: tmp = 1.0 / (math.fabs(math.sin(kx)) / (ky * math.sin(th))) elif ky <= 1.6e-35: tmp = math.sin(th) else: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.2e-84) tmp = Float64(1.0 / Float64(abs(sin(kx)) / Float64(ky * sin(th)))); elseif (ky <= 1.6e-35) tmp = sin(th); else tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.2e-84) tmp = 1.0 / (abs(sin(kx)) / (ky * sin(th))); elseif (ky <= 1.6e-35) tmp = sin(th); else tmp = sin(ky) * abs((sin(th) / sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.2e-84], N[(1.0 / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 1.6e-35], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{1}{\frac{\left|\sin kx\right|}{ky \cdot \sin th}}\\
\mathbf{elif}\;ky \leq 1.6 \cdot 10^{-35}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\end{array}
\end{array}
if ky < 1.20000000000000009e-84Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/88.3%
associate-/l*90.3%
unpow290.3%
Simplified99.6%
associate-*r/94.0%
clear-num93.1%
*-commutative93.1%
Applied egg-rr93.1%
Taylor expanded in ky around 0 28.1%
add-sqr-sqrt21.3%
sqrt-prod39.4%
rem-sqrt-square43.6%
Applied egg-rr43.6%
if 1.20000000000000009e-84 < ky < 1.5999999999999999e-35Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/89.7%
associate-/l*99.8%
unpow299.8%
Simplified99.8%
Taylor expanded in kx around 0 79.3%
if 1.5999999999999999e-35 < 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 35.3%
add-sqr-sqrt21.0%
sqrt-unprod31.1%
pow231.1%
Applied egg-rr31.1%
unpow231.1%
rem-sqrt-square40.4%
Simplified40.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.116) (- th) (if (<= (sin ky) 4e-93) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.116) {
tmp = -th;
} else if (sin(ky) <= 4e-93) {
tmp = sin(th) * (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.116d0)) then
tmp = -th
else if (sin(ky) <= 4d-93) then
tmp = sin(th) * (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.116) {
tmp = -th;
} else if (Math.sin(ky) <= 4e-93) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.116: tmp = -th elif math.sin(ky) <= 4e-93: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.116) tmp = Float64(-th); elseif (sin(ky) <= 4e-93) tmp = Float64(sin(th) * 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.116) tmp = -th; elseif (sin(ky) <= 4e-93) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.116], (-th), If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-93], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.116:\\
\;\;\;\;-th\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-93}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.116000000000000006Initial 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.5%
Taylor expanded in kx around 0 2.6%
expm1-log1p-u2.6%
expm1-undefine3.4%
Applied egg-rr3.4%
expm1-define2.6%
associate-*r/2.6%
associate-*l/2.6%
*-inverses2.6%
*-lft-identity2.6%
Simplified2.6%
expm1-undefine3.4%
log1p-undefine3.4%
rem-exp-log3.4%
+-commutative3.4%
Applied egg-rr3.4%
Taylor expanded in th around 0 4.3%
add-exp-log3.2%
expm1-define3.2%
log1p-define2.4%
add-sqr-sqrt1.6%
expm1-log1p-u1.6%
sqrt-unprod10.1%
pow210.1%
Applied egg-rr10.1%
Taylor expanded in th around -inf 36.1%
neg-mul-136.1%
Simplified36.1%
if -0.116000000000000006 < (sin.f64 ky) < 3.9999999999999996e-93Initial program 83.7%
Taylor expanded in ky around 0 50.8%
if 3.9999999999999996e-93 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.6%
associate-/l*99.7%
unpow299.7%
Simplified99.7%
Taylor expanded in kx around 0 58.1%
Final simplification50.0%
(FPCore (kx ky th)
:precision binary64
(if (<= th 135000.0)
(* th (/ (sin ky) (hypot (sin ky) kx)))
(if (<= th 3.8e+161)
(/ 1.0 (/ (fabs (sin kx)) (* ky (sin th))))
(if (<= th 2.7e+218) (sin th) (* (sin ky) (/ (sin th) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 135000.0) {
tmp = th * (sin(ky) / hypot(sin(ky), kx));
} else if (th <= 3.8e+161) {
tmp = 1.0 / (fabs(sin(kx)) / (ky * sin(th)));
} else if (th <= 2.7e+218) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 135000.0) {
tmp = th * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if (th <= 3.8e+161) {
tmp = 1.0 / (Math.abs(Math.sin(kx)) / (ky * Math.sin(th)));
} else if (th <= 2.7e+218) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 135000.0: tmp = th * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif th <= 3.8e+161: tmp = 1.0 / (math.fabs(math.sin(kx)) / (ky * math.sin(th))) elif th <= 2.7e+218: tmp = math.sin(th) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 135000.0) tmp = Float64(th * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (th <= 3.8e+161) tmp = Float64(1.0 / Float64(abs(sin(kx)) / Float64(ky * sin(th)))); elseif (th <= 2.7e+218) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 135000.0) tmp = th * (sin(ky) / hypot(sin(ky), kx)); elseif (th <= 3.8e+161) tmp = 1.0 / (abs(sin(kx)) / (ky * sin(th))); elseif (th <= 2.7e+218) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 135000.0], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 3.8e+161], N[(1.0 / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 2.7e+218], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 135000:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;th \leq 3.8 \cdot 10^{+161}:\\
\;\;\;\;\frac{1}{\frac{\left|\sin kx\right|}{ky \cdot \sin th}}\\
\mathbf{elif}\;th \leq 2.7 \cdot 10^{+218}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if th < 135000Initial program 93.8%
unpow293.8%
sqr-neg93.8%
sin-neg93.8%
sin-neg93.8%
unpow293.8%
associate-*l/91.5%
associate-/l*93.8%
unpow293.8%
Simplified99.7%
associate-*r/94.1%
clear-num92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in th around 0 66.5%
*-commutative66.5%
Simplified66.5%
associate-/r*71.7%
associate-/r/73.2%
clear-num73.3%
Applied egg-rr73.3%
Taylor expanded in kx around 0 46.9%
if 135000 < th < 3.8000000000000002e161Initial program 93.3%
unpow293.3%
sqr-neg93.3%
sin-neg93.3%
sin-neg93.3%
unpow293.3%
associate-*l/93.1%
associate-/l*93.0%
unpow293.0%
Simplified99.4%
associate-*r/99.5%
clear-num99.3%
*-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in ky around 0 18.7%
add-sqr-sqrt17.3%
sqrt-prod43.8%
rem-sqrt-square50.4%
Applied egg-rr50.4%
if 3.8000000000000002e161 < th < 2.70000000000000013e218Initial program 92.2%
unpow292.2%
sqr-neg92.2%
sin-neg92.2%
sin-neg92.2%
unpow292.2%
associate-*l/92.1%
associate-/l*92.2%
unpow292.2%
Simplified99.6%
Taylor expanded in kx around 0 23.4%
if 2.70000000000000013e218 < th Initial program 90.0%
unpow290.0%
sqr-neg90.0%
sin-neg90.0%
sin-neg90.0%
unpow290.0%
associate-*l/90.0%
associate-/l*90.2%
unpow290.2%
Simplified99.4%
Taylor expanded in ky around 0 33.0%
Final simplification44.9%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (fabs (sin th))) (t_2 (* ky (/ (sin th) (sin kx)))))
(if (<= ky 2e-85)
t_2
(if (<= ky 4.9e-30)
(sin th)
(if (<= ky 1.75e-8)
t_2
(if (<= ky 9e+98)
t_1
(if (<= ky 6.1e+134)
(sin th)
(if (<= ky 4.8e+166)
t_1
(if (<= ky 2.7e+205)
(- th)
(if (<= ky 4.4e+223)
t_1
(if (<= ky 9.8e+275) (- th) (sin th))))))))))))
double code(double kx, double ky, double th) {
double t_1 = fabs(sin(th));
double t_2 = ky * (sin(th) / sin(kx));
double tmp;
if (ky <= 2e-85) {
tmp = t_2;
} else if (ky <= 4.9e-30) {
tmp = sin(th);
} else if (ky <= 1.75e-8) {
tmp = t_2;
} else if (ky <= 9e+98) {
tmp = t_1;
} else if (ky <= 6.1e+134) {
tmp = sin(th);
} else if (ky <= 4.8e+166) {
tmp = t_1;
} else if (ky <= 2.7e+205) {
tmp = -th;
} else if (ky <= 4.4e+223) {
tmp = t_1;
} else if (ky <= 9.8e+275) {
tmp = -th;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = abs(sin(th))
t_2 = ky * (sin(th) / sin(kx))
if (ky <= 2d-85) then
tmp = t_2
else if (ky <= 4.9d-30) then
tmp = sin(th)
else if (ky <= 1.75d-8) then
tmp = t_2
else if (ky <= 9d+98) then
tmp = t_1
else if (ky <= 6.1d+134) then
tmp = sin(th)
else if (ky <= 4.8d+166) then
tmp = t_1
else if (ky <= 2.7d+205) then
tmp = -th
else if (ky <= 4.4d+223) then
tmp = t_1
else if (ky <= 9.8d+275) then
tmp = -th
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.abs(Math.sin(th));
double t_2 = ky * (Math.sin(th) / Math.sin(kx));
double tmp;
if (ky <= 2e-85) {
tmp = t_2;
} else if (ky <= 4.9e-30) {
tmp = Math.sin(th);
} else if (ky <= 1.75e-8) {
tmp = t_2;
} else if (ky <= 9e+98) {
tmp = t_1;
} else if (ky <= 6.1e+134) {
tmp = Math.sin(th);
} else if (ky <= 4.8e+166) {
tmp = t_1;
} else if (ky <= 2.7e+205) {
tmp = -th;
} else if (ky <= 4.4e+223) {
tmp = t_1;
} else if (ky <= 9.8e+275) {
tmp = -th;
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.fabs(math.sin(th)) t_2 = ky * (math.sin(th) / math.sin(kx)) tmp = 0 if ky <= 2e-85: tmp = t_2 elif ky <= 4.9e-30: tmp = math.sin(th) elif ky <= 1.75e-8: tmp = t_2 elif ky <= 9e+98: tmp = t_1 elif ky <= 6.1e+134: tmp = math.sin(th) elif ky <= 4.8e+166: tmp = t_1 elif ky <= 2.7e+205: tmp = -th elif ky <= 4.4e+223: tmp = t_1 elif ky <= 9.8e+275: tmp = -th else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = abs(sin(th)) t_2 = Float64(ky * Float64(sin(th) / sin(kx))) tmp = 0.0 if (ky <= 2e-85) tmp = t_2; elseif (ky <= 4.9e-30) tmp = sin(th); elseif (ky <= 1.75e-8) tmp = t_2; elseif (ky <= 9e+98) tmp = t_1; elseif (ky <= 6.1e+134) tmp = sin(th); elseif (ky <= 4.8e+166) tmp = t_1; elseif (ky <= 2.7e+205) tmp = Float64(-th); elseif (ky <= 4.4e+223) tmp = t_1; elseif (ky <= 9.8e+275) tmp = Float64(-th); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = abs(sin(th)); t_2 = ky * (sin(th) / sin(kx)); tmp = 0.0; if (ky <= 2e-85) tmp = t_2; elseif (ky <= 4.9e-30) tmp = sin(th); elseif (ky <= 1.75e-8) tmp = t_2; elseif (ky <= 9e+98) tmp = t_1; elseif (ky <= 6.1e+134) tmp = sin(th); elseif (ky <= 4.8e+166) tmp = t_1; elseif (ky <= 2.7e+205) tmp = -th; elseif (ky <= 4.4e+223) tmp = t_1; elseif (ky <= 9.8e+275) tmp = -th; else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[ky, 2e-85], t$95$2, If[LessEqual[ky, 4.9e-30], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 1.75e-8], t$95$2, If[LessEqual[ky, 9e+98], t$95$1, If[LessEqual[ky, 6.1e+134], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 4.8e+166], t$95$1, If[LessEqual[ky, 2.7e+205], (-th), If[LessEqual[ky, 4.4e+223], t$95$1, If[LessEqual[ky, 9.8e+275], (-th), N[Sin[th], $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin th\right|\\
t_2 := ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{if}\;ky \leq 2 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ky \leq 4.9 \cdot 10^{-30}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.75 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;ky \leq 9 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ky \leq 6.1 \cdot 10^{+134}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 4.8 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ky \leq 2.7 \cdot 10^{+205}:\\
\;\;\;\;-th\\
\mathbf{elif}\;ky \leq 4.4 \cdot 10^{+223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;ky \leq 9.8 \cdot 10^{+275}:\\
\;\;\;\;-th\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2e-85 or 4.89999999999999971e-30 < ky < 1.75000000000000012e-8Initial program 90.5%
unpow290.5%
sqr-neg90.5%
sin-neg90.5%
sin-neg90.5%
unpow290.5%
associate-*l/88.5%
associate-/l*90.4%
unpow290.4%
Simplified99.6%
Taylor expanded in ky around 0 28.3%
associate-/l*31.0%
Simplified31.0%
if 2e-85 < ky < 4.89999999999999971e-30 or 9.0000000000000004e98 < ky < 6.09999999999999978e134 or 9.7999999999999996e275 < ky Initial program 99.9%
unpow299.9%
sqr-neg99.9%
sin-neg99.9%
sin-neg99.9%
unpow299.9%
associate-*l/96.8%
associate-/l*99.8%
unpow299.8%
Simplified99.8%
Taylor expanded in kx around 0 57.3%
if 1.75000000000000012e-8 < ky < 9.0000000000000004e98 or 6.09999999999999978e134 < ky < 4.79999999999999984e166 or 2.70000000000000012e205 < ky < 4.3999999999999999e223Initial 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 33.3%
add-sqr-sqrt18.2%
sqrt-unprod22.4%
pow222.4%
Applied egg-rr22.4%
unpow222.4%
rem-sqrt-square27.8%
associate-*r/27.7%
associate-*l/27.8%
*-inverses27.8%
*-lft-identity27.8%
Simplified27.8%
if 4.79999999999999984e166 < ky < 2.70000000000000012e205 or 4.3999999999999999e223 < ky < 9.7999999999999996e275Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.3%
associate-/l*99.4%
unpow299.4%
Simplified99.3%
Taylor expanded in kx around 0 13.8%
expm1-log1p-u13.7%
expm1-undefine12.2%
Applied egg-rr12.2%
expm1-define13.7%
associate-*r/13.7%
associate-*l/13.7%
*-inverses13.7%
*-lft-identity13.7%
Simplified13.7%
expm1-undefine12.2%
log1p-undefine12.2%
rem-exp-log12.2%
+-commutative12.2%
Applied egg-rr12.2%
Taylor expanded in th around 0 4.9%
add-exp-log4.4%
expm1-define4.4%
log1p-define5.8%
add-sqr-sqrt3.8%
expm1-log1p-u3.8%
sqrt-unprod11.5%
pow211.5%
Applied egg-rr11.5%
Taylor expanded in th around -inf 39.7%
neg-mul-139.7%
Simplified39.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 7e-153) (* ky (/ (sin th) kx)) (if (or (<= ky 8.2e+158) (not (<= ky 4.8e+201))) (sin th) (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-153) {
tmp = ky * (sin(th) / kx);
} else if ((ky <= 8.2e+158) || !(ky <= 4.8e+201)) {
tmp = sin(th);
} 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 <= 7d-153) then
tmp = ky * (sin(th) / kx)
else if ((ky <= 8.2d+158) .or. (.not. (ky <= 4.8d+201))) then
tmp = sin(th)
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7e-153) {
tmp = ky * (Math.sin(th) / kx);
} else if ((ky <= 8.2e+158) || !(ky <= 4.8e+201)) {
tmp = Math.sin(th);
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 7e-153: tmp = ky * (math.sin(th) / kx) elif (ky <= 8.2e+158) or not (ky <= 4.8e+201): tmp = math.sin(th) else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 7e-153) tmp = Float64(ky * Float64(sin(th) / kx)); elseif ((ky <= 8.2e+158) || !(ky <= 4.8e+201)) tmp = sin(th); else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 7e-153) tmp = ky * (sin(th) / kx); elseif ((ky <= 8.2e+158) || ~((ky <= 4.8e+201))) tmp = sin(th); else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 7e-153], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 8.2e+158], N[Not[LessEqual[ky, 4.8e+201]], $MachinePrecision]], N[Sin[th], $MachinePrecision], (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 7 \cdot 10^{-153}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{+158} \lor \neg \left(ky \leq 4.8 \cdot 10^{+201}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 6.99999999999999961e-153Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/88.0%
associate-/l*90.0%
unpow290.0%
Simplified99.6%
associate-*r/93.8%
clear-num92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in ky around 0 26.5%
Taylor expanded in kx around 0 18.2%
associate-/l*21.0%
Simplified21.0%
if 6.99999999999999961e-153 < ky < 8.20000000000000008e158 or 4.79999999999999985e201 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.5%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 40.3%
if 8.20000000000000008e158 < ky < 4.79999999999999985e201Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.2%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 24.2%
expm1-log1p-u24.2%
expm1-undefine24.2%
Applied egg-rr24.2%
expm1-define24.2%
associate-*r/23.8%
associate-*l/24.2%
*-inverses24.2%
*-lft-identity24.2%
Simplified24.2%
expm1-undefine24.2%
log1p-undefine24.2%
rem-exp-log24.2%
+-commutative24.2%
Applied egg-rr24.2%
Taylor expanded in th around 0 6.7%
add-exp-log5.7%
expm1-define5.7%
log1p-define5.7%
add-sqr-sqrt5.1%
expm1-log1p-u5.1%
sqrt-unprod5.5%
pow25.5%
Applied egg-rr5.5%
Taylor expanded in th around -inf 36.1%
neg-mul-136.1%
Simplified36.1%
Final simplification27.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 6e-160) (* ky (/ th (sin kx))) (if (or (<= ky 8.2e+158) (not (<= ky 2.7e+205))) (sin th) (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6e-160) {
tmp = ky * (th / sin(kx));
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = sin(th);
} 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 <= 6d-160) then
tmp = ky * (th / sin(kx))
else if ((ky <= 8.2d+158) .or. (.not. (ky <= 2.7d+205))) then
tmp = sin(th)
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6e-160) {
tmp = ky * (th / Math.sin(kx));
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = Math.sin(th);
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 6e-160: tmp = ky * (th / math.sin(kx)) elif (ky <= 8.2e+158) or not (ky <= 2.7e+205): tmp = math.sin(th) else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 6e-160) tmp = Float64(ky * Float64(th / sin(kx))); elseif ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) tmp = sin(th); else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 6e-160) tmp = ky * (th / sin(kx)); elseif ((ky <= 8.2e+158) || ~((ky <= 2.7e+205))) tmp = sin(th); else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 6e-160], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 8.2e+158], N[Not[LessEqual[ky, 2.7e+205]], $MachinePrecision]], N[Sin[th], $MachinePrecision], (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 6 \cdot 10^{-160}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{+158} \lor \neg \left(ky \leq 2.7 \cdot 10^{+205}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 5.99999999999999993e-160Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/88.0%
associate-/l*90.0%
unpow290.0%
Simplified99.6%
associate-*r/93.8%
clear-num92.9%
*-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in ky around 0 26.5%
Taylor expanded in th around 0 16.0%
associate-/l*18.8%
Simplified18.8%
if 5.99999999999999993e-160 < ky < 8.20000000000000008e158 or 2.70000000000000012e205 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.5%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 40.7%
if 8.20000000000000008e158 < ky < 2.70000000000000012e205Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.3%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 21.6%
expm1-log1p-u21.6%
expm1-undefine21.8%
Applied egg-rr21.8%
expm1-define21.6%
associate-*r/21.2%
associate-*l/21.6%
*-inverses21.6%
*-lft-identity21.6%
Simplified21.6%
expm1-undefine21.8%
log1p-undefine21.8%
rem-exp-log21.8%
+-commutative21.8%
Applied egg-rr21.8%
Taylor expanded in th around 0 6.8%
add-exp-log5.9%
expm1-define5.9%
log1p-define5.7%
add-sqr-sqrt5.2%
expm1-log1p-u5.2%
sqrt-unprod5.8%
pow25.8%
Applied egg-rr5.8%
Taylor expanded in th around -inf 45.2%
neg-mul-145.2%
Simplified45.2%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.25e-178) (log1p 0.0) (if (or (<= ky 8.2e+158) (not (<= ky 2.7e+205))) (sin th) (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.25e-178) {
tmp = log1p(0.0);
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = sin(th);
} else {
tmp = -th;
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.25e-178) {
tmp = Math.log1p(0.0);
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = Math.sin(th);
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.25e-178: tmp = math.log1p(0.0) elif (ky <= 8.2e+158) or not (ky <= 2.7e+205): tmp = math.sin(th) else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.25e-178) tmp = log1p(0.0); elseif ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) tmp = sin(th); else tmp = Float64(-th); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.25e-178], N[Log[1 + 0.0], $MachinePrecision], If[Or[LessEqual[ky, 8.2e+158], N[Not[LessEqual[ky, 2.7e+205]], $MachinePrecision]], N[Sin[th], $MachinePrecision], (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.25 \cdot 10^{-178}:\\
\;\;\;\;\mathsf{log1p}\left(0\right)\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{+158} \lor \neg \left(ky \leq 2.7 \cdot 10^{+205}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 4.2500000000000001e-178Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.5%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in kx around 0 17.4%
expm1-log1p-u17.4%
expm1-undefine18.8%
Applied egg-rr18.8%
expm1-define17.4%
associate-*r/24.6%
associate-*l/17.4%
*-inverses17.4%
*-lft-identity17.4%
Simplified17.4%
expm1-log1p-u17.4%
log1p-expm1-u17.3%
Applied egg-rr17.3%
Taylor expanded in th around inf 18.8%
Taylor expanded in th around 0 13.3%
if 4.2500000000000001e-178 < ky < 8.20000000000000008e158 or 2.70000000000000012e205 < ky Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/94.8%
associate-/l*96.9%
unpow296.9%
Simplified99.6%
Taylor expanded in kx around 0 38.4%
if 8.20000000000000008e158 < ky < 2.70000000000000012e205Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.3%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 21.6%
expm1-log1p-u21.6%
expm1-undefine21.8%
Applied egg-rr21.8%
expm1-define21.6%
associate-*r/21.2%
associate-*l/21.6%
*-inverses21.6%
*-lft-identity21.6%
Simplified21.6%
expm1-undefine21.8%
log1p-undefine21.8%
rem-exp-log21.8%
+-commutative21.8%
Applied egg-rr21.8%
Taylor expanded in th around 0 6.8%
add-exp-log5.9%
expm1-define5.9%
log1p-define5.7%
add-sqr-sqrt5.2%
expm1-log1p-u5.2%
sqrt-unprod5.8%
pow25.8%
Applied egg-rr5.8%
Taylor expanded in th around -inf 45.2%
neg-mul-145.2%
Simplified45.2%
Final simplification23.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.15e-160) (+ (+ th 1.0) -1.0) (if (or (<= ky 8.2e+158) (not (<= ky 2.7e+205))) (sin th) (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.15e-160) {
tmp = (th + 1.0) + -1.0;
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = sin(th);
} 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.15d-160) then
tmp = (th + 1.0d0) + (-1.0d0)
else if ((ky <= 8.2d+158) .or. (.not. (ky <= 2.7d+205))) then
tmp = sin(th)
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.15e-160) {
tmp = (th + 1.0) + -1.0;
} else if ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) {
tmp = Math.sin(th);
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.15e-160: tmp = (th + 1.0) + -1.0 elif (ky <= 8.2e+158) or not (ky <= 2.7e+205): tmp = math.sin(th) else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.15e-160) tmp = Float64(Float64(th + 1.0) + -1.0); elseif ((ky <= 8.2e+158) || !(ky <= 2.7e+205)) tmp = sin(th); else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.15e-160) tmp = (th + 1.0) + -1.0; elseif ((ky <= 8.2e+158) || ~((ky <= 2.7e+205))) tmp = sin(th); else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.15e-160], N[(N[(th + 1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[Or[LessEqual[ky, 8.2e+158], N[Not[LessEqual[ky, 2.7e+205]], $MachinePrecision]], N[Sin[th], $MachinePrecision], (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.15 \cdot 10^{-160}:\\
\;\;\;\;\left(th + 1\right) + -1\\
\mathbf{elif}\;ky \leq 8.2 \cdot 10^{+158} \lor \neg \left(ky \leq 2.7 \cdot 10^{+205}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 1.14999999999999992e-160Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/88.0%
associate-/l*90.0%
unpow290.0%
Simplified99.6%
Taylor expanded in kx around 0 17.4%
expm1-log1p-u17.4%
expm1-undefine19.3%
Applied egg-rr19.3%
expm1-define17.4%
associate-*r/25.3%
associate-*l/17.4%
*-inverses17.4%
*-lft-identity17.4%
Simplified17.4%
expm1-undefine19.3%
log1p-undefine19.3%
rem-exp-log19.3%
+-commutative19.3%
Applied egg-rr19.3%
Taylor expanded in th around 0 13.3%
if 1.14999999999999992e-160 < ky < 8.20000000000000008e158 or 2.70000000000000012e205 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.5%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 40.7%
if 8.20000000000000008e158 < ky < 2.70000000000000012e205Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.3%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 21.6%
expm1-log1p-u21.6%
expm1-undefine21.8%
Applied egg-rr21.8%
expm1-define21.6%
associate-*r/21.2%
associate-*l/21.6%
*-inverses21.6%
*-lft-identity21.6%
Simplified21.6%
expm1-undefine21.8%
log1p-undefine21.8%
rem-exp-log21.8%
+-commutative21.8%
Applied egg-rr21.8%
Taylor expanded in th around 0 6.8%
add-exp-log5.9%
expm1-define5.9%
log1p-define5.7%
add-sqr-sqrt5.2%
expm1-log1p-u5.2%
sqrt-unprod5.8%
pow25.8%
Applied egg-rr5.8%
Taylor expanded in th around -inf 45.2%
neg-mul-145.2%
Simplified45.2%
Final simplification22.9%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.1e-184) (+ (+ th 1.0) -1.0) (if (<= ky 6.4e+151) (* (* th 2.0) (/ 1.0 (+ th 2.0))) (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.1e-184) {
tmp = (th + 1.0) + -1.0;
} else if (ky <= 6.4e+151) {
tmp = (th * 2.0) * (1.0 / (th + 2.0));
} 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 <= 5.1d-184) then
tmp = (th + 1.0d0) + (-1.0d0)
else if (ky <= 6.4d+151) then
tmp = (th * 2.0d0) * (1.0d0 / (th + 2.0d0))
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.1e-184) {
tmp = (th + 1.0) + -1.0;
} else if (ky <= 6.4e+151) {
tmp = (th * 2.0) * (1.0 / (th + 2.0));
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.1e-184: tmp = (th + 1.0) + -1.0 elif ky <= 6.4e+151: tmp = (th * 2.0) * (1.0 / (th + 2.0)) else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.1e-184) tmp = Float64(Float64(th + 1.0) + -1.0); elseif (ky <= 6.4e+151) tmp = Float64(Float64(th * 2.0) * Float64(1.0 / Float64(th + 2.0))); else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 5.1e-184) tmp = (th + 1.0) + -1.0; elseif (ky <= 6.4e+151) tmp = (th * 2.0) * (1.0 / (th + 2.0)); else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.1e-184], N[(N[(th + 1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[ky, 6.4e+151], N[(N[(th * 2.0), $MachinePrecision] * N[(1.0 / N[(th + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.1 \cdot 10^{-184}:\\
\;\;\;\;\left(th + 1\right) + -1\\
\mathbf{elif}\;ky \leq 6.4 \cdot 10^{+151}:\\
\;\;\;\;\left(th \cdot 2\right) \cdot \frac{1}{th + 2}\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 5.0999999999999998e-184Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/89.5%
associate-/l*91.0%
unpow291.0%
Simplified99.6%
Taylor expanded in kx around 0 17.4%
expm1-log1p-u17.4%
expm1-undefine18.8%
Applied egg-rr18.8%
expm1-define17.4%
associate-*r/24.6%
associate-*l/17.4%
*-inverses17.4%
*-lft-identity17.4%
Simplified17.4%
expm1-undefine18.8%
log1p-undefine18.8%
rem-exp-log18.8%
+-commutative18.8%
Applied egg-rr18.8%
Taylor expanded in th around 0 12.6%
if 5.0999999999999998e-184 < ky < 6.39999999999999988e151Initial program 95.8%
unpow295.8%
sqr-neg95.8%
sin-neg95.8%
sin-neg95.8%
unpow295.8%
associate-*l/92.9%
associate-/l*95.7%
unpow295.7%
Simplified99.6%
Taylor expanded in kx around 0 37.5%
expm1-log1p-u37.5%
expm1-undefine19.5%
Applied egg-rr19.5%
expm1-define37.5%
associate-*r/40.5%
associate-*l/37.5%
*-inverses37.5%
*-lft-identity37.5%
Simplified37.5%
expm1-undefine19.5%
log1p-undefine19.5%
rem-exp-log19.5%
+-commutative19.5%
Applied egg-rr19.5%
Taylor expanded in th around 0 10.3%
flip--10.2%
div-inv10.2%
metadata-eval10.2%
difference-of-sqr-110.2%
+-commutative10.2%
associate-+l+10.2%
metadata-eval10.2%
add-exp-log9.8%
expm1-define9.8%
log1p-define27.8%
expm1-log1p-u28.2%
+-commutative28.2%
associate-+l+28.2%
metadata-eval28.2%
Applied egg-rr28.2%
Taylor expanded in th around 0 29.5%
*-commutative29.5%
Simplified29.5%
if 6.39999999999999988e151 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 36.4%
expm1-log1p-u36.3%
expm1-undefine23.3%
Applied egg-rr23.3%
expm1-define36.3%
associate-*r/36.3%
associate-*l/36.3%
*-inverses36.3%
*-lft-identity36.3%
Simplified36.3%
expm1-undefine23.3%
log1p-undefine23.3%
rem-exp-log23.3%
+-commutative23.3%
Applied egg-rr23.3%
Taylor expanded in th around 0 5.1%
add-exp-log4.5%
expm1-define4.5%
log1p-define17.5%
add-sqr-sqrt12.7%
expm1-log1p-u12.7%
sqrt-unprod11.1%
pow211.1%
Applied egg-rr11.1%
Taylor expanded in th around -inf 28.9%
neg-mul-128.9%
Simplified28.9%
Final simplification18.9%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.4e-99) (+ (+ th 1.0) -1.0) (if (<= ky 2.7e-20) th (- th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.4e-99) {
tmp = (th + 1.0) + -1.0;
} else if (ky <= 2.7e-20) {
tmp = th;
} 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.4d-99) then
tmp = (th + 1.0d0) + (-1.0d0)
else if (ky <= 2.7d-20) then
tmp = th
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.4e-99) {
tmp = (th + 1.0) + -1.0;
} else if (ky <= 2.7e-20) {
tmp = th;
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.4e-99: tmp = (th + 1.0) + -1.0 elif ky <= 2.7e-20: tmp = th else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.4e-99) tmp = Float64(Float64(th + 1.0) + -1.0); elseif (ky <= 2.7e-20) tmp = th; else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.4e-99) tmp = (th + 1.0) + -1.0; elseif (ky <= 2.7e-20) tmp = th; else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.4e-99], N[(N[(th + 1.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[ky, 2.7e-20], th, (-th)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.4 \cdot 10^{-99}:\\
\;\;\;\;\left(th + 1\right) + -1\\
\mathbf{elif}\;ky \leq 2.7 \cdot 10^{-20}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 1.4e-99Initial program 90.3%
unpow290.3%
sqr-neg90.3%
sin-neg90.3%
sin-neg90.3%
unpow290.3%
associate-*l/88.3%
associate-/l*90.3%
unpow290.3%
Simplified99.6%
Taylor expanded in kx around 0 17.6%
expm1-log1p-u17.6%
expm1-undefine20.0%
Applied egg-rr20.0%
expm1-define17.6%
associate-*r/25.8%
associate-*l/17.6%
*-inverses17.6%
*-lft-identity17.6%
Simplified17.6%
expm1-undefine20.0%
log1p-undefine20.0%
rem-exp-log20.0%
+-commutative20.0%
Applied egg-rr20.0%
Taylor expanded in th around 0 13.7%
if 1.4e-99 < ky < 2.7e-20Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/91.6%
associate-/l*99.9%
unpow299.9%
Simplified99.9%
Taylor expanded in kx around 0 83.1%
Taylor expanded in th around 0 55.6%
if 2.7e-20 < 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 33.5%
expm1-log1p-u33.5%
expm1-undefine16.8%
Applied egg-rr16.8%
expm1-define33.5%
associate-*r/33.4%
associate-*l/33.5%
*-inverses33.5%
*-lft-identity33.5%
Simplified33.5%
expm1-undefine16.8%
log1p-undefine16.8%
rem-exp-log16.8%
+-commutative16.8%
Applied egg-rr16.8%
Taylor expanded in th around 0 5.9%
add-exp-log5.3%
expm1-define5.3%
log1p-define21.8%
add-sqr-sqrt12.6%
expm1-log1p-u12.6%
sqrt-unprod13.7%
pow213.7%
Applied egg-rr13.7%
Taylor expanded in th around -inf 21.6%
neg-mul-121.6%
Simplified21.6%
Final simplification17.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 8e+110) th (- th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8e+110) {
tmp = th;
} 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 <= 8d+110) then
tmp = th
else
tmp = -th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8e+110) {
tmp = th;
} else {
tmp = -th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 8e+110: tmp = th else: tmp = -th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 8e+110) tmp = th; else tmp = Float64(-th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 8e+110) tmp = th; else tmp = -th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 8e+110], th, (-th)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 8 \cdot 10^{+110}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;-th\\
\end{array}
\end{array}
if ky < 8.0000000000000002e110Initial program 92.2%
unpow292.2%
sqr-neg92.2%
sin-neg92.2%
sin-neg92.2%
unpow292.2%
associate-*l/90.2%
associate-/l*92.2%
unpow292.2%
Simplified99.6%
Taylor expanded in kx around 0 23.1%
Taylor expanded in th around 0 15.9%
if 8.0000000000000002e110 < ky Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.4%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 34.5%
expm1-log1p-u34.4%
expm1-undefine22.4%
Applied egg-rr22.4%
expm1-define34.4%
associate-*r/34.4%
associate-*l/34.4%
*-inverses34.4%
*-lft-identity34.4%
Simplified34.4%
expm1-undefine22.4%
log1p-undefine22.4%
rem-exp-log22.4%
+-commutative22.4%
Applied egg-rr22.4%
Taylor expanded in th around 0 6.7%
add-exp-log5.9%
expm1-define5.9%
log1p-define17.7%
add-sqr-sqrt10.8%
expm1-log1p-u10.8%
sqrt-unprod9.7%
pow29.7%
Applied egg-rr9.7%
Taylor expanded in th around -inf 24.9%
neg-mul-124.9%
Simplified24.9%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.4%
unpow293.4%
sqr-neg93.4%
sin-neg93.4%
sin-neg93.4%
unpow293.4%
associate-*l/91.6%
associate-/l*93.3%
unpow293.3%
Simplified99.6%
Taylor expanded in kx around 0 24.9%
Taylor expanded in th around 0 16.3%
herbie shell --seed 2024107
(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)))