
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin kx) (sin ky))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(kx), sin(ky))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(kx), Math.sin(ky))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(kx), math.sin(ky))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(kx), sin(ky))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot \sin th
\end{array}
Initial program 93.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.04)
(*
(* (sin ky) th)
(/ (+ 1.0 (* -0.16666666666666666 (* th th))) (hypot ky (sin kx))))
(if (<= (sin kx) 2e-117)
(* (sin th) (+ 1.0 (/ (/ (* -0.5 (* kx kx)) ky) ky)))
(if (<= (sin kx) 1e-50)
(* th (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ (sin th) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.04) {
tmp = (sin(ky) * th) * ((1.0 + (-0.16666666666666666 * (th * th))) / hypot(ky, sin(kx)));
} else if (sin(kx) <= 2e-117) {
tmp = sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky));
} else if (sin(kx) <= 1e-50) {
tmp = th * (sin(ky) / hypot(kx, sin(ky)));
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.04) {
tmp = (Math.sin(ky) * th) * ((1.0 + (-0.16666666666666666 * (th * th))) / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-117) {
tmp = Math.sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky));
} else if (Math.sin(kx) <= 1e-50) {
tmp = th * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.04: tmp = (math.sin(ky) * th) * ((1.0 + (-0.16666666666666666 * (th * th))) / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 2e-117: tmp = math.sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky)) elif math.sin(kx) <= 1e-50: tmp = th * (math.sin(ky) / math.hypot(kx, math.sin(ky))) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.04) tmp = Float64(Float64(sin(ky) * th) * Float64(Float64(1.0 + Float64(-0.16666666666666666 * Float64(th * th))) / hypot(ky, sin(kx)))); elseif (sin(kx) <= 2e-117) tmp = Float64(sin(th) * Float64(1.0 + Float64(Float64(Float64(-0.5 * Float64(kx * kx)) / ky) / ky))); elseif (sin(kx) <= 1e-50) tmp = Float64(th * Float64(sin(ky) / hypot(kx, sin(ky)))); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.04) tmp = (sin(ky) * th) * ((1.0 + (-0.16666666666666666 * (th * th))) / hypot(ky, sin(kx))); elseif (sin(kx) <= 2e-117) tmp = sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky)); elseif (sin(kx) <= 1e-50) tmp = th * (sin(ky) / hypot(kx, sin(ky))); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.04], N[(N[(N[Sin[ky], $MachinePrecision] * th), $MachinePrecision] * N[(N[(1.0 + N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-117], N[(N[Sin[th], $MachinePrecision] * N[(1.0 + N[(N[(N[(-0.5 * N[(kx * kx), $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-50], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.04:\\
\;\;\;\;\left(\sin ky \cdot th\right) \cdot \frac{1 + -0.16666666666666666 \cdot \left(th \cdot th\right)}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-117}:\\
\;\;\;\;\sin th \cdot \left(1 + \frac{\frac{-0.5 \cdot \left(kx \cdot kx\right)}{ky}}{ky}\right)\\
\mathbf{elif}\;\sin kx \leq 10^{-50}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0400000000000000008Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.4%
Simplified99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6446.2%
Simplified46.2%
associate-/l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6446.1%
Applied egg-rr46.1%
Taylor expanded in ky around 0
Simplified28.9%
if -0.0400000000000000008 < (sin.f64 kx) < 2.00000000000000006e-117Initial program 85.7%
Taylor expanded in kx around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sin-lowering-sin.f6440.1%
Simplified40.1%
Taylor expanded in ky around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.7%
Simplified45.7%
if 2.00000000000000006e-117 < (sin.f64 kx) < 1.00000000000000001e-50Initial program 99.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in kx around 0
Simplified99.8%
Taylor expanded in th around 0
Simplified64.1%
if 1.00000000000000001e-50 < (sin.f64 kx) Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6463.8%
Simplified63.8%
Final simplification46.8%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.04)
(*
(sin ky)
(/ (* th (+ 1.0 (* th (* th -0.16666666666666666)))) (hypot ky (sin kx))))
(if (<= (sin kx) 2e-117)
(* (sin th) (+ 1.0 (/ (/ (* -0.5 (* kx kx)) ky) ky)))
(if (<= (sin kx) 1e-50)
(* th (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ (sin th) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.04) {
tmp = sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / hypot(ky, sin(kx)));
} else if (sin(kx) <= 2e-117) {
tmp = sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky));
} else if (sin(kx) <= 1e-50) {
tmp = th * (sin(ky) / hypot(kx, sin(ky)));
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.04) {
tmp = Math.sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 2e-117) {
tmp = Math.sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky));
} else if (Math.sin(kx) <= 1e-50) {
tmp = th * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.04: tmp = math.sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 2e-117: tmp = math.sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky)) elif math.sin(kx) <= 1e-50: tmp = th * (math.sin(ky) / math.hypot(kx, math.sin(ky))) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.04) tmp = Float64(sin(ky) * Float64(Float64(th * Float64(1.0 + Float64(th * Float64(th * -0.16666666666666666)))) / hypot(ky, sin(kx)))); elseif (sin(kx) <= 2e-117) tmp = Float64(sin(th) * Float64(1.0 + Float64(Float64(Float64(-0.5 * Float64(kx * kx)) / ky) / ky))); elseif (sin(kx) <= 1e-50) tmp = Float64(th * Float64(sin(ky) / hypot(kx, sin(ky)))); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.04) tmp = sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / hypot(ky, sin(kx))); elseif (sin(kx) <= 2e-117) tmp = sin(th) * (1.0 + (((-0.5 * (kx * kx)) / ky) / ky)); elseif (sin(kx) <= 1e-50) tmp = th * (sin(ky) / hypot(kx, sin(ky))); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.04], N[(N[Sin[ky], $MachinePrecision] * N[(N[(th * N[(1.0 + N[(th * N[(th * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-117], N[(N[Sin[th], $MachinePrecision] * N[(1.0 + N[(N[(N[(-0.5 * N[(kx * kx), $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-50], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.04:\\
\;\;\;\;\sin ky \cdot \frac{th \cdot \left(1 + th \cdot \left(th \cdot -0.16666666666666666\right)\right)}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-117}:\\
\;\;\;\;\sin th \cdot \left(1 + \frac{\frac{-0.5 \cdot \left(kx \cdot kx\right)}{ky}}{ky}\right)\\
\mathbf{elif}\;\sin kx \leq 10^{-50}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.0400000000000000008Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.4%
Simplified99.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6446.2%
Simplified46.2%
Taylor expanded in ky around 0
Simplified28.9%
if -0.0400000000000000008 < (sin.f64 kx) < 2.00000000000000006e-117Initial program 85.7%
Taylor expanded in kx around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sin-lowering-sin.f6440.1%
Simplified40.1%
Taylor expanded in ky around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6445.7%
Simplified45.7%
if 2.00000000000000006e-117 < (sin.f64 kx) < 1.00000000000000001e-50Initial program 99.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in kx around 0
Simplified99.8%
Taylor expanded in th around 0
Simplified64.1%
if 1.00000000000000001e-50 < (sin.f64 kx) Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6463.8%
Simplified63.8%
Final simplification46.8%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.01)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(if (<= (sin ky) 0.0001)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (sin(ky) <= 0.0001) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.01) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (Math.sin(ky) <= 0.0001) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif math.sin(ky) <= 0.0001: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (sin(ky) <= 0.0001) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.01) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (sin(ky) <= 0.0001) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.0001], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.0001:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified48.0%
if -0.0100000000000000002 < (sin.f64 ky) < 1.00000000000000005e-4Initial program 89.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified99.6%
if 1.00000000000000005e-4 < (sin.f64 ky) Initial program 99.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6461.5%
Simplified61.5%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 0.0136)
(* (sin th) (/ (sin ky) (hypot (sin kx) ky)))
(if (<= ky 8.8e+163)
(* (sin th) (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ th (hypot (sin ky) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0136) {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
} else if (ky <= 8.8e+163) {
tmp = sin(th) * (sin(ky) / hypot(kx, 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.0136) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(kx), ky));
} else if (ky <= 8.8e+163) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(kx, 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.0136: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(kx), ky)) elif ky <= 8.8e+163: tmp = math.sin(th) * (math.sin(ky) / math.hypot(kx, 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.0136) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); elseif (ky <= 8.8e+163) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(kx, 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.0136) tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky)); elseif (ky <= 8.8e+163) tmp = sin(th) * (sin(ky) / hypot(kx, 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.0136], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 8.8e+163], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $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.0136:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\mathbf{elif}\;ky \leq 8.8 \cdot 10^{+163}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \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.0135999999999999992Initial program 92.2%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in ky around 0
Simplified71.8%
if 0.0135999999999999992 < ky < 8.79999999999999945e163Initial program 99.9%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.9%
Simplified99.9%
Taylor expanded in kx around 0
Simplified56.4%
if 8.79999999999999945e163 < ky Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified57.2%
Final simplification68.6%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 0.0075)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(if (<= ky 5.6e+164)
(* (sin th) (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ th (hypot (sin ky) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.0075) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else if (ky <= 5.6e+164) {
tmp = sin(th) * (sin(ky) / hypot(kx, 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.0075) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else if (ky <= 5.6e+164) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(kx, 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.0075: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) elif ky <= 5.6e+164: tmp = math.sin(th) * (math.sin(ky) / math.hypot(kx, 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.0075) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); elseif (ky <= 5.6e+164) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(kx, 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.0075) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); elseif (ky <= 5.6e+164) tmp = sin(th) * (sin(ky) / hypot(kx, 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.0075], 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.6e+164], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $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.0075:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;ky \leq 5.6 \cdot 10^{+164}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \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.0074999999999999997Initial program 92.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified71.7%
if 0.0074999999999999997 < ky < 5.6000000000000004e164Initial program 99.9%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.9%
Simplified99.9%
Taylor expanded in kx around 0
Simplified56.4%
if 5.6000000000000004e164 < ky Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified57.2%
Final simplification68.5%
(FPCore (kx ky th)
:precision binary64
(if (<= ky 0.00195)
(* (sin ky) (/ (sin th) (hypot ky (sin kx))))
(if (<= ky 4.8e+162)
(* (sin ky) (/ (sin th) (hypot (sin ky) kx)))
(* (sin ky) (/ th (hypot (sin ky) (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 0.00195) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else if (ky <= 4.8e+162) {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
} 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.00195) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else if (ky <= 4.8e+162) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} 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.00195: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) elif ky <= 4.8e+162: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) 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.00195) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); elseif (ky <= 4.8e+162) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); 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.00195) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); elseif (ky <= 4.8e+162) tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); else tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 0.00195], 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, 4.8e+162], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $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.00195:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;ky \leq 4.8 \cdot 10^{+162}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\end{array}
\end{array}
if ky < 0.0019499999999999999Initial program 92.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified71.7%
if 0.0019499999999999999 < ky < 4.80000000000000018e162Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
Simplified54.7%
if 4.80000000000000018e162 < ky Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified58.7%
(FPCore (kx ky th) :precision binary64 (if (<= th 380000.0) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (if (<= th 1.08e+275) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 380000.0) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else if (th <= 1.08e+275) {
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 <= 380000.0) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 1.08e+275) {
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 <= 380000.0: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 1.08e+275: 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 <= 380000.0) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); elseif (th <= 1.08e+275) 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 <= 380000.0) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); elseif (th <= 1.08e+275) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 380000.0], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 1.08e+275], 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 380000:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 1.08 \cdot 10^{+275}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if th < 3.8e5Initial program 93.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified62.9%
if 3.8e5 < th < 1.0800000000000001e275Initial program 94.3%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6429.5%
Simplified29.5%
if 1.0800000000000001e275 < th Initial program 99.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6447.5%
Simplified47.5%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 3.2e-115)
(* (sin th) (+ 1.0 (* (/ (* kx -0.5) (sin ky)) (/ kx (sin ky)))))
(if (<= kx 6e-46)
(* th (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.2e-115) {
tmp = sin(th) * (1.0 + (((kx * -0.5) / sin(ky)) * (kx / sin(ky))));
} else if (kx <= 6e-46) {
tmp = th * (sin(ky) / hypot(kx, sin(ky)));
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.2e-115) {
tmp = Math.sin(th) * (1.0 + (((kx * -0.5) / Math.sin(ky)) * (kx / Math.sin(ky))));
} else if (kx <= 6e-46) {
tmp = th * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.2e-115: tmp = math.sin(th) * (1.0 + (((kx * -0.5) / math.sin(ky)) * (kx / math.sin(ky)))) elif kx <= 6e-46: tmp = th * (math.sin(ky) / math.hypot(kx, math.sin(ky))) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.2e-115) tmp = Float64(sin(th) * Float64(1.0 + Float64(Float64(Float64(kx * -0.5) / sin(ky)) * Float64(kx / sin(ky))))); elseif (kx <= 6e-46) tmp = Float64(th * Float64(sin(ky) / hypot(kx, sin(ky)))); 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 (kx <= 3.2e-115) tmp = sin(th) * (1.0 + (((kx * -0.5) / sin(ky)) * (kx / sin(ky)))); elseif (kx <= 6e-46) tmp = th * (sin(ky) / hypot(kx, sin(ky))); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.2e-115], N[(N[Sin[th], $MachinePrecision] * N[(1.0 + N[(N[(N[(kx * -0.5), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision] * N[(kx / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 6e-46], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $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}\;kx \leq 3.2 \cdot 10^{-115}:\\
\;\;\;\;\sin th \cdot \left(1 + \frac{kx \cdot -0.5}{\sin ky} \cdot \frac{kx}{\sin ky}\right)\\
\mathbf{elif}\;kx \leq 6 \cdot 10^{-46}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if kx < 3.2e-115Initial program 91.0%
Taylor expanded in kx around 0
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
sin-lowering-sin.f6425.6%
Simplified25.6%
associate-*r*N/A
pow2N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6429.1%
Applied egg-rr29.1%
if 3.2e-115 < kx < 5.99999999999999975e-46Initial program 99.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in kx around 0
Simplified99.8%
Taylor expanded in th around 0
Simplified64.1%
if 5.99999999999999975e-46 < kx Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6441.0%
Simplified41.0%
Final simplification33.8%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 1.2e-114)
(sin th)
(if (<= kx 8.5e-47)
(* th (/ (sin ky) (hypot kx (sin ky))))
(* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.2e-114) {
tmp = sin(th);
} else if (kx <= 8.5e-47) {
tmp = th * (sin(ky) / hypot(kx, sin(ky)));
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.2e-114) {
tmp = Math.sin(th);
} else if (kx <= 8.5e-47) {
tmp = th * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.2e-114: tmp = math.sin(th) elif kx <= 8.5e-47: tmp = th * (math.sin(ky) / math.hypot(kx, math.sin(ky))) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.2e-114) tmp = sin(th); elseif (kx <= 8.5e-47) tmp = Float64(th * Float64(sin(ky) / hypot(kx, sin(ky)))); 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 (kx <= 1.2e-114) tmp = sin(th); elseif (kx <= 8.5e-47) tmp = th * (sin(ky) / hypot(kx, sin(ky))); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.2e-114], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 8.5e-47], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $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}\;kx \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 8.5 \cdot 10^{-47}:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.2000000000000001e-114Initial program 91.0%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6431.1%
Simplified31.1%
if 1.2000000000000001e-114 < kx < 8.4999999999999999e-47Initial program 99.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in kx around 0
Simplified99.8%
Taylor expanded in th around 0
Simplified64.1%
if 8.4999999999999999e-47 < kx Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6441.0%
Simplified41.0%
Final simplification35.1%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.35e-113) (sin th) (* (sin ky) (/ (sin th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e-113) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.35d-113) then
tmp = sin(th)
else
tmp = sin(ky) * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e-113) {
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 kx <= 1.35e-113: 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 (kx <= 1.35e-113) 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 (kx <= 1.35e-113) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.35e-113], 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}\;kx \leq 1.35 \cdot 10^{-113}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.34999999999999998e-113Initial program 91.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.9%
Simplified30.9%
if 1.34999999999999998e-113 < kx Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6441.6%
Simplified41.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) 1e-160)
(*
(sin th)
(/
ky
(*
kx
(+
1.0
(*
(* kx kx)
(+
-0.16666666666666666
(*
(* kx kx)
(+ 0.008333333333333333 (* (* kx kx) -0.0001984126984126984)))))))))
(sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-160) {
tmp = sin(th) * (ky / (kx * (1.0 + ((kx * kx) * (-0.16666666666666666 + ((kx * kx) * (0.008333333333333333 + ((kx * kx) * -0.0001984126984126984))))))));
} 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) <= 1d-160) then
tmp = sin(th) * (ky / (kx * (1.0d0 + ((kx * kx) * ((-0.16666666666666666d0) + ((kx * kx) * (0.008333333333333333d0 + ((kx * kx) * (-0.0001984126984126984d0)))))))))
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) <= 1e-160) {
tmp = Math.sin(th) * (ky / (kx * (1.0 + ((kx * kx) * (-0.16666666666666666 + ((kx * kx) * (0.008333333333333333 + ((kx * kx) * -0.0001984126984126984))))))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-160: tmp = math.sin(th) * (ky / (kx * (1.0 + ((kx * kx) * (-0.16666666666666666 + ((kx * kx) * (0.008333333333333333 + ((kx * kx) * -0.0001984126984126984)))))))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-160) tmp = Float64(sin(th) * Float64(ky / Float64(kx * Float64(1.0 + Float64(Float64(kx * kx) * Float64(-0.16666666666666666 + Float64(Float64(kx * kx) * Float64(0.008333333333333333 + Float64(Float64(kx * kx) * -0.0001984126984126984))))))))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-160) tmp = sin(th) * (ky / (kx * (1.0 + ((kx * kx) * (-0.16666666666666666 + ((kx * kx) * (0.008333333333333333 + ((kx * kx) * -0.0001984126984126984)))))))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-160], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[(kx * N[(1.0 + N[(N[(kx * kx), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(kx * kx), $MachinePrecision] * N[(0.008333333333333333 + N[(N[(kx * kx), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-160}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx \cdot \left(1 + \left(kx \cdot kx\right) \cdot \left(-0.16666666666666666 + \left(kx \cdot kx\right) \cdot \left(0.008333333333333333 + \left(kx \cdot kx\right) \cdot -0.0001984126984126984\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999999e-161Initial program 90.3%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6428.8%
Simplified28.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.9%
Simplified20.9%
if 9.9999999999999999e-161 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6452.0%
Simplified52.0%
Final simplification32.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) 1e-160)
(*
(sin th)
(/
ky
(*
kx
(+
1.0
(*
kx
(* kx (+ -0.16666666666666666 (* (* kx kx) 0.008333333333333333))))))))
(sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-160) {
tmp = sin(th) * (ky / (kx * (1.0 + (kx * (kx * (-0.16666666666666666 + ((kx * kx) * 0.008333333333333333)))))));
} 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) <= 1d-160) then
tmp = sin(th) * (ky / (kx * (1.0d0 + (kx * (kx * ((-0.16666666666666666d0) + ((kx * kx) * 0.008333333333333333d0)))))))
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) <= 1e-160) {
tmp = Math.sin(th) * (ky / (kx * (1.0 + (kx * (kx * (-0.16666666666666666 + ((kx * kx) * 0.008333333333333333)))))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-160: tmp = math.sin(th) * (ky / (kx * (1.0 + (kx * (kx * (-0.16666666666666666 + ((kx * kx) * 0.008333333333333333))))))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-160) tmp = Float64(sin(th) * Float64(ky / Float64(kx * Float64(1.0 + Float64(kx * Float64(kx * Float64(-0.16666666666666666 + Float64(Float64(kx * kx) * 0.008333333333333333)))))))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-160) tmp = sin(th) * (ky / (kx * (1.0 + (kx * (kx * (-0.16666666666666666 + ((kx * kx) * 0.008333333333333333))))))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-160], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[(kx * N[(1.0 + N[(kx * N[(kx * N[(-0.16666666666666666 + N[(N[(kx * kx), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-160}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx \cdot \left(1 + kx \cdot \left(kx \cdot \left(-0.16666666666666666 + \left(kx \cdot kx\right) \cdot 0.008333333333333333\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999999e-161Initial program 90.3%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6428.8%
Simplified28.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.9%
Simplified20.9%
if 9.9999999999999999e-161 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6452.0%
Simplified52.0%
Final simplification32.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-160) (* (sin th) (/ ky (* kx (+ 1.0 (* -0.16666666666666666 (* kx kx)))))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-160) {
tmp = sin(th) * (ky / (kx * (1.0 + (-0.16666666666666666 * (kx * 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) <= 1d-160) then
tmp = sin(th) * (ky / (kx * (1.0d0 + ((-0.16666666666666666d0) * (kx * 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) <= 1e-160) {
tmp = Math.sin(th) * (ky / (kx * (1.0 + (-0.16666666666666666 * (kx * kx)))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-160: tmp = math.sin(th) * (ky / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-160) tmp = Float64(sin(th) * Float64(ky / Float64(kx * Float64(1.0 + Float64(-0.16666666666666666 * Float64(kx * kx)))))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-160) tmp = sin(th) * (ky / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-160], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[(kx * N[(1.0 + N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-160}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx \cdot \left(1 + -0.16666666666666666 \cdot \left(kx \cdot kx\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999999e-161Initial program 90.3%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6428.8%
Simplified28.8%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.9%
Simplified20.9%
if 9.9999999999999999e-161 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6452.0%
Simplified52.0%
Final simplification32.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.4e-109) (sin th) (* ky (/ (sin th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.4e-109) {
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 (kx <= 1.4d-109) 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 (kx <= 1.4e-109) {
tmp = Math.sin(th);
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.4e-109: tmp = math.sin(th) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.4e-109) 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 (kx <= 1.4e-109) tmp = sin(th); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.4e-109], 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}\;kx \leq 1.4 \cdot 10^{-109}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.39999999999999989e-109Initial program 91.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.8%
Simplified30.8%
if 1.39999999999999989e-109 < kx Initial program 99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6438.7%
Simplified38.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6438.7%
Applied egg-rr38.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.3e-160) (* (sin th) (/ ky kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.3e-160) {
tmp = sin(th) * (ky / 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 <= 2.3d-160) then
tmp = sin(th) * (ky / 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 <= 2.3e-160) {
tmp = Math.sin(th) * (ky / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.3e-160: tmp = math.sin(th) * (ky / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.3e-160) tmp = Float64(sin(th) * Float64(ky / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.3e-160) tmp = sin(th) * (ky / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.3e-160], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.3 \cdot 10^{-160}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.29999999999999985e-160Initial program 90.0%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6429.5%
Simplified29.5%
Taylor expanded in kx around 0
/-lowering-/.f6421.4%
Simplified21.4%
if 2.29999999999999985e-160 < ky Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.1%
Simplified37.1%
Final simplification27.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.1e+46) (sin th) (* th (* -0.16666666666666666 (* th th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.1e+46) {
tmp = sin(th);
} else {
tmp = th * (-0.16666666666666666 * (th * th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 3.1d+46) then
tmp = sin(th)
else
tmp = th * ((-0.16666666666666666d0) * (th * th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.1e+46) {
tmp = Math.sin(th);
} else {
tmp = th * (-0.16666666666666666 * (th * th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.1e+46: tmp = math.sin(th) else: tmp = th * (-0.16666666666666666 * (th * th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.1e+46) tmp = sin(th); else tmp = Float64(th * Float64(-0.16666666666666666 * Float64(th * th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.1e+46) tmp = sin(th); else tmp = th * (-0.16666666666666666 * (th * th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.1e+46], N[Sin[th], $MachinePrecision], N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.1 \cdot 10^{+46}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;th \cdot \left(-0.16666666666666666 \cdot \left(th \cdot th\right)\right)\\
\end{array}
\end{array}
if kx < 3.09999999999999975e46Initial program 92.0%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6429.0%
Simplified29.0%
if 3.09999999999999975e46 < kx Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f647.7%
Simplified7.7%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.8%
Simplified3.8%
Taylor expanded in th around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.9%
Simplified15.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.25e-53) th (* th (* -0.16666666666666666 (* th th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.25e-53) {
tmp = th;
} else {
tmp = th * (-0.16666666666666666 * (th * th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.25d-53) then
tmp = th
else
tmp = th * ((-0.16666666666666666d0) * (th * th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.25e-53) {
tmp = th;
} else {
tmp = th * (-0.16666666666666666 * (th * th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.25e-53: tmp = th else: tmp = th * (-0.16666666666666666 * (th * th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.25e-53) tmp = th; else tmp = Float64(th * Float64(-0.16666666666666666 * Float64(th * th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.25e-53) tmp = th; else tmp = th * (-0.16666666666666666 * (th * th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.25e-53], th, N[(th * N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.25 \cdot 10^{-53}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;th \cdot \left(-0.16666666666666666 \cdot \left(th \cdot th\right)\right)\\
\end{array}
\end{array}
if kx < 1.25e-53Initial program 91.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.4%
Simplified30.4%
Taylor expanded in th around 0
Simplified15.1%
if 1.25e-53 < kx Initial program 99.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f648.4%
Simplified8.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.3%
Simplified4.3%
Taylor expanded in th around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6415.8%
Simplified15.8%
(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.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6423.8%
Simplified23.8%
Taylor expanded in th around 0
Simplified11.9%
herbie shell --seed 2024145
(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)))