
(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 93.9%
+-commutative93.9%
unpow293.9%
unpow293.9%
hypot-undefine99.7%
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin th) -0.0004)
(* (sin ky) t_1)
(if (<= (sin th) 5e-19)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(if (<= (sin th) 0.17)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(if (<= (sin th) 0.44)
(* (sin ky) (fabs t_1))
(* (/ 1.0 (sin ky)) (fabs (* (sin ky) (sin th))))))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(th) <= -0.0004) {
tmp = sin(ky) * t_1;
} else if (sin(th) <= 5e-19) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else if (sin(th) <= 0.17) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else if (sin(th) <= 0.44) {
tmp = sin(ky) * fabs(t_1);
} else {
tmp = (1.0 / sin(ky)) * fabs((sin(ky) * sin(th)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(th) <= -0.0004) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(th) <= 5e-19) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else if (Math.sin(th) <= 0.17) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else if (Math.sin(th) <= 0.44) {
tmp = Math.sin(ky) * Math.abs(t_1);
} else {
tmp = (1.0 / Math.sin(ky)) * Math.abs((Math.sin(ky) * Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(th) <= -0.0004: tmp = math.sin(ky) * t_1 elif math.sin(th) <= 5e-19: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) elif math.sin(th) <= 0.17: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) elif math.sin(th) <= 0.44: tmp = math.sin(ky) * math.fabs(t_1) else: tmp = (1.0 / math.sin(ky)) * math.fabs((math.sin(ky) * math.sin(th))) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(th) <= -0.0004) tmp = Float64(sin(ky) * t_1); elseif (sin(th) <= 5e-19) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); elseif (sin(th) <= 0.17) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); elseif (sin(th) <= 0.44) tmp = Float64(sin(ky) * abs(t_1)); else tmp = Float64(Float64(1.0 / sin(ky)) * abs(Float64(sin(ky) * sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(th) <= -0.0004) tmp = sin(ky) * t_1; elseif (sin(th) <= 5e-19) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); elseif (sin(th) <= 0.17) tmp = sin(ky) * abs((sin(th) / sin(ky))); elseif (sin(th) <= 0.44) tmp = sin(ky) * abs(t_1); else tmp = (1.0 / sin(ky)) * abs((sin(ky) * sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[th], $MachinePrecision], -0.0004], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-19], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 0.17], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 0.44], N[(N[Sin[ky], $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[ky], $MachinePrecision]), $MachinePrecision] * N[Abs[N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin th \leq -0.0004:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{elif}\;\sin th \leq 0.17:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{elif}\;\sin th \leq 0.44:\\
\;\;\;\;\sin ky \cdot \left|t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin ky} \cdot \left|\sin ky \cdot \sin th\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -4.00000000000000019e-4Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/93.6%
associate-/l*93.7%
unpow293.7%
Simplified99.6%
Taylor expanded in ky around 0 26.5%
if -4.00000000000000019e-4 < (sin.f64 th) < 5.0000000000000004e-19Initial program 94.8%
unpow294.8%
sqr-neg94.8%
sin-neg94.8%
sin-neg94.8%
unpow294.8%
associate-*l/91.7%
associate-/l*94.7%
unpow294.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 94.5%
associate-*l/94.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-undefine99.7%
*-lft-identity99.7%
hypot-undefine94.7%
unpow294.7%
unpow294.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-define99.7%
Simplified99.7%
if 5.0000000000000004e-19 < (sin.f64 th) < 0.170000000000000012Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/100.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in kx around 0 19.6%
add-sqr-sqrt18.7%
sqrt-unprod54.2%
pow254.2%
Applied egg-rr54.2%
unpow254.2%
rem-sqrt-square54.4%
Simplified54.4%
if 0.170000000000000012 < (sin.f64 th) < 0.440000000000000002Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*100.0%
unpow2100.0%
Simplified99.8%
Taylor expanded in ky around 0 8.9%
add-sqr-sqrt7.9%
sqrt-unprod28.6%
pow228.6%
Applied egg-rr28.6%
unpow228.6%
rem-sqrt-square28.6%
Simplified28.6%
if 0.440000000000000002 < (sin.f64 th) Initial program 89.4%
unpow289.4%
sqr-neg89.4%
sin-neg89.4%
sin-neg89.4%
unpow289.4%
associate-*l/89.3%
associate-/l*89.3%
unpow289.3%
Simplified99.5%
Taylor expanded in kx around 0 27.6%
associate-*r/27.5%
clear-num27.4%
Applied egg-rr27.4%
associate-/r/27.5%
*-commutative27.5%
Simplified27.5%
add-sqr-sqrt26.6%
sqrt-unprod38.5%
pow238.5%
*-commutative38.5%
Applied egg-rr38.5%
unpow238.5%
rem-sqrt-square43.4%
*-commutative43.4%
Simplified43.4%
Final simplification64.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin th) -0.0004)
(* (sin ky) t_1)
(if (<= (sin th) 5e-19)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(if (or (<= (sin th) 0.17) (not (<= (sin th) 0.44)))
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(* (sin ky) (fabs t_1)))))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(th) <= -0.0004) {
tmp = sin(ky) * t_1;
} else if (sin(th) <= 5e-19) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else if ((sin(th) <= 0.17) || !(sin(th) <= 0.44)) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else {
tmp = sin(ky) * fabs(t_1);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(th) <= -0.0004) {
tmp = Math.sin(ky) * t_1;
} else if (Math.sin(th) <= 5e-19) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else if ((Math.sin(th) <= 0.17) || !(Math.sin(th) <= 0.44)) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else {
tmp = Math.sin(ky) * Math.abs(t_1);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(th) <= -0.0004: tmp = math.sin(ky) * t_1 elif math.sin(th) <= 5e-19: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) elif (math.sin(th) <= 0.17) or not (math.sin(th) <= 0.44): tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) else: tmp = math.sin(ky) * math.fabs(t_1) return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(th) <= -0.0004) tmp = Float64(sin(ky) * t_1); elseif (sin(th) <= 5e-19) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); elseif ((sin(th) <= 0.17) || !(sin(th) <= 0.44)) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); else tmp = Float64(sin(ky) * abs(t_1)); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(th) <= -0.0004) tmp = sin(ky) * t_1; elseif (sin(th) <= 5e-19) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); elseif ((sin(th) <= 0.17) || ~((sin(th) <= 0.44))) tmp = sin(ky) * abs((sin(th) / sin(ky))); else tmp = sin(ky) * abs(t_1); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[th], $MachinePrecision], -0.0004], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-19], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[th], $MachinePrecision], 0.17], N[Not[LessEqual[N[Sin[th], $MachinePrecision], 0.44]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin th \leq -0.0004:\\
\;\;\;\;\sin ky \cdot t\_1\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{elif}\;\sin th \leq 0.17 \lor \neg \left(\sin th \leq 0.44\right):\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|t\_1\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -4.00000000000000019e-4Initial program 93.6%
unpow293.6%
sqr-neg93.6%
sin-neg93.6%
sin-neg93.6%
unpow293.6%
associate-*l/93.6%
associate-/l*93.7%
unpow293.7%
Simplified99.6%
Taylor expanded in ky around 0 26.5%
if -4.00000000000000019e-4 < (sin.f64 th) < 5.0000000000000004e-19Initial program 94.8%
unpow294.8%
sqr-neg94.8%
sin-neg94.8%
sin-neg94.8%
unpow294.8%
associate-*l/91.7%
associate-/l*94.7%
unpow294.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 94.5%
associate-*l/94.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-undefine99.7%
*-lft-identity99.7%
hypot-undefine94.7%
unpow294.7%
unpow294.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-define99.7%
Simplified99.7%
if 5.0000000000000004e-19 < (sin.f64 th) < 0.170000000000000012 or 0.440000000000000002 < (sin.f64 th) Initial program 91.4%
unpow291.4%
sqr-neg91.4%
sin-neg91.4%
sin-neg91.4%
unpow291.4%
associate-*l/91.4%
associate-/l*91.3%
unpow291.3%
Simplified99.6%
Taylor expanded in kx around 0 26.0%
add-sqr-sqrt25.1%
sqrt-unprod40.9%
pow240.9%
Applied egg-rr40.9%
unpow240.9%
rem-sqrt-square45.5%
Simplified45.5%
if 0.170000000000000012 < (sin.f64 th) < 0.440000000000000002Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*100.0%
unpow2100.0%
Simplified99.8%
Taylor expanded in ky around 0 8.9%
add-sqr-sqrt7.9%
sqrt-unprod28.6%
pow228.6%
Applied egg-rr28.6%
unpow228.6%
rem-sqrt-square28.6%
Simplified28.6%
Final simplification64.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin th) -0.45)
(* (sin ky) (/ (sin th) (sin kx)))
(if (<= (sin th) -0.0004)
(* (sin th) (/ (sin ky) (sqrt (- 0.5 (* 0.5 (cos (* ky 2.0)))))))
(if (<= (sin th) 5e-19)
(/ (sin ky) (/ (hypot (sin kx) (sin ky)) th))
(* (sin ky) (fabs (/ (sin th) (sin ky))))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(th) <= -0.45) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if (sin(th) <= -0.0004) {
tmp = sin(th) * (sin(ky) / sqrt((0.5 - (0.5 * cos((ky * 2.0))))));
} else if (sin(th) <= 5e-19) {
tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th);
} else {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(th) <= -0.45) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(th) <= -0.0004) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sqrt((0.5 - (0.5 * Math.cos((ky * 2.0))))));
} else if (Math.sin(th) <= 5e-19) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(kx), Math.sin(ky)) / th);
} else {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(th) <= -0.45: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif math.sin(th) <= -0.0004: tmp = math.sin(th) * (math.sin(ky) / math.sqrt((0.5 - (0.5 * math.cos((ky * 2.0)))))) elif math.sin(th) <= 5e-19: tmp = math.sin(ky) / (math.hypot(math.sin(kx), math.sin(ky)) / th) else: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(th) <= -0.45) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif (sin(th) <= -0.0004) tmp = Float64(sin(th) * Float64(sin(ky) / sqrt(Float64(0.5 - Float64(0.5 * cos(Float64(ky * 2.0))))))); elseif (sin(th) <= 5e-19) tmp = Float64(sin(ky) / Float64(hypot(sin(kx), sin(ky)) / th)); else tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(th) <= -0.45) tmp = sin(ky) * (sin(th) / sin(kx)); elseif (sin(th) <= -0.0004) tmp = sin(th) * (sin(ky) / sqrt((0.5 - (0.5 * cos((ky * 2.0)))))); elseif (sin(th) <= 5e-19) tmp = sin(ky) / (hypot(sin(kx), sin(ky)) / th); else tmp = sin(ky) * abs((sin(th) / sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[th], $MachinePrecision], -0.45], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], -0.0004], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(0.5 - N[(0.5 * N[Cos[N[(ky * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-19], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin th \leq -0.45:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin th \leq -0.0004:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sqrt{0.5 - 0.5 \cdot \cos \left(ky \cdot 2\right)}}\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-19}:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin kx, \sin ky\right)}{th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.450000000000000011Initial program 92.3%
unpow292.3%
sqr-neg92.3%
sin-neg92.3%
sin-neg92.3%
unpow292.3%
associate-*l/92.1%
associate-/l*92.4%
unpow292.4%
Simplified99.5%
Taylor expanded in ky around 0 28.0%
if -0.450000000000000011 < (sin.f64 th) < -4.00000000000000019e-4Initial program 96.2%
unpow296.2%
sin-mult92.5%
Applied egg-rr92.5%
div-sub92.5%
+-inverses92.5%
+-inverses92.5%
+-inverses92.5%
cos-092.5%
metadata-eval92.5%
count-292.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in kx around 0 32.5%
if -4.00000000000000019e-4 < (sin.f64 th) < 5.0000000000000004e-19Initial program 94.8%
unpow294.8%
sqr-neg94.8%
sin-neg94.8%
sin-neg94.8%
unpow294.8%
associate-*l/91.7%
associate-/l*94.7%
unpow294.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 94.5%
associate-*l/94.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-undefine99.7%
*-lft-identity99.7%
hypot-undefine94.7%
unpow294.7%
unpow294.7%
+-commutative94.7%
unpow294.7%
unpow294.7%
hypot-define99.7%
Simplified99.7%
if 5.0000000000000004e-19 < (sin.f64 th) Initial program 92.5%
unpow292.5%
sqr-neg92.5%
sin-neg92.5%
sin-neg92.5%
unpow292.5%
associate-*l/92.4%
associate-/l*92.4%
unpow292.4%
Simplified99.6%
Taylor expanded in kx around 0 25.9%
add-sqr-sqrt25.0%
sqrt-unprod39.6%
pow239.6%
Applied egg-rr39.6%
unpow239.6%
rem-sqrt-square43.6%
Simplified43.6%
Final simplification65.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.06)
(* (sin ky) (fabs t_1))
(if (<= (sin kx) 2e-64)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(* (sin ky) t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.06) {
tmp = sin(ky) * fabs(t_1);
} else if (sin(kx) <= 2e-64) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else {
tmp = sin(ky) * t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.06d0)) then
tmp = sin(ky) * abs(t_1)
else if (sin(kx) <= 2d-64) then
tmp = sin(ky) * abs((sin(th) / sin(ky)))
else
tmp = sin(ky) * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.06) {
tmp = Math.sin(ky) * Math.abs(t_1);
} else if (Math.sin(kx) <= 2e-64) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else {
tmp = Math.sin(ky) * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.06: tmp = math.sin(ky) * math.fabs(t_1) elif math.sin(kx) <= 2e-64: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) else: tmp = math.sin(ky) * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.06) tmp = Float64(sin(ky) * abs(t_1)); elseif (sin(kx) <= 2e-64) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); else tmp = Float64(sin(ky) * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.06) tmp = sin(ky) * abs(t_1); elseif (sin(kx) <= 2e-64) tmp = sin(ky) * abs((sin(th) / sin(ky))); else tmp = sin(ky) * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.06], N[(N[Sin[ky], $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-64], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.06:\\
\;\;\;\;\sin ky \cdot \left|t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.059999999999999998Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 15.6%
add-sqr-sqrt3.8%
sqrt-unprod40.8%
pow240.8%
Applied egg-rr40.8%
unpow240.8%
rem-sqrt-square42.1%
Simplified42.1%
if -0.059999999999999998 < (sin.f64 kx) < 1.99999999999999993e-64Initial program 88.0%
unpow288.0%
sqr-neg88.0%
sin-neg88.0%
sin-neg88.0%
unpow288.0%
associate-*l/85.7%
associate-/l*87.8%
unpow287.8%
Simplified99.7%
Taylor expanded in kx around 0 39.3%
add-sqr-sqrt22.1%
sqrt-unprod30.2%
pow230.2%
Applied egg-rr30.2%
unpow230.2%
rem-sqrt-square41.7%
Simplified41.7%
if 1.99999999999999993e-64 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 57.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.06)
(* (sin ky) (fabs t_1))
(if (<= (sin kx) 1e-71) (sin th) (* (sin ky) t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.06) {
tmp = sin(ky) * fabs(t_1);
} else if (sin(kx) <= 1e-71) {
tmp = sin(th);
} else {
tmp = sin(ky) * t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.06d0)) then
tmp = sin(ky) * abs(t_1)
else if (sin(kx) <= 1d-71) then
tmp = sin(th)
else
tmp = sin(ky) * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.06) {
tmp = Math.sin(ky) * Math.abs(t_1);
} else if (Math.sin(kx) <= 1e-71) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.06: tmp = math.sin(ky) * math.fabs(t_1) elif math.sin(kx) <= 1e-71: tmp = math.sin(th) else: tmp = math.sin(ky) * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.06) tmp = Float64(sin(ky) * abs(t_1)); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = Float64(sin(ky) * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.06) tmp = sin(ky) * abs(t_1); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = sin(ky) * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.06], N[(N[Sin[ky], $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-71], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.06:\\
\;\;\;\;\sin ky \cdot \left|t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-71}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.059999999999999998Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 15.6%
add-sqr-sqrt3.8%
sqrt-unprod40.8%
pow240.8%
Applied egg-rr40.8%
unpow240.8%
rem-sqrt-square42.1%
Simplified42.1%
if -0.059999999999999998 < (sin.f64 kx) < 9.9999999999999992e-72Initial program 87.8%
unpow287.8%
sqr-neg87.8%
sin-neg87.8%
sin-neg87.8%
unpow287.8%
associate-*l/85.5%
associate-/l*87.6%
unpow287.6%
Simplified99.7%
Taylor expanded in kx around 0 40.0%
if 9.9999999999999992e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 56.9%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.06) (fabs (* (sin th) (/ (sin ky) (sin kx)))) (if (<= (sin kx) 1e-71) (sin th) (* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.06) {
tmp = fabs((sin(th) * (sin(ky) / sin(kx))));
} else if (sin(kx) <= 1e-71) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.06d0)) then
tmp = abs((sin(th) * (sin(ky) / sin(kx))))
else if (sin(kx) <= 1d-71) then
tmp = sin(th)
else
tmp = sin(ky) * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.06) {
tmp = Math.abs((Math.sin(th) * (Math.sin(ky) / Math.sin(kx))));
} else if (Math.sin(kx) <= 1e-71) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.06: tmp = math.fabs((math.sin(th) * (math.sin(ky) / math.sin(kx)))) elif math.sin(kx) <= 1e-71: tmp = math.sin(th) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.06) tmp = abs(Float64(sin(th) * Float64(sin(ky) / sin(kx)))); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.06) tmp = abs((sin(th) * (sin(ky) / sin(kx)))); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.06], N[Abs[N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-71], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.06:\\
\;\;\;\;\left|\sin th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-71}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.059999999999999998Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 15.6%
add-sqr-sqrt12.9%
sqrt-unprod26.1%
pow226.1%
Applied egg-rr26.1%
unpow226.1%
rem-sqrt-square38.2%
associate-*r/38.1%
associate-*l/38.2%
Simplified38.2%
if -0.059999999999999998 < (sin.f64 kx) < 9.9999999999999992e-72Initial program 87.8%
unpow287.8%
sqr-neg87.8%
sin-neg87.8%
sin-neg87.8%
unpow287.8%
associate-*l/85.5%
associate-/l*87.6%
unpow287.6%
Simplified99.7%
Taylor expanded in kx around 0 40.0%
if 9.9999999999999992e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 56.9%
Final simplification44.3%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.06)
(* ky (fabs t_1))
(if (<= (sin kx) 1e-71) (sin th) (* (sin ky) t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.06) {
tmp = ky * fabs(t_1);
} else if (sin(kx) <= 1e-71) {
tmp = sin(th);
} else {
tmp = sin(ky) * t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.06d0)) then
tmp = ky * abs(t_1)
else if (sin(kx) <= 1d-71) then
tmp = sin(th)
else
tmp = sin(ky) * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.06) {
tmp = ky * Math.abs(t_1);
} else if (Math.sin(kx) <= 1e-71) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.06: tmp = ky * math.fabs(t_1) elif math.sin(kx) <= 1e-71: tmp = math.sin(th) else: tmp = math.sin(ky) * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.06) tmp = Float64(ky * abs(t_1)); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = Float64(sin(ky) * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.06) tmp = ky * abs(t_1); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = sin(ky) * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.06], N[(ky * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-71], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.06:\\
\;\;\;\;ky \cdot \left|t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-71}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.059999999999999998Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 16.1%
associate-/l*16.1%
Simplified16.1%
add-sqr-sqrt3.8%
sqrt-unprod40.8%
pow240.8%
Applied egg-rr35.9%
unpow240.8%
rem-sqrt-square42.1%
Simplified36.8%
if -0.059999999999999998 < (sin.f64 kx) < 9.9999999999999992e-72Initial program 87.8%
unpow287.8%
sqr-neg87.8%
sin-neg87.8%
sin-neg87.8%
unpow287.8%
associate-*l/85.5%
associate-/l*87.6%
unpow287.6%
Simplified99.7%
Taylor expanded in kx around 0 40.0%
if 9.9999999999999992e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 56.9%
(FPCore (kx ky th) :precision binary64 (* (sin ky) (/ (sin th) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(ky) * (sin(th) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(ky) * (Math.sin(th) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(ky) * (math.sin(th) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(ky) * Float64(sin(th) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(ky) * (sin(th) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/92.5%
associate-/l*93.9%
unpow293.9%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.06)
(* ky (fabs t_1))
(if (<= (sin kx) 1e-71) (sin th) (* ky t_1)))))
double code(double kx, double ky, double th) {
double t_1 = sin(th) / sin(kx);
double tmp;
if (sin(kx) <= -0.06) {
tmp = ky * fabs(t_1);
} else if (sin(kx) <= 1e-71) {
tmp = sin(th);
} else {
tmp = ky * t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = sin(th) / sin(kx)
if (sin(kx) <= (-0.06d0)) then
tmp = ky * abs(t_1)
else if (sin(kx) <= 1d-71) then
tmp = sin(th)
else
tmp = ky * t_1
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = Math.sin(th) / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.06) {
tmp = ky * Math.abs(t_1);
} else if (Math.sin(kx) <= 1e-71) {
tmp = Math.sin(th);
} else {
tmp = ky * t_1;
}
return tmp;
}
def code(kx, ky, th): t_1 = math.sin(th) / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.06: tmp = ky * math.fabs(t_1) elif math.sin(kx) <= 1e-71: tmp = math.sin(th) else: tmp = ky * t_1 return tmp
function code(kx, ky, th) t_1 = Float64(sin(th) / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.06) tmp = Float64(ky * abs(t_1)); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = Float64(ky * t_1); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = sin(th) / sin(kx); tmp = 0.0; if (sin(kx) <= -0.06) tmp = ky * abs(t_1); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = ky * t_1; end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.06], N[(ky * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-71], N[Sin[th], $MachinePrecision], N[(ky * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sin th}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.06:\\
\;\;\;\;ky \cdot \left|t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-71}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.059999999999999998Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 16.1%
associate-/l*16.1%
Simplified16.1%
add-sqr-sqrt3.8%
sqrt-unprod40.8%
pow240.8%
Applied egg-rr35.9%
unpow240.8%
rem-sqrt-square42.1%
Simplified36.8%
if -0.059999999999999998 < (sin.f64 kx) < 9.9999999999999992e-72Initial program 87.8%
unpow287.8%
sqr-neg87.8%
sin-neg87.8%
sin-neg87.8%
unpow287.8%
associate-*l/85.5%
associate-/l*87.6%
unpow287.6%
Simplified99.7%
Taylor expanded in kx around 0 40.0%
if 9.9999999999999992e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 47.8%
associate-/l*49.1%
Simplified49.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.22) (fabs (* th (/ (sin ky) (sin kx)))) (if (<= (sin kx) 1e-71) (sin th) (* ky (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.22) {
tmp = fabs((th * (sin(ky) / sin(kx))));
} else if (sin(kx) <= 1e-71) {
tmp = sin(th);
} else {
tmp = ky * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.22d0)) then
tmp = abs((th * (sin(ky) / sin(kx))))
else if (sin(kx) <= 1d-71) then
tmp = sin(th)
else
tmp = ky * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.22) {
tmp = Math.abs((th * (Math.sin(ky) / Math.sin(kx))));
} else if (Math.sin(kx) <= 1e-71) {
tmp = Math.sin(th);
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.22: tmp = math.fabs((th * (math.sin(ky) / math.sin(kx)))) elif math.sin(kx) <= 1e-71: tmp = math.sin(th) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.22) tmp = abs(Float64(th * Float64(sin(ky) / sin(kx)))); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = Float64(ky * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.22) tmp = abs((th * (sin(ky) / sin(kx)))); elseif (sin(kx) <= 1e-71) tmp = sin(th); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.22], N[Abs[N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-71], N[Sin[th], $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.22:\\
\;\;\;\;\left|th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-71}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.220000000000000001Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in ky around 0 15.0%
Taylor expanded in th around 0 15.7%
add-sqr-sqrt12.6%
sqrt-unprod18.0%
pow218.0%
*-commutative18.0%
associate-/l*18.0%
Applied egg-rr18.0%
unpow218.0%
rem-sqrt-square25.0%
associate-*r/24.9%
associate-*l/25.0%
*-commutative25.0%
Simplified25.0%
if -0.220000000000000001 < (sin.f64 kx) < 9.9999999999999992e-72Initial program 88.2%
unpow288.2%
sqr-neg88.2%
sin-neg88.2%
sin-neg88.2%
unpow288.2%
associate-*l/86.0%
associate-/l*88.1%
unpow288.1%
Simplified99.7%
Taylor expanded in kx around 0 38.8%
if 9.9999999999999992e-72 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/98.1%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in ky around 0 47.8%
associate-/l*49.1%
Simplified49.1%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (fabs (sin th)) (if (<= (sin ky) 5e-194) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-194) {
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.01d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-194) 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.01) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-194) {
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.01: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-194: 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.01) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-194) 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.01) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-194) 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.01], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-194], 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.01:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-194}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.8%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.5%
sqrt-unprod27.5%
pow227.5%
Applied egg-rr27.5%
unpow227.5%
rem-sqrt-square33.8%
associate-*r/33.8%
*-rgt-identity33.8%
times-frac33.9%
/-rgt-identity33.9%
*-inverses33.9%
*-lft-identity33.9%
Simplified33.9%
if -0.0100000000000000002 < (sin.f64 ky) < 5.0000000000000002e-194Initial program 86.5%
unpow286.5%
sqr-neg86.5%
sin-neg86.5%
sin-neg86.5%
unpow286.5%
associate-*l/83.2%
associate-/l*86.6%
unpow286.6%
Simplified99.7%
Taylor expanded in ky around 0 42.8%
associate-/l*47.1%
Simplified47.1%
if 5.0000000000000002e-194 < (sin.f64 ky) Initial program 96.2%
unpow296.2%
sqr-neg96.2%
sin-neg96.2%
sin-neg96.2%
unpow296.2%
associate-*l/95.3%
associate-/l*96.2%
unpow296.2%
Simplified99.6%
Taylor expanded in kx around 0 53.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (fabs (sin th)) (if (<= (sin ky) 5e-194) (* ky (/ (sin th) kx)) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-194) {
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 (sin(ky) <= (-0.01d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-194) 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 (Math.sin(ky) <= -0.01) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-194) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.01: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-194: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.01) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-194) 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 (sin(ky) <= -0.01) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-194) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.01], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-194], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.01:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-194}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0100000000000000002Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.8%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 2.5%
add-sqr-sqrt1.5%
sqrt-unprod27.5%
pow227.5%
Applied egg-rr27.5%
unpow227.5%
rem-sqrt-square33.8%
associate-*r/33.8%
*-rgt-identity33.8%
times-frac33.9%
/-rgt-identity33.9%
*-inverses33.9%
*-lft-identity33.9%
Simplified33.9%
if -0.0100000000000000002 < (sin.f64 ky) < 5.0000000000000002e-194Initial program 86.5%
unpow286.5%
sqr-neg86.5%
sin-neg86.5%
sin-neg86.5%
unpow286.5%
associate-*l/83.2%
associate-/l*86.6%
unpow286.6%
Simplified99.7%
Taylor expanded in ky around 0 42.8%
associate-/l*47.1%
Simplified47.1%
Taylor expanded in kx around 0 25.8%
associate-/l*30.1%
Simplified30.1%
if 5.0000000000000002e-194 < (sin.f64 ky) Initial program 96.2%
unpow296.2%
sqr-neg96.2%
sin-neg96.2%
sin-neg96.2%
unpow296.2%
associate-*l/95.3%
associate-/l*96.2%
unpow296.2%
Simplified99.6%
Taylor expanded in kx around 0 53.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 5e-194) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 5e-194) {
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 (sin(ky) <= 5d-194) 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 (Math.sin(ky) <= 5e-194) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= 5e-194: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= 5e-194) 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 (sin(ky) <= 5e-194) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-194], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq 5 \cdot 10^{-194}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 5.0000000000000002e-194Initial program 92.4%
unpow292.4%
sqr-neg92.4%
sin-neg92.4%
sin-neg92.4%
unpow292.4%
associate-*l/90.6%
associate-/l*92.4%
unpow292.4%
Simplified99.6%
Taylor expanded in ky around 0 25.1%
associate-/l*27.5%
Simplified27.5%
Taylor expanded in kx around 0 15.8%
associate-/l*18.2%
Simplified18.2%
if 5.0000000000000002e-194 < (sin.f64 ky) Initial program 96.2%
unpow296.2%
sqr-neg96.2%
sin-neg96.2%
sin-neg96.2%
unpow296.2%
associate-*l/95.3%
associate-/l*96.2%
unpow296.2%
Simplified99.6%
Taylor expanded in kx around 0 53.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.6e-193) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.6e-193) {
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 <= 4.6d-193) 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 <= 4.6e-193) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.6e-193: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.6e-193) 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 <= 4.6e-193) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.6e-193], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.6 \cdot 10^{-193}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 4.60000000000000017e-193Initial program 92.5%
unpow292.5%
sqr-neg92.5%
sin-neg92.5%
sin-neg92.5%
unpow292.5%
associate-*l/90.7%
associate-/l*92.5%
unpow292.5%
Simplified99.6%
Taylor expanded in ky around 0 24.8%
associate-/l*27.2%
Simplified27.2%
Taylor expanded in th around 0 14.7%
associate-/l*17.0%
Simplified17.0%
if 4.60000000000000017e-193 < ky Initial program 96.3%
unpow296.3%
sqr-neg96.3%
sin-neg96.3%
sin-neg96.3%
unpow296.3%
associate-*l/95.3%
associate-/l*96.1%
unpow296.1%
Simplified99.6%
Taylor expanded in kx around 0 38.3%
(FPCore (kx ky th) :precision binary64 (sin th))
double code(double kx, double ky, double th) {
return 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(th)
end function
public static double code(double kx, double ky, double th) {
return Math.sin(th);
}
def code(kx, ky, th): return math.sin(th)
function code(kx, ky, th) return sin(th) end
function tmp = code(kx, ky, th) tmp = sin(th); end
code[kx_, ky_, th_] := N[Sin[th], $MachinePrecision]
\begin{array}{l}
\\
\sin th
\end{array}
Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/92.5%
associate-/l*93.9%
unpow293.9%
Simplified99.6%
Taylor expanded in kx around 0 24.0%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.9%
unpow293.9%
sqr-neg93.9%
sin-neg93.9%
sin-neg93.9%
unpow293.9%
associate-*l/92.5%
associate-/l*93.9%
unpow293.9%
Simplified99.6%
Taylor expanded in kx around 0 24.0%
Taylor expanded in th around 0 14.3%
herbie shell --seed 2024103
(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)))