
(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 19 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 92.8%
Taylor expanded in kx around inf
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* ky (+ 1.0 (* (* ky ky) -0.16666666666666666)))))
(if (<= (sin ky) -0.02)
(- 0.0 (sin th))
(if (<= (sin ky) 0.03)
(/ t_1 (/ (hypot (sin kx) t_1) (sin th)))
(if (<= (sin ky) 0.385)
(sin th)
(* (sin ky) (/ th (hypot (sin ky) (sin kx)))))))))
double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 0.03) {
tmp = t_1 / (hypot(sin(kx), t_1) / sin(th));
} else if (sin(ky) <= 0.385) {
tmp = sin(th);
} else {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 0.03) {
tmp = t_1 / (Math.hypot(Math.sin(kx), t_1) / Math.sin(th));
} else if (Math.sin(ky) <= 0.385) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)) tmp = 0 if math.sin(ky) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 0.03: tmp = t_1 / (math.hypot(math.sin(kx), t_1) / math.sin(th)) elif math.sin(ky) <= 0.385: tmp = math.sin(th) else: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) return tmp
function code(kx, ky, th) t_1 = Float64(ky * Float64(1.0 + Float64(Float64(ky * ky) * -0.16666666666666666))) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 0.03) tmp = Float64(t_1 / Float64(hypot(sin(kx), t_1) / sin(th))); elseif (sin(ky) <= 0.385) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)); tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 0.03) tmp = t_1 / (hypot(sin(kx), t_1) / sin(th)); elseif (sin(ky) <= 0.385) tmp = sin(th); else tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(ky * N[(1.0 + N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.03], N[(t$95$1 / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + t$95$1 ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.385], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ky \cdot \left(1 + \left(ky \cdot ky\right) \cdot -0.16666666666666666\right)\\
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 0.03:\\
\;\;\;\;\frac{t\_1}{\frac{\mathsf{hypot}\left(\sin kx, t\_1\right)}{\sin th}}\\
\mathbf{elif}\;\sin ky \leq 0.385:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 0.029999999999999999Initial program 86.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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.2%
Simplified98.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
Applied egg-rr98.2%
if 0.029999999999999999 < (sin.f64 ky) < 0.38500000000000001Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6474.1%
Simplified74.1%
if 0.38500000000000001 < (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 th around 0
Simplified45.2%
(FPCore (kx ky th) :precision binary64 (if (<= (pow (sin kx) 2.0) 5e-14) (* (sin th) (/ (sin ky) (hypot 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 (pow(sin(kx), 2.0) <= 5e-14) {
tmp = sin(th) * (sin(ky) / hypot(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 (Math.pow(Math.sin(kx), 2.0) <= 5e-14) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(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 math.pow(math.sin(kx), 2.0) <= 5e-14: tmp = math.sin(th) * (math.sin(ky) / math.hypot(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 ((sin(kx) ^ 2.0) <= 5e-14) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(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 ((sin(kx) ^ 2.0) <= 5e-14) tmp = sin(th) * (sin(ky) / hypot(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[N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision], 5e-14], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[kx ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[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}\;{\sin kx}^{2} \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(kx, \sin ky\right)}\\
\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 (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) < 5.0000000000000002e-14Initial program 85.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.9%
Simplified99.9%
Taylor expanded in kx around 0
Simplified99.9%
if 5.0000000000000002e-14 < (pow.f64 (sin.f64 kx) #s(literal 2 binary64)) Initial program 99.4%
Taylor expanded in ky around 0
sin-lowering-sin.f6440.0%
Simplified40.0%
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-*.f6464.6%
Applied egg-rr64.6%
Final simplification81.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* ky (+ 1.0 (* (* ky ky) -0.16666666666666666)))))
(if (<= (sin ky) -0.02)
(- 0.0 (sin th))
(if (<= (sin ky) 0.03)
(/ t_1 (/ (hypot (sin kx) t_1) (sin th)))
(sin th)))))
double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 0.03) {
tmp = t_1 / (hypot(sin(kx), t_1) / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 0.03) {
tmp = t_1 / (Math.hypot(Math.sin(kx), t_1) / Math.sin(th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)) tmp = 0 if math.sin(ky) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 0.03: tmp = t_1 / (math.hypot(math.sin(kx), t_1) / math.sin(th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = Float64(ky * Float64(1.0 + Float64(Float64(ky * ky) * -0.16666666666666666))) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 0.03) tmp = Float64(t_1 / Float64(hypot(sin(kx), t_1) / sin(th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)); tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 0.03) tmp = t_1 / (hypot(sin(kx), t_1) / sin(th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(ky * N[(1.0 + N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.03], N[(t$95$1 / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + t$95$1 ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ky \cdot \left(1 + \left(ky \cdot ky\right) \cdot -0.16666666666666666\right)\\
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 0.03:\\
\;\;\;\;\frac{t\_1}{\frac{\mathsf{hypot}\left(\sin kx, t\_1\right)}{\sin th}}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 0.029999999999999999Initial program 86.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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.2%
Simplified98.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
Applied egg-rr98.2%
if 0.029999999999999999 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6459.7%
Simplified59.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* ky (+ 1.0 (* (* ky ky) -0.16666666666666666)))))
(if (<= (sin ky) -0.02)
(- 0.0 (sin th))
(if (<= (sin ky) 0.03)
(* t_1 (/ (sin th) (hypot t_1 (sin kx))))
(sin th)))))
double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 0.03) {
tmp = t_1 * (sin(th) / hypot(t_1, sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666));
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 0.03) {
tmp = t_1 * (Math.sin(th) / Math.hypot(t_1, Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)) tmp = 0 if math.sin(ky) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 0.03: tmp = t_1 * (math.sin(th) / math.hypot(t_1, math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = Float64(ky * Float64(1.0 + Float64(Float64(ky * ky) * -0.16666666666666666))) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 0.03) tmp = Float64(t_1 * Float64(sin(th) / hypot(t_1, sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = ky * (1.0 + ((ky * ky) * -0.16666666666666666)); tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 0.03) tmp = t_1 * (sin(th) / hypot(t_1, sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(ky * N[(1.0 + N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.03], N[(t$95$1 * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[t$95$1 ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := ky \cdot \left(1 + \left(ky \cdot ky\right) \cdot -0.16666666666666666\right)\\
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 0.03:\\
\;\;\;\;t\_1 \cdot \frac{\sin th}{\mathsf{hypot}\left(t\_1, \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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 0.029999999999999999Initial program 86.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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.2%
Simplified98.2%
if 0.029999999999999999 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6459.7%
Simplified59.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(- 0.0 (sin th))
(if (<= (sin ky) 1e-12)
(*
ky
(/
(sin th)
(hypot (* ky (+ 1.0 (* (* ky ky) -0.16666666666666666))) (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 1e-12) {
tmp = ky * (sin(th) / hypot((ky * (1.0 + ((ky * ky) * -0.16666666666666666))), 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 = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 1e-12) {
tmp = ky * (Math.sin(th) / Math.hypot((ky * (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) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 1e-12: tmp = ky * (math.sin(th) / math.hypot((ky * (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) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 1e-12) tmp = Float64(ky * Float64(sin(th) / hypot(Float64(ky * Float64(1.0 + Float64(Float64(ky * 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) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 1e-12) tmp = ky * (sin(th) / hypot((ky * (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], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-12], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[(ky * N[(1.0 + N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 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:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 10^{-12}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky \cdot \left(1 + \left(ky \cdot ky\right) \cdot -0.16666666666666666\right), \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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 9.9999999999999998e-13Initial program 86.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 ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.9%
Simplified98.9%
Taylor expanded in ky around 0
Simplified98.9%
if 9.9999999999999998e-13 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6460.9%
Simplified60.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (- 0.0 (sin th)) (if (<= (sin ky) 2e-50) (/ (sin th) (/ (sin kx) (sin ky))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-50) {
tmp = sin(th) / (sin(kx) / sin(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) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-50) then
tmp = sin(th) / (sin(kx) / sin(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) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-50) {
tmp = Math.sin(th) / (Math.sin(kx) / Math.sin(ky));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-50: tmp = math.sin(th) / (math.sin(kx) / math.sin(ky)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 2e-50) tmp = Float64(sin(th) / Float64(sin(kx) / sin(ky))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-50) tmp = sin(th) / (sin(kx) / sin(ky)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-50], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 2.00000000000000002e-50Initial program 85.8%
Taylor expanded in ky around 0
sin-lowering-sin.f6448.6%
Simplified48.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6448.7%
Applied egg-rr48.7%
if 2.00000000000000002e-50 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (- 0.0 (sin th)) (if (<= (sin ky) 2e-50) (* (sin ky) (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-50) {
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) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-50) 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) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-50) {
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.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-50: 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.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 2e-50) 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.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-50) 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.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-50], 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.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 2.00000000000000002e-50Initial program 85.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6448.6%
Simplified48.6%
if 2.00000000000000002e-50 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6462.0%
Simplified62.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 92.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.02)
(- 0.0 (sin th))
(if (<= (sin ky) 2e-50)
(*
(* ky (+ 1.0 (* (* ky ky) -0.16666666666666666)))
(/ (sin th) (sin kx)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-50) {
tmp = (ky * (1.0 + ((ky * ky) * -0.16666666666666666))) * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-50) then
tmp = (ky * (1.0d0 + ((ky * ky) * (-0.16666666666666666d0)))) * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-50) {
tmp = (ky * (1.0 + ((ky * ky) * -0.16666666666666666))) * (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.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-50: tmp = (ky * (1.0 + ((ky * ky) * -0.16666666666666666))) * (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.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 2e-50) tmp = Float64(Float64(ky * Float64(1.0 + Float64(Float64(ky * ky) * -0.16666666666666666))) * 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.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-50) tmp = (ky * (1.0 + ((ky * ky) * -0.16666666666666666))) * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-50], N[(N[(ky * N[(1.0 + N[(N[(ky * ky), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $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.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\left(ky \cdot \left(1 + \left(ky \cdot ky\right) \cdot -0.16666666666666666\right)\right) \cdot \frac{\sin th}{\sin kx}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 2.00000000000000002e-50Initial program 85.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6448.6%
Simplified48.6%
if 2.00000000000000002e-50 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (- 0.0 (sin th)) (if (<= (sin ky) 2e-50) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-50) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-50) then
tmp = sin(th) * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-50) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-50: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 2e-50) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-50) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-50], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 2.00000000000000002e-50Initial program 85.8%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6448.6%
Simplified48.6%
if 2.00000000000000002e-50 < (sin.f64 ky) Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6462.0%
Simplified62.0%
Final simplification55.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (- 0.0 (sin th)) (if (<= (sin ky) 2e-74) (* (sin ky) (/ (sin th) kx)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-74) {
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) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-74) 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) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-74) {
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) <= -0.02: tmp = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-74: 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) <= -0.02) tmp = Float64(0.0 - sin(th)); elseif (sin(ky) <= 2e-74) 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) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-74) 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], -0.02], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-74], 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 -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-74}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{kx}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 1.99999999999999992e-74Initial program 85.3%
Taylor expanded in ky around 0
sin-lowering-sin.f6448.2%
Simplified48.2%
Taylor expanded in kx around 0
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6428.7%
Simplified28.7%
if 1.99999999999999992e-74 < (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.f6459.7%
Simplified59.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.02) (- 0.0 (sin th)) (if (<= (sin ky) 2e-74) (* th (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.02) {
tmp = 0.0 - sin(th);
} else if (sin(ky) <= 2e-74) {
tmp = th * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.02d0)) then
tmp = 0.0d0 - sin(th)
else if (sin(ky) <= 2d-74) then
tmp = th * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.02) {
tmp = 0.0 - Math.sin(th);
} else if (Math.sin(ky) <= 2e-74) {
tmp = th * (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 = 0.0 - math.sin(th) elif math.sin(ky) <= 2e-74: tmp = th * (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(0.0 - sin(th)); elseif (sin(ky) <= 2e-74) tmp = Float64(th * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.02) tmp = 0.0 - sin(th); elseif (sin(ky) <= 2e-74) tmp = th * (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[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-74], N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.02:\\
\;\;\;\;0 - \sin th\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-74}:\\
\;\;\;\;th \cdot \frac{ky}{\sin kx}\\
\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.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f648.0%
Simplified8.0%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6412.4%
Simplified12.4%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6461.3%
Simplified61.3%
if -0.0200000000000000004 < (sin.f64 ky) < 1.99999999999999992e-74Initial program 85.3%
Taylor expanded in th around 0
Simplified41.6%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6425.3%
Simplified25.3%
if 1.99999999999999992e-74 < (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.f6459.7%
Simplified59.7%
Final simplification43.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.6e-59) (sin th) (if (<= kx 2.35e-7) (- 0.0 (sin th)) (* ky (/ th (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.6e-59) {
tmp = sin(th);
} else if (kx <= 2.35e-7) {
tmp = 0.0 - sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 6.6d-59) then
tmp = sin(th)
else if (kx <= 2.35d-7) then
tmp = 0.0d0 - sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.6e-59) {
tmp = Math.sin(th);
} else if (kx <= 2.35e-7) {
tmp = 0.0 - Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.6e-59: tmp = math.sin(th) elif kx <= 2.35e-7: tmp = 0.0 - math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.6e-59) tmp = sin(th); elseif (kx <= 2.35e-7) tmp = Float64(0.0 - sin(th)); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.6e-59) tmp = sin(th); elseif (kx <= 2.35e-7) tmp = 0.0 - sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.6e-59], N[Sin[th], $MachinePrecision], If[LessEqual[kx, 2.35e-7], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.6 \cdot 10^{-59}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;kx \leq 2.35 \cdot 10^{-7}:\\
\;\;\;\;0 - \sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 6.59999999999999964e-59Initial program 89.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.f6429.8%
Simplified29.8%
if 6.59999999999999964e-59 < kx < 2.35e-7Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.3%
Simplified99.3%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.3%
Simplified34.3%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6449.8%
Simplified49.8%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6445.0%
Simplified45.0%
if 2.35e-7 < kx Initial program 99.3%
Taylor expanded in th around 0
Simplified44.5%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6417.5%
Simplified17.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.46e-233) (/ th (/ kx ky)) (if (<= ky 3.65e+49) (sin th) (- 0.0 (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.46e-233) {
tmp = th / (kx / ky);
} else if (ky <= 3.65e+49) {
tmp = sin(th);
} else {
tmp = 0.0 - sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.46d-233) then
tmp = th / (kx / ky)
else if (ky <= 3.65d+49) then
tmp = sin(th)
else
tmp = 0.0d0 - sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.46e-233) {
tmp = th / (kx / ky);
} else if (ky <= 3.65e+49) {
tmp = Math.sin(th);
} else {
tmp = 0.0 - Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.46e-233: tmp = th / (kx / ky) elif ky <= 3.65e+49: tmp = math.sin(th) else: tmp = 0.0 - math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.46e-233) tmp = Float64(th / Float64(kx / ky)); elseif (ky <= 3.65e+49) tmp = sin(th); else tmp = Float64(0.0 - sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.46e-233) tmp = th / (kx / ky); elseif (ky <= 3.65e+49) tmp = sin(th); else tmp = 0.0 - sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.46e-233], N[(th / N[(kx / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 3.65e+49], N[Sin[th], $MachinePrecision], N[(0.0 - N[Sin[th], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.46 \cdot 10^{-233}:\\
\;\;\;\;\frac{th}{\frac{kx}{ky}}\\
\mathbf{elif}\;ky \leq 3.65 \cdot 10^{+49}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;0 - \sin th\\
\end{array}
\end{array}
if ky < 1.46000000000000011e-233Initial program 91.9%
Taylor expanded in th around 0
Simplified45.7%
Taylor expanded in kx around 0
unpow2N/A
*-lowering-*.f6431.2%
Simplified31.2%
Taylor expanded in ky around 0
/-lowering-/.f6413.4%
Simplified13.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6413.5%
Applied egg-rr13.5%
if 1.46000000000000011e-233 < ky < 3.65000000000000007e49Initial program 90.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.5%
Simplified99.5%
Taylor expanded in kx around 0
sin-lowering-sin.f6433.4%
Simplified33.4%
if 3.65000000000000007e49 < 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 ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.7%
Simplified4.7%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f646.3%
Simplified6.3%
Taylor expanded in ky around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f6432.6%
Simplified32.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.6e-6) (sin th) (/ (* ky th) kx)))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.6e-6) {
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.6d-6) 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.6e-6) {
tmp = Math.sin(th);
} else {
tmp = (ky * th) / kx;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.6e-6: tmp = math.sin(th) else: tmp = (ky * th) / kx return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.6e-6) tmp = sin(th); else tmp = Float64(Float64(ky * th) / kx); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.6e-6) tmp = sin(th); else tmp = (ky * th) / kx; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.6e-6], N[Sin[th], $MachinePrecision], N[(N[(ky * th), $MachinePrecision] / kx), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot th}{kx}\\
\end{array}
\end{array}
if kx < 6.60000000000000034e-6Initial 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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.6%
Simplified30.6%
if 6.60000000000000034e-6 < kx Initial program 99.3%
Taylor expanded in th around 0
Simplified44.5%
Taylor expanded in kx around 0
unpow2N/A
*-lowering-*.f6415.2%
Simplified15.2%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
*-lowering-*.f6415.3%
Simplified15.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 6.8e-6) th (/ (* ky th) kx)))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 6.8e-6) {
tmp = 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-6) then
tmp = 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-6) {
tmp = th;
} else {
tmp = (ky * th) / kx;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 6.8e-6: tmp = th else: tmp = (ky * th) / kx return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 6.8e-6) tmp = th; else tmp = Float64(Float64(ky * th) / kx); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 6.8e-6) tmp = th; else tmp = (ky * th) / kx; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 6.8e-6], th, N[(N[(ky * th), $MachinePrecision] / kx), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 6.8 \cdot 10^{-6}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot th}{kx}\\
\end{array}
\end{array}
if kx < 6.80000000000000012e-6Initial 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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.6%
Simplified30.6%
Taylor expanded in th around 0
Simplified16.1%
if 6.80000000000000012e-6 < kx Initial program 99.3%
Taylor expanded in th around 0
Simplified44.5%
Taylor expanded in kx around 0
unpow2N/A
*-lowering-*.f6415.2%
Simplified15.2%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
*-lowering-*.f6415.3%
Simplified15.3%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.9e-7) th (* ky (/ th kx))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.9e-7) {
tmp = 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 <= 3.9d-7) then
tmp = 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 <= 3.9e-7) {
tmp = th;
} else {
tmp = ky * (th / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.9e-7: tmp = th else: tmp = ky * (th / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.9e-7) tmp = th; else tmp = Float64(ky * Float64(th / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.9e-7) tmp = th; else tmp = ky * (th / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.9e-7], th, N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\end{array}
\end{array}
if kx < 3.90000000000000025e-7Initial 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.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6430.6%
Simplified30.6%
Taylor expanded in th around 0
Simplified16.1%
if 3.90000000000000025e-7 < kx Initial program 99.3%
Taylor expanded in th around 0
Simplified44.5%
Taylor expanded in kx around 0
unpow2N/A
*-lowering-*.f6415.2%
Simplified15.2%
Taylor expanded in ky around 0
/-lowering-/.f6415.1%
Simplified15.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6415.3%
Applied egg-rr15.3%
(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 92.8%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6425.3%
Simplified25.3%
Taylor expanded in th around 0
Simplified13.6%
herbie shell --seed 2024141
(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)))