
(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 22 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.7%
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 ky) -0.03)
(/ th (/ (hypot (sin ky) kx) (sin ky)))
(if (<= (sin ky) 4e-7)
(*
(/ (sin th) (hypot ky (sin kx)))
(* ky (+ 1.0 (* -0.16666666666666666 (* ky ky)))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.03) {
tmp = th / (hypot(sin(ky), kx) / sin(ky));
} else if (sin(ky) <= 4e-7) {
tmp = (sin(th) / hypot(ky, sin(kx))) * (ky * (1.0 + (-0.16666666666666666 * (ky * ky))));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.03) {
tmp = th / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else if (Math.sin(ky) <= 4e-7) {
tmp = (Math.sin(th) / Math.hypot(ky, Math.sin(kx))) * (ky * (1.0 + (-0.16666666666666666 * (ky * ky))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.03: tmp = th / (math.hypot(math.sin(ky), kx) / math.sin(ky)) elif math.sin(ky) <= 4e-7: tmp = (math.sin(th) / math.hypot(ky, math.sin(kx))) * (ky * (1.0 + (-0.16666666666666666 * (ky * ky)))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.03) tmp = Float64(th / Float64(hypot(sin(ky), kx) / sin(ky))); elseif (sin(ky) <= 4e-7) tmp = Float64(Float64(sin(th) / hypot(ky, sin(kx))) * Float64(ky * Float64(1.0 + Float64(-0.16666666666666666 * Float64(ky * ky))))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.03) tmp = th / (hypot(sin(ky), kx) / sin(ky)); elseif (sin(ky) <= 4e-7) tmp = (sin(th) / hypot(ky, sin(kx))) * (ky * (1.0 + (-0.16666666666666666 * (ky * ky)))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.03], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 4e-7], N[(N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(ky * N[(1.0 + N[(-0.16666666666666666 * N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.03:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)} \cdot \left(ky \cdot \left(1 + -0.16666666666666666 \cdot \left(ky \cdot ky\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.029999999999999999Initial program 99.7%
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
+-commutativeN/A
/-lowering-/.f64N/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 th around 0
Simplified47.6%
Taylor expanded in kx around 0
Simplified23.2%
if -0.029999999999999999 < (sin.f64 ky) < 3.9999999999999998e-7Initial program 87.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
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.6%
Simplified99.6%
if 3.9999999999999998e-7 < (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.f6460.3%
Simplified60.3%
Final simplification68.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.03) (/ th (/ (hypot (sin ky) kx) (sin ky))) (if (<= (sin ky) 0.02) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.03) {
tmp = th / (hypot(sin(ky), kx) / sin(ky));
} else if (sin(ky) <= 0.02) {
tmp = 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.03) {
tmp = th / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else if (Math.sin(ky) <= 0.02) {
tmp = 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.03: tmp = th / (math.hypot(math.sin(ky), kx) / math.sin(ky)) elif math.sin(ky) <= 0.02: tmp = 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.03) tmp = Float64(th / Float64(hypot(sin(ky), kx) / sin(ky))); elseif (sin(ky) <= 0.02) tmp = Float64(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.03) tmp = th / (hypot(sin(ky), kx) / sin(ky)); elseif (sin(ky) <= 0.02) tmp = 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.03], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.02], N[(ky * 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.03:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.02:\\
\;\;\;\;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.029999999999999999Initial program 99.7%
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
+-commutativeN/A
/-lowering-/.f64N/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 th around 0
Simplified47.6%
Taylor expanded in kx around 0
Simplified23.2%
if -0.029999999999999999 < (sin.f64 ky) < 0.0200000000000000004Initial program 87.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.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified98.9%
Taylor expanded in ky around 0
Simplified98.9%
if 0.0200000000000000004 < (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.f6461.0%
Simplified61.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.03) (* (sin ky) (/ th (hypot (sin ky) kx))) (if (<= (sin ky) 0.02) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.03) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 0.02) {
tmp = 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.03) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 0.02) {
tmp = 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.03: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 0.02: tmp = 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.03) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 0.02) tmp = Float64(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.03) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.02) tmp = 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.03], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.02], N[(ky * 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.03:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.02:\\
\;\;\;\;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.029999999999999999Initial 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.5%
Simplified99.5%
Taylor expanded in th 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
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.6%
Simplified47.6%
Taylor expanded in kx around 0
Simplified22.5%
Taylor expanded in th around 0
Simplified23.2%
if -0.029999999999999999 < (sin.f64 ky) < 0.0200000000000000004Initial program 87.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.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified98.9%
Taylor expanded in ky around 0
Simplified98.9%
if 0.0200000000000000004 < (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.f6461.0%
Simplified61.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (* (sin ky) (/ (sin th) (sin kx))) (if (<= (sin ky) 0.02) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if (sin(ky) <= 0.02) {
tmp = 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.02) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(ky) <= 0.02) {
tmp = 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.02: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif math.sin(ky) <= 0.02: tmp = 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.02) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif (sin(ky) <= 0.02) tmp = Float64(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.02) tmp = sin(ky) * (sin(th) / sin(kx)); elseif (sin(ky) <= 0.02) tmp = 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.02], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.02], N[(ky * 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.02:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 0.02:\\
\;\;\;\;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.0200000000000000004Initial 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.5%
Simplified99.5%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f646.5%
Simplified6.5%
if -0.0200000000000000004 < (sin.f64 ky) < 0.0200000000000000004Initial program 87.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.6%
Simplified99.6%
Taylor expanded in ky around 0
Simplified98.9%
Taylor expanded in ky around 0
Simplified98.9%
if 0.0200000000000000004 < (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.f6461.0%
Simplified61.0%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.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%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.095)
(*
(sin ky)
(/
(*
th
(+
1.0
(*
th
(* th (+ -0.16666666666666666 (* 0.008333333333333333 (* th th)))))))
(hypot (sin ky) (sin kx))))
(* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.095) {
tmp = sin(ky) * ((th * (1.0 + (th * (th * (-0.16666666666666666 + (0.008333333333333333 * (th * th))))))) / hypot(sin(ky), sin(kx)));
} else {
tmp = ky * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.095) {
tmp = Math.sin(ky) * ((th * (1.0 + (th * (th * (-0.16666666666666666 + (0.008333333333333333 * (th * th))))))) / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.095: tmp = math.sin(ky) * ((th * (1.0 + (th * (th * (-0.16666666666666666 + (0.008333333333333333 * (th * th))))))) / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = ky * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.095) tmp = Float64(sin(ky) * Float64(Float64(th * Float64(1.0 + Float64(th * Float64(th * Float64(-0.16666666666666666 + Float64(0.008333333333333333 * Float64(th * th))))))) / hypot(sin(ky), sin(kx)))); else tmp = Float64(ky * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.095) tmp = sin(ky) * ((th * (1.0 + (th * (th * (-0.16666666666666666 + (0.008333333333333333 * (th * th))))))) / hypot(sin(ky), sin(kx))); else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.095], N[(N[Sin[ky], $MachinePrecision] * N[(N[(th * N[(1.0 + N[(th * N[(th * N[(-0.16666666666666666 + N[(0.008333333333333333 * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.095:\\
\;\;\;\;\sin ky \cdot \frac{th \cdot \left(1 + th \cdot \left(th \cdot \left(-0.16666666666666666 + 0.008333333333333333 \cdot \left(th \cdot th\right)\right)\right)\right)}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 0.095000000000000001Initial program 92.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 th 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
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.0%
Simplified63.0%
if 0.095000000000000001 < th Initial program 98.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
Simplified48.1%
Taylor expanded in ky around 0
Simplified61.7%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.024)
(*
(sin ky)
(/
(* th (+ 1.0 (* th (* th -0.16666666666666666))))
(hypot (sin ky) (sin kx))))
(* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.024) {
tmp = sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / hypot(sin(ky), sin(kx)));
} else {
tmp = ky * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.024) {
tmp = Math.sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.024: tmp = math.sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = ky * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.024) tmp = Float64(sin(ky) * Float64(Float64(th * Float64(1.0 + Float64(th * Float64(th * -0.16666666666666666)))) / hypot(sin(ky), sin(kx)))); else tmp = Float64(ky * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.024) tmp = sin(ky) * ((th * (1.0 + (th * (th * -0.16666666666666666)))) / hypot(sin(ky), sin(kx))); else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.024], N[(N[Sin[ky], $MachinePrecision] * N[(N[(th * N[(1.0 + N[(th * N[(th * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.024:\\
\;\;\;\;\sin ky \cdot \frac{th \cdot \left(1 + th \cdot \left(th \cdot -0.16666666666666666\right)\right)}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 0.024Initial program 92.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 th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6462.9%
Simplified62.9%
if 0.024 < th Initial program 98.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
Simplified48.1%
Taylor expanded in ky around 0
Simplified61.7%
Final simplification62.6%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.0025) (* (/ (sin ky) (hypot (sin kx) (sin ky))) th) (* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0025) {
tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th;
} else {
tmp = ky * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.0025) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(kx), Math.sin(ky))) * th;
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.0025: tmp = (math.sin(ky) / math.hypot(math.sin(kx), math.sin(ky))) * th else: tmp = ky * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.0025) tmp = Float64(Float64(sin(ky) / hypot(sin(kx), sin(ky))) * th); else tmp = Float64(ky * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.0025) tmp = (sin(ky) / hypot(sin(kx), sin(ky))) * th; else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.0025], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * th), $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.0025:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin kx, \sin ky\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 0.00250000000000000005Initial program 92.1%
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 th around 0
Simplified63.0%
if 0.00250000000000000005 < th Initial program 98.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
Simplified48.1%
Taylor expanded in ky around 0
Simplified61.7%
(FPCore (kx ky th) :precision binary64 (if (<= th 0.00225) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00225) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = ky * (sin(th) / hypot(ky, sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00225) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 0.00225: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = ky * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 0.00225) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(ky * Float64(sin(th) / hypot(ky, sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 0.00225) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00225], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 0.00225:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 0.00224999999999999983Initial program 92.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 th around 0
Simplified62.9%
if 0.00224999999999999983 < th Initial program 98.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
Simplified48.1%
Taylor expanded in ky around 0
Simplified61.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-96) (* (sin ky) (/ (sin th) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-96) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= 1d-96) then
tmp = sin(ky) * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 1e-96) {
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) <= 1e-96: 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) <= 1e-96) 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) <= 1e-96) 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], 1e-96], 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 10^{-96}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999991e-97Initial 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 ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6430.0%
Simplified30.0%
if 9.9999999999999991e-97 < (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.f6458.1%
Simplified58.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-96) (* (sin ky) (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-96) {
tmp = sin(ky) * (sin(th) / kx);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= 1d-96) then
tmp = sin(ky) * (sin(th) / kx)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 1e-96) {
tmp = Math.sin(ky) * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-96: tmp = math.sin(ky) * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-96) tmp = Float64(sin(ky) * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-96) tmp = sin(ky) * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-96], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-96}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999991e-97Initial program 91.0%
Taylor expanded in ky around 0
sin-lowering-sin.f6430.0%
Simplified30.0%
Taylor expanded in kx around 0
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6419.8%
Simplified19.8%
if 9.9999999999999991e-97 < (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.f6458.1%
Simplified58.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-96) (/ (sin th) (* kx (+ (/ (* -0.16666666666666666 (* kx kx)) ky) (/ 1.0 ky)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 1e-96) {
tmp = sin(th) / (kx * (((-0.16666666666666666 * (kx * kx)) / ky) + (1.0 / ky)));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= 1d-96) then
tmp = sin(th) / (kx * ((((-0.16666666666666666d0) * (kx * kx)) / ky) + (1.0d0 / ky)))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= 1e-96) {
tmp = Math.sin(th) / (kx * (((-0.16666666666666666 * (kx * kx)) / ky) + (1.0 / ky)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 1e-96: tmp = math.sin(th) / (kx * (((-0.16666666666666666 * (kx * kx)) / ky) + (1.0 / ky))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 1e-96) tmp = Float64(sin(th) / Float64(kx * Float64(Float64(Float64(-0.16666666666666666 * Float64(kx * kx)) / ky) + Float64(1.0 / ky)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= 1e-96) tmp = sin(th) / (kx * (((-0.16666666666666666 * (kx * kx)) / ky) + (1.0 / ky))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-96], N[(N[Sin[th], $MachinePrecision] / N[(kx * N[(N[(N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision] + N[(1.0 / ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-96}:\\
\;\;\;\;\frac{\sin th}{kx \cdot \left(\frac{-0.16666666666666666 \cdot \left(kx \cdot kx\right)}{ky} + \frac{1}{ky}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999991e-97Initial program 91.0%
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
+-commutativeN/A
/-lowering-/.f64N/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.f6428.5%
Simplified28.5%
Taylor expanded in kx around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6419.5%
Simplified19.5%
if 9.9999999999999991e-97 < (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.f6458.1%
Simplified58.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 1e-96) (* (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-96) {
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-96) 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-96) {
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-96: 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-96) tmp = Float64(sin(th) * Float64(Float64(ky / 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-96) 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-96], N[(N[Sin[th], $MachinePrecision] * N[(N[(ky / kx), $MachinePrecision] / N[(1.0 + N[(-0.16666666666666666 * N[(kx * kx), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 10^{-96}:\\
\;\;\;\;\sin th \cdot \frac{\frac{ky}{kx}}{1 + -0.16666666666666666 \cdot \left(kx \cdot kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 9.9999999999999991e-97Initial program 91.0%
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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6461.1%
Simplified61.1%
Taylor expanded in ky around 0
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.5%
Simplified19.5%
if 9.9999999999999991e-97 < (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.f6458.1%
Simplified58.1%
Final simplification31.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 6e-96) (* ky (/ (sin th) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6e-96) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 6d-96) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6e-96) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 6e-96: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 6e-96) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 6e-96) tmp = ky * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 6e-96], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 6 \cdot 10^{-96}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 6e-96Initial 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
+-commutativeN/A
/-lowering-/.f64N/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 ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6427.8%
Simplified27.8%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6427.9%
Applied egg-rr27.9%
if 6e-96 < 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.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.0%
Simplified37.0%
Final simplification30.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5e-96) (* (sin th) (/ ky (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5e-96) {
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 <= 5d-96) 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 <= 5e-96) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5e-96: 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 <= 5e-96) 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 <= 5e-96) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5e-96], 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 5 \cdot 10^{-96}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 4.99999999999999995e-96Initial program 91.2%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6427.8%
Simplified27.8%
if 4.99999999999999995e-96 < 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.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.0%
Simplified37.0%
Final simplification30.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 8.6e-97) (/ (sin th) (/ kx ky)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 8.6e-97) {
tmp = sin(th) / (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 <= 8.6d-97) then
tmp = sin(th) / (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 <= 8.6e-97) {
tmp = Math.sin(th) / (kx / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 8.6e-97: tmp = math.sin(th) / (kx / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 8.6e-97) tmp = Float64(sin(th) / Float64(kx / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 8.6e-97) tmp = sin(th) / (kx / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 8.6e-97], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 8.6 \cdot 10^{-97}:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 8.6e-97Initial 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
+-commutativeN/A
/-lowering-/.f64N/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 ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6427.8%
Simplified27.8%
Taylor expanded in kx around 0
/-lowering-/.f6419.2%
Simplified19.2%
if 8.6e-97 < 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.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.0%
Simplified37.0%
(FPCore (kx ky th) :precision binary64 (if (<= kx 5.8e-15) (sin th) (/ th (/ (sin kx) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 5.8e-15) {
tmp = sin(th);
} else {
tmp = th / (sin(kx) / ky);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 5.8d-15) then
tmp = sin(th)
else
tmp = th / (sin(kx) / ky)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 5.8e-15) {
tmp = Math.sin(th);
} else {
tmp = th / (Math.sin(kx) / ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 5.8e-15: tmp = math.sin(th) else: tmp = th / (math.sin(kx) / ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 5.8e-15) tmp = sin(th); else tmp = Float64(th / Float64(sin(kx) / ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 5.8e-15) tmp = sin(th); else tmp = th / (sin(kx) / ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 5.8e-15], N[Sin[th], $MachinePrecision], N[(th / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 5.8 \cdot 10^{-15}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{th}{\frac{\sin kx}{ky}}\\
\end{array}
\end{array}
if kx < 5.80000000000000037e-15Initial 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.8%
Simplified29.8%
if 5.80000000000000037e-15 < kx Initial 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.4%
Simplified99.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
/-lowering-/.f64N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.4%
Applied egg-rr99.4%
Taylor expanded in th around 0
Simplified58.1%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6422.7%
Simplified22.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 5.4e-15) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 5.4e-15) {
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 <= 5.4d-15) 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 <= 5.4e-15) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 5.4e-15: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 5.4e-15) 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 <= 5.4e-15) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 5.4e-15], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 5.4 \cdot 10^{-15}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 5.40000000000000018e-15Initial 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.8%
Simplified29.8%
if 5.40000000000000018e-15 < kx Initial 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.4%
Simplified99.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
/-lowering-/.f64N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.4%
Applied egg-rr99.4%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6432.7%
Simplified32.7%
Taylor expanded in th around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6422.7%
Simplified22.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.8e-15) (sin th) (* ky (/ th kx))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-15) {
tmp = sin(th);
} else {
tmp = ky * (th / kx);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6.8d-15) then
tmp = sin(th)
else
tmp = ky * (th / kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-15) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.8e-15: tmp = math.sin(th) else: tmp = ky * (th / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.8e-15) tmp = sin(th); else tmp = Float64(ky * Float64(th / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.8e-15) tmp = sin(th); else tmp = ky * (th / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.8e-15], N[Sin[th], $MachinePrecision], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.8 \cdot 10^{-15}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\end{array}
\end{array}
if kx < 6.8000000000000001e-15Initial 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.8%
Simplified29.8%
if 6.8000000000000001e-15 < 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.4%
Simplified99.4%
Taylor expanded in th 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
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.9%
Simplified58.9%
Taylor expanded in kx around 0
Simplified19.3%
Taylor expanded in th around 0
Simplified19.5%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6418.0%
Simplified18.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.8e-96) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.8e-96) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 5.8d-96) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.8e-96) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.8e-96: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.8e-96) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 5.8e-96) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.8e-96], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.8 \cdot 10^{-96}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 5.79999999999999987e-96Initial 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 th 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
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.3%
Simplified47.3%
Taylor expanded in kx around 0
Simplified31.2%
Taylor expanded in th around 0
Simplified31.8%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6414.8%
Simplified14.8%
if 5.79999999999999987e-96 < 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.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.0%
Simplified37.0%
Taylor expanded in th around 0
Simplified17.9%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.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.f6424.6%
Simplified24.6%
Taylor expanded in th around 0
Simplified13.2%
herbie shell --seed 2024150
(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)))