
(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 25 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.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.6%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.002)
(* (sin ky) (/ th (hypot (sin ky) kx)))
(if (<= (sin ky) 5e-14)
(*
(sin ky)
(/
(sin th)
(hypot ky (* kx (+ 1.0 (* -0.16666666666666666 (* kx kx)))))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.002) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 5e-14) {
tmp = sin(ky) * (sin(th) / hypot(ky, (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.002) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 5e-14) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(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) <= -0.002: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 5e-14: tmp = math.sin(ky) * (math.sin(th) / math.hypot(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) <= -0.002) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 5e-14) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(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) <= -0.002) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 5e-14) tmp = sin(ky) * (sin(th) / hypot(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], -0.002], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-14], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[(kx * N[(1.0 + N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, kx \cdot \left(1 + -0.16666666666666666 \cdot \left(kx \cdot kx\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -2e-3Initial 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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.1%
Simplified50.1%
Taylor expanded in th around 0
Simplified30.4%
Taylor expanded in kx around 0
Simplified30.9%
if -2e-3 < (sin.f64 ky) < 5.0000000000000002e-14Initial program 86.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 kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.3%
Simplified63.3%
Taylor expanded in ky around 0
Simplified63.3%
if 5.0000000000000002e-14 < (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.f6465.9%
Simplified65.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.002) (* (sin ky) (/ th (hypot (sin ky) kx))) (if (<= (sin ky) 5e-44) (* (sin ky) (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.002) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 5e-44) {
tmp = sin(ky) * (sin(th) / 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.002) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 5e-44) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.002: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 5e-44: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.002) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 5e-44) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.002) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 5e-44) tmp = sin(ky) * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.002], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -2e-3Initial 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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.1%
Simplified50.1%
Taylor expanded in th around 0
Simplified30.4%
Taylor expanded in kx around 0
Simplified30.9%
if -2e-3 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 85.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 ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6453.6%
Simplified53.6%
if 5.00000000000000039e-44 < (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.f6463.7%
Simplified63.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.05) (* (sin ky) (/ th (hypot ky (sin kx)))) (if (<= (sin kx) 4e-113) (sin th) (* (sin th) (/ (sin ky) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = sin(ky) * (th / hypot(ky, sin(kx)));
} else if (sin(kx) <= 4e-113) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.05) {
tmp = Math.sin(ky) * (th / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 4e-113) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.05: tmp = math.sin(ky) * (th / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 4e-113: tmp = math.sin(th) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.05) tmp = Float64(sin(ky) * Float64(th / hypot(ky, sin(kx)))); elseif (sin(kx) <= 4e-113) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = sin(ky) * (th / hypot(ky, sin(kx))); elseif (sin(kx) <= 4e-113) tmp = sin(th); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 4e-113], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-113}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial 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.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified53.9%
Taylor expanded in ky around 0
Simplified30.5%
if -0.050000000000000003 < (sin.f64 kx) < 3.99999999999999991e-113Initial program 83.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.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6445.3%
Simplified45.3%
if 3.99999999999999991e-113 < (sin.f64 kx) Initial program 99.5%
Taylor expanded in ky around 0
sin-lowering-sin.f6460.9%
Simplified60.9%
Final simplification47.4%
(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.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%
(FPCore (kx ky th) :precision binary64 (if (<= kx 0.0066) (/ (sin th) (/ (hypot (sin ky) kx) (sin ky))) (* (sin th) (/ (sin ky) (pow (+ 0.5 (* -0.5 (cos (* kx 2.0)))) 0.5)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0066) {
tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky));
} else {
tmp = sin(th) * (sin(ky) / pow((0.5 + (-0.5 * cos((kx * 2.0)))), 0.5));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0066) {
tmp = Math.sin(th) / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.pow((0.5 + (-0.5 * Math.cos((kx * 2.0)))), 0.5));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.0066: tmp = math.sin(th) / (math.hypot(math.sin(ky), kx) / math.sin(ky)) else: tmp = math.sin(th) * (math.sin(ky) / math.pow((0.5 + (-0.5 * math.cos((kx * 2.0)))), 0.5)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.0066) tmp = Float64(sin(th) / Float64(hypot(sin(ky), kx) / sin(ky))); else tmp = Float64(sin(th) * Float64(sin(ky) / (Float64(0.5 + Float64(-0.5 * cos(Float64(kx * 2.0)))) ^ 0.5))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.0066) tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky)); else tmp = sin(th) * (sin(ky) / ((0.5 + (-0.5 * cos((kx * 2.0)))) ^ 0.5)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.0066], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Power[N[(0.5 + N[(-0.5 * N[Cos[N[(kx * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.0066:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{{\left(0.5 + -0.5 \cdot \cos \left(kx \cdot 2\right)\right)}^{0.5}}\\
\end{array}
\end{array}
if kx < 0.0066Initial program 91.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%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0
Simplified71.2%
if 0.0066 < kx Initial program 99.3%
Taylor expanded in ky around 0
sin-lowering-sin.f6439.5%
Simplified39.5%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
sqr-sin-aN/A
cancel-sign-sub-invN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f6460.9%
Applied egg-rr60.9%
Final simplification68.7%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 0.0275)
(/ (sin th) (/ (hypot (sin ky) kx) (sin ky)))
(if (<= kx 1.4e+158)
(* (/ (sin ky) (hypot (sin kx) (sin ky))) th)
(* (sin th) (/ (sin ky) (hypot (sin kx) ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0275) {
tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky));
} else if (kx <= 1.4e+158) {
tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th;
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0275) {
tmp = Math.sin(th) / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else if (kx <= 1.4e+158) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(kx), Math.sin(ky))) * th;
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(kx), ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.0275: tmp = math.sin(th) / (math.hypot(math.sin(ky), kx) / math.sin(ky)) elif kx <= 1.4e+158: tmp = (math.sin(ky) / math.hypot(math.sin(kx), math.sin(ky))) * th else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(kx), ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.0275) tmp = Float64(sin(th) / Float64(hypot(sin(ky), kx) / sin(ky))); elseif (kx <= 1.4e+158) tmp = Float64(Float64(sin(ky) / hypot(sin(kx), sin(ky))) * th); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.0275) tmp = sin(th) / (hypot(sin(ky), kx) / sin(ky)); elseif (kx <= 1.4e+158) tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th; else tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.0275], N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 1.4e+158], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.0275:\\
\;\;\;\;\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{elif}\;kx \leq 1.4 \cdot 10^{+158}:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if kx < 0.0275000000000000001Initial program 91.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%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Applied egg-rr99.7%
Taylor expanded in kx around 0
Simplified71.2%
if 0.0275000000000000001 < kx < 1.40000000000000001e158Initial program 99.4%
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.5%
Simplified99.5%
Taylor expanded in th around 0
Simplified54.6%
if 1.40000000000000001e158 < kx Initial program 99.3%
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.2%
Simplified99.2%
Taylor expanded in ky around 0
Simplified50.8%
Final simplification66.8%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 0.015)
(* (sin th) (/ (sin ky) (hypot kx (sin ky))))
(if (<= kx 2.6e+157)
(* (/ (sin ky) (hypot (sin kx) (sin ky))) th)
(* (sin th) (/ (sin ky) (hypot (sin kx) ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.015) {
tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky)));
} else if (kx <= 2.6e+157) {
tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th;
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.015) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else if (kx <= 2.6e+157) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(kx), Math.sin(ky))) * th;
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(kx), ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.015: tmp = math.sin(th) * (math.sin(ky) / math.hypot(kx, math.sin(ky))) elif kx <= 2.6e+157: tmp = (math.sin(ky) / math.hypot(math.sin(kx), math.sin(ky))) * th else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(kx), ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.015) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(kx, sin(ky)))); elseif (kx <= 2.6e+157) tmp = Float64(Float64(sin(ky) / hypot(sin(kx), sin(ky))) * th); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.015) tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky))); elseif (kx <= 2.6e+157) tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th; else tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.015], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 2.6e+157], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.015:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{elif}\;kx \leq 2.6 \cdot 10^{+157}:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if kx < 0.014999999999999999Initial program 91.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 kx around 0
Simplified71.2%
if 0.014999999999999999 < kx < 2.60000000000000011e157Initial program 99.4%
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.5%
Simplified99.5%
Taylor expanded in th around 0
Simplified54.6%
if 2.60000000000000011e157 < kx Initial program 99.3%
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.2%
Simplified99.2%
Taylor expanded in ky around 0
Simplified50.8%
Final simplification66.8%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 0.0046)
(* (sin th) (/ (sin ky) (hypot kx (sin ky))))
(if (<= kx 9.5e+157)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(* (sin th) (/ (sin ky) (hypot (sin kx) ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0046) {
tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky)));
} else if (kx <= 9.5e+157) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.0046) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else if (kx <= 9.5e+157) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(kx), ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.0046: tmp = math.sin(th) * (math.sin(ky) / math.hypot(kx, math.sin(ky))) elif kx <= 9.5e+157: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(kx), ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.0046) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(kx, sin(ky)))); elseif (kx <= 9.5e+157) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(kx), ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.0046) tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky))); elseif (kx <= 9.5e+157) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(th) * (sin(ky) / hypot(sin(kx), ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.0046], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 9.5e+157], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + ky ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.0046:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{elif}\;kx \leq 9.5 \cdot 10^{+157}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin kx, ky\right)}\\
\end{array}
\end{array}
if kx < 0.0045999999999999999Initial program 91.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 kx around 0
Simplified71.2%
if 0.0045999999999999999 < kx < 9.4999999999999996e157Initial 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 th around 0
Simplified54.7%
if 9.4999999999999996e157 < kx Initial program 99.3%
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.2%
Simplified99.2%
Taylor expanded in ky around 0
Simplified50.8%
Final simplification66.8%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 0.05)
(* (sin th) (/ (sin ky) (hypot kx (sin ky))))
(if (<= kx 6.2e+157)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(* (sin ky) (/ (sin th) (hypot ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.05) {
tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky)));
} else if (kx <= 6.2e+157) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.05) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(kx, Math.sin(ky)));
} else if (kx <= 6.2e+157) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.05: tmp = math.sin(th) * (math.sin(ky) / math.hypot(kx, math.sin(ky))) elif kx <= 6.2e+157: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.05) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(kx, sin(ky)))); elseif (kx <= 6.2e+157) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.05) tmp = sin(th) * (sin(ky) / hypot(kx, sin(ky))); elseif (kx <= 6.2e+157) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.05], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 6.2e+157], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.05:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\mathbf{elif}\;kx \leq 6.2 \cdot 10^{+157}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if kx < 0.050000000000000003Initial program 91.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 kx around 0
Simplified71.2%
if 0.050000000000000003 < kx < 6.1999999999999994e157Initial 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 th around 0
Simplified54.7%
if 6.1999999999999994e157 < kx Initial program 99.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 ky around 0
Simplified50.9%
Final simplification66.8%
(FPCore (kx ky th)
:precision binary64
(if (<= kx 0.058)
(* (sin ky) (/ (sin th) (hypot (sin ky) kx)))
(if (<= kx 2.25e+157)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(* (sin ky) (/ (sin th) (hypot ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.058) {
tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx));
} else if (kx <= 2.25e+157) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 0.058) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), kx));
} else if (kx <= 2.25e+157) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 0.058: tmp = math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), kx)) elif kx <= 2.25e+157: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 0.058) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), kx))); elseif (kx <= 2.25e+157) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 0.058) tmp = sin(ky) * (sin(th) / hypot(sin(ky), kx)); elseif (kx <= 2.25e+157) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 0.058], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[kx, 2.25e+157], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 0.058:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;kx \leq 2.25 \cdot 10^{+157}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if kx < 0.0580000000000000029Initial program 91.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 kx around 0
Simplified71.1%
if 0.0580000000000000029 < kx < 2.24999999999999992e157Initial 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 th around 0
Simplified54.7%
if 2.24999999999999992e157 < kx Initial program 99.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 ky around 0
Simplified50.9%
(FPCore (kx ky th) :precision binary64 (if (<= th 1.05) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin ky) (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.05) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 1.05) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 1.05: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 1.05) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 1.05) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 1.05], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 1.05:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 1.05000000000000004Initial program 94.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.7%
Simplified99.7%
Taylor expanded in th around 0
Simplified69.0%
if 1.05000000000000004 < th Initial program 89.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 ky around 0
Simplified53.7%
(FPCore (kx ky th) :precision binary64 (if (<= th 3.8e-6) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 3.8e-6) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 3.8e-6) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 3.8e-6: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 3.8e-6) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 3.8e-6) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 3.8e-6], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if th < 3.8e-6Initial program 94.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.7%
Simplified99.7%
Taylor expanded in th around 0
Simplified69.0%
if 3.8e-6 < th Initial program 89.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.4%
Simplified99.4%
Taylor expanded in kx around 0
sin-lowering-sin.f6422.4%
Simplified22.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-44) (* ky (* (sin th) (/ (+ 1.0 (* ky (* ky -0.16666666666666666))) (sin kx)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-44) {
tmp = ky * (sin(th) * ((1.0 + (ky * (ky * -0.16666666666666666))) / 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) <= 5d-44) then
tmp = ky * (sin(th) * ((1.0d0 + (ky * (ky * (-0.16666666666666666d0)))) / 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) <= 5e-44) {
tmp = ky * (Math.sin(th) * ((1.0 + (ky * (ky * -0.16666666666666666))) / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 5e-44: tmp = ky * (math.sin(th) * ((1.0 + (ky * (ky * -0.16666666666666666))) / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-44) tmp = Float64(ky * Float64(sin(th) * Float64(Float64(1.0 + Float64(ky * Float64(ky * -0.16666666666666666))) / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 5e-44) tmp = ky * (sin(th) * ((1.0 + (ky * (ky * -0.16666666666666666))) / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(ky * N[(N[Sin[th], $MachinePrecision] * N[(N[(1.0 + N[(ky * N[(ky * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;ky \cdot \left(\sin th \cdot \frac{1 + ky \cdot \left(ky \cdot -0.16666666666666666\right)}{\sin kx}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 5.00000000000000039e-44Initial program 90.6%
Taylor expanded in ky around 0
sin-lowering-sin.f6437.7%
Simplified37.7%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.5%
Simplified35.5%
associate-/l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6435.5%
Applied egg-rr35.5%
if 5.00000000000000039e-44 < (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.f6463.7%
Simplified63.7%
Final simplification43.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.5e-113) (sin th) (* (sin th) (/ (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.5e-113) {
tmp = sin(th);
} else {
tmp = sin(th) * (sin(ky) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 3.5d-113) then
tmp = sin(th)
else
tmp = sin(th) * (sin(ky) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.5e-113) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.5e-113: tmp = math.sin(th) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.5e-113) tmp = sin(th); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.5e-113) tmp = sin(th); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.5e-113], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.5 \cdot 10^{-113}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if kx < 3.50000000000000029e-113Initial program 89.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.f6430.2%
Simplified30.2%
if 3.50000000000000029e-113 < kx Initial program 99.4%
Taylor expanded in ky around 0
sin-lowering-sin.f6442.2%
Simplified42.2%
Final simplification34.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.8e-113) (sin th) (* (sin ky) (/ (sin th) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.8e-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 <= 3.8d-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 <= 3.8e-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 <= 3.8e-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 <= 3.8e-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 <= 3.8e-113) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.8e-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 3.8 \cdot 10^{-113}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if kx < 3.79999999999999983e-113Initial program 89.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.f6430.2%
Simplified30.2%
if 3.79999999999999983e-113 < kx 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.6%
Simplified99.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6442.2%
Simplified42.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 2e-155) (* (sin th) (/ (* ky (+ 1.0 (* -0.16666666666666666 (* ky ky)))) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 2e-155) {
tmp = sin(th) * ((ky * (1.0 + (-0.16666666666666666 * (ky * 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 (sin(ky) <= 2d-155) then
tmp = sin(th) * ((ky * (1.0d0 + ((-0.16666666666666666d0) * (ky * 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 (Math.sin(ky) <= 2e-155) {
tmp = Math.sin(th) * ((ky * (1.0 + (-0.16666666666666666 * (ky * ky)))) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 2e-155: tmp = math.sin(th) * ((ky * (1.0 + (-0.16666666666666666 * (ky * ky)))) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 2e-155) tmp = Float64(sin(th) * Float64(Float64(ky * Float64(1.0 + Float64(-0.16666666666666666 * Float64(ky * ky)))) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 2e-155) tmp = sin(th) * ((ky * (1.0 + (-0.16666666666666666 * (ky * ky)))) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-155], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky * N[(1.0 + N[(-0.16666666666666666 * N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 2 \cdot 10^{-155}:\\
\;\;\;\;\sin th \cdot \frac{ky \cdot \left(1 + -0.16666666666666666 \cdot \left(ky \cdot ky\right)\right)}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 2.00000000000000003e-155Initial program 89.6%
Taylor expanded in ky around 0
sin-lowering-sin.f6437.6%
Simplified37.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6435.1%
Simplified35.1%
Taylor expanded in kx around 0
Simplified22.0%
if 2.00000000000000003e-155 < (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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6460.1%
Simplified60.1%
Final simplification35.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4e-44) (/ (sin th) (/ (sin kx) ky)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4e-44) {
tmp = sin(th) / (sin(kx) / ky);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4d-44) then
tmp = sin(th) / (sin(kx) / ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4e-44) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4e-44: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4e-44) tmp = Float64(sin(th) / Float64(sin(kx) / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4e-44) tmp = sin(th) / (sin(kx) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4e-44], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.99999999999999981e-44Initial program 90.6%
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.6%
Simplified99.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6435.8%
Simplified35.8%
if 3.99999999999999981e-44 < 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.f6434.0%
Simplified34.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.1e-44) (* (sin th) (/ ky (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.1e-44) {
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 (ky <= 3.1d-44) 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 (ky <= 3.1e-44) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.1e-44: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.1e-44) 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 (ky <= 3.1e-44) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.1e-44], 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}\;ky \leq 3.1 \cdot 10^{-44}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.09999999999999984e-44Initial program 90.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6435.8%
Simplified35.8%
if 3.09999999999999984e-44 < 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.f6434.0%
Simplified34.0%
Final simplification35.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.28e-6) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.28e-6) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 1.28d-6) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.28e-6) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.28e-6: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.28e-6) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.28e-6) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.28e-6], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.28 \cdot 10^{-6}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.28e-6Initial program 91.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 kx around 0
sin-lowering-sin.f6430.2%
Simplified30.2%
if 1.28e-6 < kx 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.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified50.2%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6423.7%
Simplified23.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.4e-186) (* ky (/ th (* kx (+ 1.0 (* -0.16666666666666666 (* kx kx)))))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.4e-186) {
tmp = ky * (th / (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 (ky <= 3.4d-186) then
tmp = ky * (th / (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 (ky <= 3.4e-186) {
tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx)))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.4e-186: tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.4e-186) tmp = Float64(ky * Float64(th / 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 (ky <= 3.4e-186) tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.4e-186], N[(ky * N[(th / 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}\;ky \leq 3.4 \cdot 10^{-186}:\\
\;\;\;\;ky \cdot \frac{th}{kx \cdot \left(1 + -0.16666666666666666 \cdot \left(kx \cdot kx\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.3999999999999999e-186Initial program 90.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.5%
Simplified99.5%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.0%
Simplified57.0%
Taylor expanded in th around 0
Simplified33.7%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.6%
Simplified17.6%
if 3.3999999999999999e-186 < ky Initial program 96.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
sin-lowering-sin.f6436.6%
Simplified36.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.4e-107) (* ky (/ th (* kx (+ 1.0 (* -0.16666666666666666 (* kx kx)))))) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.4e-107) {
tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx)))));
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 3.4d-107) then
tmp = ky * (th / (kx * (1.0d0 + ((-0.16666666666666666d0) * (kx * kx)))))
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.4e-107) {
tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx)))));
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.4e-107: tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.4e-107) tmp = Float64(ky * Float64(th / Float64(kx * Float64(1.0 + Float64(-0.16666666666666666 * Float64(kx * kx)))))); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.4e-107) tmp = ky * (th / (kx * (1.0 + (-0.16666666666666666 * (kx * kx))))); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.4e-107], N[(ky * N[(th / N[(kx * N[(1.0 + N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.4 \cdot 10^{-107}:\\
\;\;\;\;ky \cdot \frac{th}{kx \cdot \left(1 + -0.16666666666666666 \cdot \left(kx \cdot kx\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 3.39999999999999994e-107Initial program 90.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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.3%
Simplified59.3%
Taylor expanded in th around 0
Simplified35.0%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.0%
Simplified19.0%
if 3.39999999999999994e-107 < 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.f6434.2%
Simplified34.2%
Taylor expanded in th around 0
Simplified17.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 2.85e+25) (* th (+ 1.0 (* -0.16666666666666666 (* th th)))) (* -0.16666666666666666 (* th (* th th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.85e+25) {
tmp = th * (1.0 + (-0.16666666666666666 * (th * th)));
} else {
tmp = -0.16666666666666666 * (th * (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 <= 2.85d+25) then
tmp = th * (1.0d0 + ((-0.16666666666666666d0) * (th * th)))
else
tmp = (-0.16666666666666666d0) * (th * (th * th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2.85e+25) {
tmp = th * (1.0 + (-0.16666666666666666 * (th * th)));
} else {
tmp = -0.16666666666666666 * (th * (th * th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 2.85e+25: tmp = th * (1.0 + (-0.16666666666666666 * (th * th))) else: tmp = -0.16666666666666666 * (th * (th * th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 2.85e+25) tmp = Float64(th * Float64(1.0 + Float64(-0.16666666666666666 * Float64(th * th)))); else tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 2.85e+25) tmp = th * (1.0 + (-0.16666666666666666 * (th * th))); else tmp = -0.16666666666666666 * (th * (th * th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 2.85e+25], N[(th * N[(1.0 + N[(-0.16666666666666666 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.85 \cdot 10^{+25}:\\
\;\;\;\;th \cdot \left(1 + -0.16666666666666666 \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\end{array}
\end{array}
if kx < 2.8499999999999998e25Initial 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.f6429.6%
Simplified29.6%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6414.9%
Simplified14.9%
if 2.8499999999999998e25 < kx 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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f646.9%
Simplified6.9%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.3%
Simplified5.3%
Taylor expanded in th around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6421.1%
Simplified21.1%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.15e+31) th (* -0.16666666666666666 (* th (* th th)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.15e+31) {
tmp = th;
} else {
tmp = -0.16666666666666666 * (th * (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.15d+31) then
tmp = th
else
tmp = (-0.16666666666666666d0) * (th * (th * th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.15e+31) {
tmp = th;
} else {
tmp = -0.16666666666666666 * (th * (th * th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.15e+31: tmp = th else: tmp = -0.16666666666666666 * (th * (th * th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.15e+31) tmp = th; else tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.15e+31) tmp = th; else tmp = -0.16666666666666666 * (th * (th * th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.15e+31], th, N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.15 \cdot 10^{+31}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\end{array}
\end{array}
if kx < 1.15e31Initial 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.f6429.6%
Simplified29.6%
Taylor expanded in th around 0
Simplified15.0%
if 1.15e31 < kx 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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f646.9%
Simplified6.9%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.3%
Simplified5.3%
Taylor expanded in th around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6421.1%
Simplified21.1%
(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.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 kx around 0
sin-lowering-sin.f6424.7%
Simplified24.7%
Taylor expanded in th around 0
Simplified13.0%
herbie shell --seed 2024155
(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)))