
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 94.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%
associate-*r/N/A
+-commutativeN/A
pow2N/A
pow2N/A
associate-*l/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (* ky (+ 1.0 (* (* ky ky) -0.16666666666666666)))))
(if (<= (sin ky) -0.11)
(* (sin ky) (/ th (hypot (sin ky) kx)))
(if (<= (sin ky) 0.005)
(* 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.11) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 0.005) {
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.11) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 0.005) {
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.11: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 0.005: 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.11) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 0.005) 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.11) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.005) 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.11], 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.005], 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.11:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.005:\\
\;\;\;\;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.110000000000000001Initial 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 th around 0
Simplified48.4%
Taylor expanded in kx around 0
Simplified29.1%
if -0.110000000000000001 < (sin.f64 ky) < 0.0050000000000000001Initial program 89.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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.8%
Simplified96.8%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.4%
Simplified96.4%
if 0.0050000000000000001 < (sin.f64 ky) Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6463.9%
Simplified63.9%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(* (sin ky) (/ th (hypot (sin ky) kx)))
(if (<= (sin ky) 0.005)
(*
(sin th)
(/
ky
(hypot (sin kx) (* ky (+ 1.0 (* ky (* ky -0.16666666666666666)))))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 0.005) {
tmp = sin(th) * (ky / hypot(sin(kx), (ky * (1.0 + (ky * (ky * -0.16666666666666666))))));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.05) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 0.005) {
tmp = Math.sin(th) * (ky / Math.hypot(Math.sin(kx), (ky * (1.0 + (ky * (ky * -0.16666666666666666))))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.05: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 0.005: tmp = math.sin(th) * (ky / math.hypot(math.sin(kx), (ky * (1.0 + (ky * (ky * -0.16666666666666666)))))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.05) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 0.005) tmp = Float64(sin(th) * Float64(ky / hypot(sin(kx), Float64(ky * Float64(1.0 + Float64(ky * Float64(ky * -0.16666666666666666))))))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.05) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.005) tmp = sin(th) * (ky / hypot(sin(kx), (ky * (1.0 + (ky * (ky * -0.16666666666666666)))))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.05], 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.005], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[(ky * N[(1.0 + N[(ky * N[(ky * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.005:\\
\;\;\;\;\sin th \cdot \frac{ky}{\mathsf{hypot}\left(\sin kx, ky \cdot \left(1 + ky \cdot \left(ky \cdot -0.16666666666666666\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified50.9%
Taylor expanded in kx around 0
Simplified28.0%
if -0.050000000000000003 < (sin.f64 ky) < 0.0050000000000000001Initial program 89.1%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in ky around 0
Simplified97.9%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr98.0%
if 0.0050000000000000001 < (sin.f64 ky) Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6463.9%
Simplified63.9%
Final simplification72.8%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.05) (* (sin ky) (/ th (hypot (sin ky) kx))) (if (<= (sin ky) 0.09) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = sin(ky) * (th / hypot(sin(ky), kx));
} else if (sin(ky) <= 0.09) {
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.05) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 0.09) {
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.05: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 0.09: 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.05) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), kx))); elseif (sin(ky) <= 0.09) 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.05) tmp = sin(ky) * (th / hypot(sin(ky), kx)); elseif (sin(ky) <= 0.09) 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.05], 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.09], 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.05:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 0.09:\\
\;\;\;\;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.050000000000000003Initial program 99.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified50.9%
Taylor expanded in kx around 0
Simplified28.0%
if -0.050000000000000003 < (sin.f64 ky) < 0.089999999999999997Initial program 89.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.7%
Simplified96.7%
Taylor expanded in ky around 0
Simplified95.9%
Taylor expanded in ky around 0
Simplified96.8%
if 0.089999999999999997 < (sin.f64 ky) Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6464.9%
Simplified64.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.05) (/ (* (sin th) (- 6.0 (* ky ky))) (* ky ky)) (if (<= (sin ky) 0.09) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (sin(ky) <= 0.09) {
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.05) {
tmp = (Math.sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (Math.sin(ky) <= 0.09) {
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.05: tmp = (math.sin(th) * (6.0 - (ky * ky))) / (ky * ky) elif math.sin(ky) <= 0.09: 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.05) tmp = Float64(Float64(sin(th) * Float64(6.0 - Float64(ky * ky))) / Float64(ky * ky)); elseif (sin(ky) <= 0.09) 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.05) tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky); elseif (sin(ky) <= 0.09) 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.05], N[(N[(N[Sin[th], $MachinePrecision] * N[(6.0 - N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(ky * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.09], 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.05:\\
\;\;\;\;\frac{\sin th \cdot \left(6 - ky \cdot ky\right)}{ky \cdot ky}\\
\mathbf{elif}\;\sin ky \leq 0.09:\\
\;\;\;\;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.050000000000000003Initial 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 ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.3%
Simplified5.3%
Taylor expanded in ky around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.5%
Simplified4.5%
Taylor expanded in ky around 0
+-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.1%
Simplified23.1%
if -0.050000000000000003 < (sin.f64 ky) < 0.089999999999999997Initial program 89.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.7%
Simplified96.7%
Taylor expanded in ky around 0
Simplified95.9%
Taylor expanded in ky around 0
Simplified96.8%
if 0.089999999999999997 < (sin.f64 ky) Initial program 99.9%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6464.9%
Simplified64.9%
Final simplification71.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.1) (/ (* (sin th) (- 6.0 (* ky ky))) (* ky ky)) (if (<= (sin ky) 5e-36) (* (sin th) (/ (sin ky) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.1) {
tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (sin(ky) <= 5e-36) {
tmp = sin(th) * (sin(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.1d0)) then
tmp = (sin(th) * (6.0d0 - (ky * ky))) / (ky * ky)
else if (sin(ky) <= 5d-36) then
tmp = sin(th) * (sin(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.1) {
tmp = (Math.sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (Math.sin(ky) <= 5e-36) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.1: tmp = (math.sin(th) * (6.0 - (ky * ky))) / (ky * ky) elif math.sin(ky) <= 5e-36: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.1) tmp = Float64(Float64(sin(th) * Float64(6.0 - Float64(ky * ky))) / Float64(ky * ky)); elseif (sin(ky) <= 5e-36) tmp = Float64(sin(th) * Float64(sin(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.1) tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky); elseif (sin(ky) <= 5e-36) tmp = sin(th) * (sin(ky) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.1], N[(N[(N[Sin[th], $MachinePrecision] * N[(6.0 - N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(ky * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-36], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.1:\\
\;\;\;\;\frac{\sin th \cdot \left(6 - ky \cdot ky\right)}{ky \cdot ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-36}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.10000000000000001Initial 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-*.f645.3%
Simplified5.3%
Taylor expanded in ky around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.4%
Simplified4.4%
Taylor expanded in ky around 0
+-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.7%
Simplified23.7%
if -0.10000000000000001 < (sin.f64 ky) < 5.00000000000000004e-36Initial program 88.6%
Taylor expanded in ky around 0
sin-lowering-sin.f6452.0%
Simplified52.0%
if 5.00000000000000004e-36 < (sin.f64 ky) Initial program 99.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.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6460.8%
Simplified60.8%
Final simplification47.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.1) (/ (* (sin th) (- 6.0 (* ky ky))) (* ky ky)) (if (<= (sin ky) 5e-28) (* (sin ky) (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.1) {
tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (sin(ky) <= 5e-28) {
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.1d0)) then
tmp = (sin(th) * (6.0d0 - (ky * ky))) / (ky * ky)
else if (sin(ky) <= 5d-28) 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.1) {
tmp = (Math.sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (Math.sin(ky) <= 5e-28) {
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.1: tmp = (math.sin(th) * (6.0 - (ky * ky))) / (ky * ky) elif math.sin(ky) <= 5e-28: 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.1) tmp = Float64(Float64(sin(th) * Float64(6.0 - Float64(ky * ky))) / Float64(ky * ky)); elseif (sin(ky) <= 5e-28) 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.1) tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky); elseif (sin(ky) <= 5e-28) 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.1], N[(N[(N[Sin[th], $MachinePrecision] * N[(6.0 - N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(ky * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-28], 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.1:\\
\;\;\;\;\frac{\sin th \cdot \left(6 - ky \cdot ky\right)}{ky \cdot ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-28}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.10000000000000001Initial 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-*.f645.3%
Simplified5.3%
Taylor expanded in ky around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.4%
Simplified4.4%
Taylor expanded in ky around 0
+-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.7%
Simplified23.7%
if -0.10000000000000001 < (sin.f64 ky) < 5.0000000000000002e-28Initial program 88.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
sin-lowering-sin.f64N/A
sin-lowering-sin.f6451.6%
Simplified51.6%
if 5.0000000000000002e-28 < (sin.f64 ky) Initial program 99.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.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6461.6%
Simplified61.6%
Final simplification47.7%
(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 94.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.05) (/ (* (sin th) (- 6.0 (* ky ky))) (* ky ky)) (if (<= (sin ky) 5e-36) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (sin(ky) <= 5e-36) {
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.05d0)) then
tmp = (sin(th) * (6.0d0 - (ky * ky))) / (ky * ky)
else if (sin(ky) <= 5d-36) 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.05) {
tmp = (Math.sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (Math.sin(ky) <= 5e-36) {
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.05: tmp = (math.sin(th) * (6.0 - (ky * ky))) / (ky * ky) elif math.sin(ky) <= 5e-36: 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.05) tmp = Float64(Float64(sin(th) * Float64(6.0 - Float64(ky * ky))) / Float64(ky * ky)); elseif (sin(ky) <= 5e-36) 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.05) tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky); elseif (sin(ky) <= 5e-36) 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.05], N[(N[(N[Sin[th], $MachinePrecision] * N[(6.0 - N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(ky * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-36], 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.05:\\
\;\;\;\;\frac{\sin th \cdot \left(6 - ky \cdot ky\right)}{ky \cdot ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-36}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial 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 ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.3%
Simplified5.3%
Taylor expanded in ky around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.5%
Simplified4.5%
Taylor expanded in ky around 0
+-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.1%
Simplified23.1%
if -0.050000000000000003 < (sin.f64 ky) < 5.00000000000000004e-36Initial program 88.4%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6452.7%
Simplified52.7%
if 5.00000000000000004e-36 < (sin.f64 ky) Initial program 99.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.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6460.8%
Simplified60.8%
Final simplification47.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.05) (/ (* (sin th) (- 6.0 (* ky ky))) (* ky ky)) (if (<= (sin ky) 5e-28) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (sin(ky) <= 5e-28) {
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 (sin(ky) <= (-0.05d0)) then
tmp = (sin(th) * (6.0d0 - (ky * ky))) / (ky * ky)
else if (sin(ky) <= 5d-28) 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 (Math.sin(ky) <= -0.05) {
tmp = (Math.sin(th) * (6.0 - (ky * ky))) / (ky * ky);
} else if (Math.sin(ky) <= 5e-28) {
tmp = 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.05: tmp = (math.sin(th) * (6.0 - (ky * ky))) / (ky * ky) elif math.sin(ky) <= 5e-28: tmp = 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.05) tmp = Float64(Float64(sin(th) * Float64(6.0 - Float64(ky * ky))) / Float64(ky * ky)); elseif (sin(ky) <= 5e-28) 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 (sin(ky) <= -0.05) tmp = (sin(th) * (6.0 - (ky * ky))) / (ky * ky); elseif (sin(ky) <= 5e-28) tmp = 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.05], N[(N[(N[Sin[th], $MachinePrecision] * N[(6.0 - N[(ky * ky), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(ky * ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-28], 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}\;\sin ky \leq -0.05:\\
\;\;\;\;\frac{\sin th \cdot \left(6 - ky \cdot ky\right)}{ky \cdot ky}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-28}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial 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 ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f645.3%
Simplified5.3%
Taylor expanded in ky around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.5%
Simplified4.5%
Taylor expanded in ky around 0
+-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.1%
Simplified23.1%
if -0.050000000000000003 < (sin.f64 ky) < 5.0000000000000002e-28Initial program 88.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in ky around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Taylor expanded in ky around 0
Simplified98.8%
Taylor expanded in ky around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6452.3%
Simplified52.3%
if 5.0000000000000002e-28 < (sin.f64 ky) Initial program 99.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.7%
Simplified99.7%
Taylor expanded in kx around 0
sin-lowering-sin.f6461.6%
Simplified61.6%
Final simplification47.6%
(FPCore (kx ky th) :precision binary64 (if (<= th 7.8e-5) (* (/ (sin ky) (hypot (sin ky) (sin kx))) th) (* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 7.8e-5) {
tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * 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 <= 7.8e-5) {
tmp = (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * th;
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 7.8e-5: tmp = (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * 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 <= 7.8e-5) tmp = Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * 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 <= 7.8e-5) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * th; else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 7.8e-5], N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $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 7.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 7.7999999999999999e-5Initial program 94.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
associate-*r/N/A
+-commutativeN/A
pow2N/A
pow2N/A
associate-*l/N/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in th around 0
Simplified67.3%
if 7.7999999999999999e-5 < th Initial program 93.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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.1%
Simplified55.1%
Taylor expanded in ky around 0
Simplified54.9%
Taylor expanded in ky around 0
Simplified66.8%
(FPCore (kx ky th) :precision binary64 (if (<= th 1.5e-5) (* (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 <= 1.5e-5) {
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 <= 1.5e-5) {
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 <= 1.5e-5: 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 <= 1.5e-5) 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 <= 1.5e-5) 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, 1.5e-5], 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 1.5 \cdot 10^{-5}:\\
\;\;\;\;\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 < 1.50000000000000004e-5Initial program 94.6%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in th around 0
Simplified67.1%
if 1.50000000000000004e-5 < th Initial program 93.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
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.1%
Simplified55.1%
Taylor expanded in ky around 0
Simplified54.9%
Taylor expanded in ky around 0
Simplified66.8%
(FPCore (kx ky th) :precision binary64 (if (<= ky 7.8e-60) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7.8e-60) {
tmp = 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 (ky <= 7.8d-60) then
tmp = 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 (ky <= 7.8e-60) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 7.8e-60: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 7.8e-60) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 7.8e-60) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 7.8e-60], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 7.8 \cdot 10^{-60}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 7.8000000000000004e-60Initial program 91.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%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
hypot-defineN/A
rem-exp-logN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
rem-exp-logN/A
sin-lowering-sin.f6496.3%
Applied egg-rr96.3%
Taylor expanded in kx around 0
Simplified50.4%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6421.8%
Simplified21.8%
if 7.8000000000000004e-60 < ky Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.5%
Simplified37.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 7.6e-60) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 7.6e-60) {
tmp = ky * (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 <= 7.6d-60) then
tmp = ky * (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 <= 7.6e-60) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 7.6e-60: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 7.6e-60) tmp = Float64(ky * Float64(th / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 7.6e-60) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 7.6e-60], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 7.6 \cdot 10^{-60}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 7.59999999999999989e-60Initial program 91.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 th around 0
Simplified50.2%
Taylor expanded in ky around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6423.6%
Simplified23.6%
if 7.59999999999999989e-60 < ky Initial program 99.7%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6437.5%
Simplified37.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.1e-254) (* -0.16666666666666666 (* th (* th th))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.1e-254) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 3.1d-254) then
tmp = (-0.16666666666666666d0) * (th * (th * th))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.1e-254) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.1e-254: tmp = -0.16666666666666666 * (th * (th * th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.1e-254) tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 3.1e-254) tmp = -0.16666666666666666 * (th * (th * th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.1e-254], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.1 \cdot 10^{-254}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 3.09999999999999988e-254Initial program 91.5%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6415.4%
Simplified15.4%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f649.2%
Simplified9.2%
Taylor expanded in th around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6411.8%
Simplified11.8%
if 3.09999999999999988e-254 < ky Initial program 97.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.f6430.2%
Simplified30.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.4e-70) (* -0.16666666666666666 (* th (* th th))) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.4e-70) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 5.4d-70) then
tmp = (-0.16666666666666666d0) * (th * (th * th))
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.4e-70) {
tmp = -0.16666666666666666 * (th * (th * th));
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.4e-70: tmp = -0.16666666666666666 * (th * (th * th)) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.4e-70) tmp = Float64(-0.16666666666666666 * Float64(th * Float64(th * th))); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 5.4e-70) tmp = -0.16666666666666666 * (th * (th * th)); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.4e-70], N[(-0.16666666666666666 * N[(th * N[(th * th), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.4 \cdot 10^{-70}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(th \cdot \left(th \cdot th\right)\right)\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 5.4000000000000003e-70Initial program 91.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.f6416.2%
Simplified16.2%
Taylor expanded in th around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f649.5%
Simplified9.5%
Taylor expanded in th around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6413.0%
Simplified13.0%
if 5.4000000000000003e-70 < 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.f6436.5%
Simplified36.5%
Taylor expanded in th around 0
Simplified19.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 94.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.6%
Simplified99.6%
Taylor expanded in kx around 0
sin-lowering-sin.f6422.6%
Simplified22.6%
Taylor expanded in th around 0
Simplified12.9%
herbie shell --seed 2024164
(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)))