
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (/ (sin th) (/ (hypot (sin ky) (sin kx)) (sin ky))))
double code(double kx, double ky, double th) {
return sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
}
def code(kx, ky, th): return math.sin(th) / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky))
function code(kx, ky, th) return Float64(sin(th) / Float64(hypot(sin(ky), sin(kx)) / sin(ky))) end
function tmp = code(kx, ky, th) tmp = sin(th) / (hypot(sin(ky), sin(kx)) / sin(ky)); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}
\end{array}
Initial program 90.8%
unpow290.8%
sqr-neg90.8%
sin-neg90.8%
sin-neg90.8%
unpow290.8%
associate-*l/88.5%
associate-/l*90.8%
+-commutative90.8%
unpow290.8%
sin-neg90.8%
sin-neg90.8%
Simplified99.6%
associate-*r/95.1%
hypot-undefine88.5%
unpow288.5%
unpow288.5%
+-commutative88.5%
associate-*l/90.8%
*-commutative90.8%
clear-num90.7%
un-div-inv90.8%
+-commutative90.8%
unpow290.8%
unpow290.8%
hypot-undefine99.6%
Applied egg-rr99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ (sin th) (sin kx))))
(if (<= (sin kx) -0.1)
(fabs (* ky t_1))
(if (<= (sin kx) 1e-205)
(sin th)
(if (<= (sin kx) 5e-142)
(* (sin th) (/ (sin ky) kx))
(if (<= (sin kx) 5e-94) (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.1) {
tmp = fabs((ky * t_1));
} else if (sin(kx) <= 1e-205) {
tmp = sin(th);
} else if (sin(kx) <= 5e-142) {
tmp = sin(th) * (sin(ky) / kx);
} else if (sin(kx) <= 5e-94) {
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.1d0)) then
tmp = abs((ky * t_1))
else if (sin(kx) <= 1d-205) then
tmp = sin(th)
else if (sin(kx) <= 5d-142) then
tmp = sin(th) * (sin(ky) / kx)
else if (sin(kx) <= 5d-94) 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.1) {
tmp = Math.abs((ky * t_1));
} else if (Math.sin(kx) <= 1e-205) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 5e-142) {
tmp = Math.sin(th) * (Math.sin(ky) / kx);
} else if (Math.sin(kx) <= 5e-94) {
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.1: tmp = math.fabs((ky * t_1)) elif math.sin(kx) <= 1e-205: tmp = math.sin(th) elif math.sin(kx) <= 5e-142: tmp = math.sin(th) * (math.sin(ky) / kx) elif math.sin(kx) <= 5e-94: 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.1) tmp = abs(Float64(ky * t_1)); elseif (sin(kx) <= 1e-205) tmp = sin(th); elseif (sin(kx) <= 5e-142) tmp = Float64(sin(th) * Float64(sin(ky) / kx)); elseif (sin(kx) <= 5e-94) 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.1) tmp = abs((ky * t_1)); elseif (sin(kx) <= 1e-205) tmp = sin(th); elseif (sin(kx) <= 5e-142) tmp = sin(th) * (sin(ky) / kx); elseif (sin(kx) <= 5e-94) 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.1], N[Abs[N[(ky * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-205], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-142], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-94], 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.1:\\
\;\;\;\;\left|ky \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-205}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{kx}\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-94}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot t\_1\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.10000000000000001Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
associate-*r/99.5%
hypot-undefine99.5%
unpow299.5%
unpow299.5%
+-commutative99.5%
associate-*l/99.4%
*-commutative99.4%
clear-num99.4%
un-div-inv99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 18.3%
add-sqr-sqrt15.2%
sqrt-unprod25.1%
pow225.1%
div-inv25.1%
clear-num25.1%
Applied egg-rr25.1%
unpow225.1%
rem-sqrt-square46.5%
associate-*r/46.6%
associate-*l/46.6%
*-commutative46.6%
Simplified46.6%
if -0.10000000000000001 < (sin.f64 kx) < 1e-205 or 5.0000000000000002e-142 < (sin.f64 kx) < 4.9999999999999995e-94Initial program 80.0%
unpow280.0%
sqr-neg80.0%
sin-neg80.0%
sin-neg80.0%
unpow280.0%
associate-*l/76.9%
associate-/l*79.9%
+-commutative79.9%
unpow279.9%
sin-neg79.9%
sin-neg79.9%
Simplified99.7%
Taylor expanded in kx around 0 31.1%
if 1e-205 < (sin.f64 kx) < 5.0000000000000002e-142Initial program 61.1%
unpow261.1%
sqr-neg61.1%
sin-neg61.1%
sin-neg61.1%
unpow261.1%
associate-*l/47.1%
associate-/l*61.0%
+-commutative61.0%
unpow261.0%
sin-neg61.0%
sin-neg61.0%
Simplified99.6%
Taylor expanded in ky around 0 71.1%
clear-num71.3%
un-div-inv71.1%
Applied egg-rr71.1%
Taylor expanded in kx around 0 39.7%
*-commutative39.7%
associate-/l*71.1%
Simplified71.1%
if 4.9999999999999995e-94 < (sin.f64 kx) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/97.8%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in ky around 0 54.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.01) (/ th (/ (hypot (sin ky) kx) (sin ky))) (if (<= (sin ky) 0.2) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.01) {
tmp = th / (hypot(sin(ky), kx) / sin(ky));
} else if (sin(ky) <= 0.2) {
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.01) {
tmp = th / (Math.hypot(Math.sin(ky), kx) / Math.sin(ky));
} else if (Math.sin(ky) <= 0.2) {
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.01: tmp = th / (math.hypot(math.sin(ky), kx) / math.sin(ky)) elif math.sin(ky) <= 0.2: 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.01) tmp = Float64(th / Float64(hypot(sin(ky), kx) / sin(ky))); elseif (sin(ky) <= 0.2) 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.01) tmp = th / (hypot(sin(ky), kx) / sin(ky)); elseif (sin(ky) <= 0.2) 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.01], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 0.2], 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.01:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, kx\right)}{\sin ky}}\\
\mathbf{elif}\;\sin ky \leq 0.2:\\
\;\;\;\;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.0100000000000000002Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
associate-*r/99.6%
hypot-undefine99.6%
unpow299.6%
unpow299.6%
+-commutative99.6%
associate-*l/99.7%
*-commutative99.7%
clear-num99.7%
un-div-inv99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 60.4%
Taylor expanded in kx around 0 30.5%
if -0.0100000000000000002 < (sin.f64 ky) < 0.20000000000000001Initial program 84.2%
unpow284.2%
sqr-neg84.2%
sin-neg84.2%
sin-neg84.2%
unpow284.2%
associate-*l/80.3%
associate-/l*84.2%
+-commutative84.2%
unpow284.2%
sin-neg84.2%
sin-neg84.2%
Simplified99.6%
Taylor expanded in ky around 0 95.2%
Taylor expanded in ky around 0 95.5%
if 0.20000000000000001 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 51.3%
(FPCore (kx ky th) :precision binary64 (* (sin th) (/ (sin ky) (hypot (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
return sin(th) * (sin(ky) / hypot(sin(ky), sin(kx)));
}
public static double code(double kx, double ky, double th) {
return Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
}
def code(kx, ky, th): return math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx)))
function code(kx, ky, th) return Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), sin(kx)))) end
function tmp = code(kx, ky, th) tmp = sin(th) * (sin(ky) / hypot(sin(ky), sin(kx))); end
code[kx_, ky_, th_] := N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}
\end{array}
Initial program 90.8%
+-commutative90.8%
unpow290.8%
unpow290.8%
hypot-undefine99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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 90.8%
unpow290.8%
sqr-neg90.8%
sin-neg90.8%
sin-neg90.8%
unpow290.8%
associate-*l/88.5%
associate-/l*90.8%
+-commutative90.8%
unpow290.8%
sin-neg90.8%
sin-neg90.8%
Simplified99.6%
(FPCore (kx ky th) :precision binary64 (if (<= th 8e-5) (/ th (/ (hypot (sin ky) (sin kx)) (sin ky))) (* ky (/ (sin th) (hypot ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 8e-5) {
tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky));
} 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 <= 8e-5) {
tmp = th / (Math.hypot(Math.sin(ky), Math.sin(kx)) / Math.sin(ky));
} else {
tmp = ky * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 8e-5: tmp = th / (math.hypot(math.sin(ky), math.sin(kx)) / math.sin(ky)) else: tmp = ky * (math.sin(th) / math.hypot(ky, math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 8e-5) tmp = Float64(th / Float64(hypot(sin(ky), sin(kx)) / sin(ky))); 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 <= 8e-5) tmp = th / (hypot(sin(ky), sin(kx)) / sin(ky)); else tmp = ky * (sin(th) / hypot(ky, sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 8e-5], N[(th / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[ky], $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 8 \cdot 10^{-5}:\\
\;\;\;\;\frac{th}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin ky}}\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\end{array}
\end{array}
if th < 8.00000000000000065e-5Initial program 92.4%
unpow292.4%
sqr-neg92.4%
sin-neg92.4%
sin-neg92.4%
unpow292.4%
associate-*l/89.4%
associate-/l*92.4%
+-commutative92.4%
unpow292.4%
sin-neg92.4%
sin-neg92.4%
Simplified99.6%
associate-*r/93.6%
hypot-undefine89.4%
unpow289.4%
unpow289.4%
+-commutative89.4%
associate-*l/92.4%
*-commutative92.4%
clear-num92.4%
un-div-inv92.4%
+-commutative92.4%
unpow292.4%
unpow292.4%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in th around 0 68.7%
if 8.00000000000000065e-5 < th Initial program 85.7%
unpow285.7%
sqr-neg85.7%
sin-neg85.7%
sin-neg85.7%
unpow285.7%
associate-*l/85.7%
associate-/l*85.8%
+-commutative85.8%
unpow285.8%
sin-neg85.8%
sin-neg85.8%
Simplified99.6%
Taylor expanded in ky around 0 53.9%
Taylor expanded in ky around 0 69.3%
(FPCore (kx ky th) :precision binary64 (if (<= th 3.8e-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 <= 3.8e-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 <= 3.8e-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 <= 3.8e-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 <= 3.8e-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 <= 3.8e-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, 3.8e-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 3.8 \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 < 3.8000000000000002e-5Initial program 92.4%
unpow292.4%
sqr-neg92.4%
sin-neg92.4%
sin-neg92.4%
unpow292.4%
associate-*l/89.4%
associate-/l*92.4%
+-commutative92.4%
unpow292.4%
sin-neg92.4%
sin-neg92.4%
Simplified99.6%
Taylor expanded in th around 0 68.7%
if 3.8000000000000002e-5 < th Initial program 85.7%
unpow285.7%
sqr-neg85.7%
sin-neg85.7%
sin-neg85.7%
unpow285.7%
associate-*l/85.7%
associate-/l*85.8%
+-commutative85.8%
unpow285.8%
sin-neg85.8%
sin-neg85.8%
Simplified99.6%
Taylor expanded in ky around 0 53.9%
Taylor expanded in ky around 0 69.3%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) 0.2) (* ky (/ (sin th) (hypot ky (sin kx)))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= 0.2) {
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.2) {
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.2: 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.2) 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.2) 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.2], 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.2:\\
\;\;\;\;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.20000000000000001Initial program 88.3%
unpow288.3%
sqr-neg88.3%
sin-neg88.3%
sin-neg88.3%
unpow288.3%
associate-*l/85.4%
associate-/l*88.3%
+-commutative88.3%
unpow288.3%
sin-neg88.3%
sin-neg88.3%
Simplified99.6%
Taylor expanded in ky around 0 71.2%
Taylor expanded in ky around 0 77.7%
if 0.20000000000000001 < (sin.f64 ky) Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 51.3%
(FPCore (kx ky th) :precision binary64 (if (<= ky 6.4e-223) (/ (sin th) (/ (sin kx) ky)) (if (<= ky 2.4e-29) (fabs (* ky (/ (sin th) (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6.4e-223) {
tmp = sin(th) / (sin(kx) / ky);
} else if (ky <= 2.4e-29) {
tmp = fabs((ky * (sin(th) / sin(kx))));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 6.4d-223) then
tmp = sin(th) / (sin(kx) / ky)
else if (ky <= 2.4d-29) then
tmp = abs((ky * (sin(th) / sin(kx))))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6.4e-223) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else if (ky <= 2.4e-29) {
tmp = Math.abs((ky * (Math.sin(th) / Math.sin(kx))));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 6.4e-223: tmp = math.sin(th) / (math.sin(kx) / ky) elif ky <= 2.4e-29: tmp = math.fabs((ky * (math.sin(th) / math.sin(kx)))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 6.4e-223) tmp = Float64(sin(th) / Float64(sin(kx) / ky)); elseif (ky <= 2.4e-29) tmp = abs(Float64(ky * Float64(sin(th) / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 6.4e-223) tmp = sin(th) / (sin(kx) / ky); elseif (ky <= 2.4e-29) tmp = abs((ky * (sin(th) / sin(kx)))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 6.4e-223], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 2.4e-29], N[Abs[N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 6.4 \cdot 10^{-223}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{elif}\;ky \leq 2.4 \cdot 10^{-29}:\\
\;\;\;\;\left|ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 6.4000000000000001e-223Initial program 87.6%
unpow287.6%
sqr-neg87.6%
sin-neg87.6%
sin-neg87.6%
unpow287.6%
associate-*l/84.6%
associate-/l*87.6%
+-commutative87.6%
unpow287.6%
sin-neg87.6%
sin-neg87.6%
Simplified99.6%
associate-*r/93.5%
hypot-undefine84.6%
unpow284.6%
unpow284.6%
+-commutative84.6%
associate-*l/87.6%
*-commutative87.6%
clear-num87.6%
un-div-inv87.7%
+-commutative87.7%
unpow287.7%
unpow287.7%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 31.6%
if 6.4000000000000001e-223 < ky < 2.39999999999999992e-29Initial program 89.4%
unpow289.4%
sqr-neg89.4%
sin-neg89.4%
sin-neg89.4%
unpow289.4%
associate-*l/86.8%
associate-/l*89.4%
+-commutative89.4%
unpow289.4%
sin-neg89.4%
sin-neg89.4%
Simplified99.7%
associate-*r/94.5%
hypot-undefine86.8%
unpow286.8%
unpow286.8%
+-commutative86.8%
associate-*l/89.4%
*-commutative89.4%
clear-num89.4%
un-div-inv89.5%
+-commutative89.5%
unpow289.5%
unpow289.5%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 32.2%
add-sqr-sqrt24.9%
sqrt-unprod33.6%
pow233.6%
div-inv33.6%
clear-num33.6%
Applied egg-rr33.6%
unpow233.6%
rem-sqrt-square49.1%
associate-*r/49.1%
associate-*l/49.1%
*-commutative49.1%
Simplified49.1%
if 2.39999999999999992e-29 < ky Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.5%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 35.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 6.4e-29) (/ (sin th) (/ (fabs (sin kx)) ky)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6.4e-29) {
tmp = sin(th) / (fabs(sin(kx)) / ky);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 6.4d-29) then
tmp = sin(th) / (abs(sin(kx)) / ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 6.4e-29) {
tmp = Math.sin(th) / (Math.abs(Math.sin(kx)) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 6.4e-29: tmp = math.sin(th) / (math.fabs(math.sin(kx)) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 6.4e-29) tmp = Float64(sin(th) / Float64(abs(sin(kx)) / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 6.4e-29) tmp = sin(th) / (abs(sin(kx)) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 6.4e-29], N[(N[Sin[th], $MachinePrecision] / N[(N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 6.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin th}{\frac{\left|\sin kx\right|}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 6.400000000000001e-29Initial program 88.0%
unpow288.0%
sqr-neg88.0%
sin-neg88.0%
sin-neg88.0%
unpow288.0%
associate-*l/85.1%
associate-/l*88.0%
+-commutative88.0%
unpow288.0%
sin-neg88.0%
sin-neg88.0%
Simplified99.6%
associate-*r/93.7%
hypot-undefine85.1%
unpow285.1%
unpow285.1%
+-commutative85.1%
associate-*l/88.0%
*-commutative88.0%
clear-num88.0%
un-div-inv88.1%
+-commutative88.1%
unpow288.1%
unpow288.1%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 32.0%
add-sqr-sqrt24.5%
sqrt-unprod50.2%
pow250.2%
Applied egg-rr50.2%
unpow250.2%
rem-sqrt-square57.3%
Simplified57.3%
if 6.400000000000001e-29 < ky Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.6%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.6%
Taylor expanded in kx around 0 36.1%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1e-29) (/ (sin th) (/ (sin kx) ky)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-29) {
tmp = sin(th) / (sin(kx) / ky);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1d-29) then
tmp = sin(th) / (sin(kx) / ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1e-29) {
tmp = Math.sin(th) / (Math.sin(kx) / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1e-29: tmp = math.sin(th) / (math.sin(kx) / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1e-29) tmp = Float64(sin(th) / Float64(sin(kx) / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1e-29) tmp = sin(th) / (sin(kx) / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1e-29], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 10^{-29}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 9.99999999999999943e-30Initial program 88.0%
unpow288.0%
sqr-neg88.0%
sin-neg88.0%
sin-neg88.0%
unpow288.0%
associate-*l/85.0%
associate-/l*88.0%
+-commutative88.0%
unpow288.0%
sin-neg88.0%
sin-neg88.0%
Simplified99.6%
associate-*r/93.7%
hypot-undefine85.0%
unpow285.0%
unpow285.0%
+-commutative85.0%
associate-*l/88.0%
*-commutative88.0%
clear-num88.0%
un-div-inv88.0%
+-commutative88.0%
unpow288.0%
unpow288.0%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 31.7%
if 9.99999999999999943e-30 < ky Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.5%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 35.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.3e-29) (* (sin th) (/ ky (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.3e-29) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 2.3d-29) then
tmp = sin(th) * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.3e-29) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.3e-29: tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.3e-29) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.3e-29) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.3e-29], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.3 \cdot 10^{-29}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.29999999999999991e-29Initial program 88.0%
Taylor expanded in ky around 0 31.7%
if 2.29999999999999991e-29 < ky Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.5%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 35.6%
Final simplification32.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.55e-29) (* ky (/ (sin th) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.55e-29) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 1.55d-29) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.55e-29) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.55e-29: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.55e-29) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.55e-29) tmp = ky * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.55e-29], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.55 \cdot 10^{-29}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.55000000000000013e-29Initial program 88.0%
unpow288.0%
sqr-neg88.0%
sin-neg88.0%
sin-neg88.0%
unpow288.0%
associate-*l/85.0%
associate-/l*88.0%
+-commutative88.0%
unpow288.0%
sin-neg88.0%
sin-neg88.0%
Simplified99.6%
Taylor expanded in ky around 0 29.3%
associate-/l*31.7%
Simplified31.7%
if 1.55000000000000013e-29 < ky Initial program 99.8%
unpow299.8%
sqr-neg99.8%
sin-neg99.8%
sin-neg99.8%
unpow299.8%
associate-*l/99.5%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 35.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.8e-86) (/ (sin th) (/ kx ky)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.8e-86) {
tmp = sin(th) / (kx / ky);
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 5.8d-86) then
tmp = sin(th) / (kx / ky)
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.8e-86) {
tmp = Math.sin(th) / (kx / ky);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.8e-86: tmp = math.sin(th) / (kx / ky) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.8e-86) tmp = Float64(sin(th) / Float64(kx / ky)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 5.8e-86) tmp = sin(th) / (kx / ky); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.8e-86], N[(N[Sin[th], $MachinePrecision] / N[(kx / ky), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{\sin th}{\frac{kx}{ky}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 5.7999999999999998e-86Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/84.2%
associate-/l*87.3%
+-commutative87.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
Simplified99.6%
associate-*r/93.4%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/87.3%
*-commutative87.3%
clear-num87.3%
un-div-inv87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 31.8%
Taylor expanded in kx around 0 23.2%
if 5.7999999999999998e-86 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.4%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.6e-86) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.6e-86) {
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 <= 1.6d-86) 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 <= 1.6e-86) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.6e-86: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.6e-86) 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 <= 1.6e-86) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.6e-86], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.6 \cdot 10^{-86}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.60000000000000003e-86Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/84.2%
associate-/l*87.3%
+-commutative87.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
Simplified99.6%
associate-*r/93.4%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/87.3%
*-commutative87.3%
clear-num87.3%
un-div-inv87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 31.8%
Taylor expanded in kx around 0 20.7%
associate-/l*23.2%
Simplified23.2%
if 1.60000000000000003e-86 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.4%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3e-88) (* ky (/ th (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3e-88) {
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 <= 3d-88) 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 <= 3e-88) {
tmp = ky * (th / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3e-88: tmp = ky * (th / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3e-88) 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 <= 3e-88) tmp = ky * (th / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3e-88], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3 \cdot 10^{-88}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.9999999999999999e-88Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/84.2%
associate-/l*87.3%
+-commutative87.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
Simplified99.6%
associate-*r/93.4%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/87.3%
*-commutative87.3%
clear-num87.3%
un-div-inv87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 53.7%
Taylor expanded in ky around 0 18.2%
associate-/l*20.6%
Simplified20.6%
if 2.9999999999999999e-88 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.4%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.9e-87) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.9e-87) {
tmp = ky * (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 <= 1.9d-87) then
tmp = ky * (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 <= 1.9e-87) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.9e-87: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.9e-87) tmp = Float64(ky * Float64(th / kx)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.9e-87) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.9e-87], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.9 \cdot 10^{-87}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 1.9e-87Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/84.2%
associate-/l*87.3%
+-commutative87.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
Simplified99.6%
associate-*r/93.4%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/87.3%
*-commutative87.3%
clear-num87.3%
un-div-inv87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 53.7%
Taylor expanded in ky around 0 18.2%
associate-/l*20.6%
Simplified20.6%
Taylor expanded in kx around 0 17.7%
if 1.9e-87 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.4%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.2%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.5e-79) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.5e-79) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4.5d-79) then
tmp = ky * (th / kx)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.5e-79) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.5e-79: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.5e-79) tmp = Float64(ky * Float64(th / kx)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.5e-79) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.5e-79], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.5 \cdot 10^{-79}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 4.5000000000000003e-79Initial program 87.3%
unpow287.3%
sqr-neg87.3%
sin-neg87.3%
sin-neg87.3%
unpow287.3%
associate-*l/84.2%
associate-/l*87.3%
+-commutative87.3%
unpow287.3%
sin-neg87.3%
sin-neg87.3%
Simplified99.6%
associate-*r/93.4%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/87.3%
*-commutative87.3%
clear-num87.3%
un-div-inv87.3%
+-commutative87.3%
unpow287.3%
unpow287.3%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 53.7%
Taylor expanded in ky around 0 18.2%
associate-/l*20.6%
Simplified20.6%
Taylor expanded in kx around 0 17.7%
if 4.5000000000000003e-79 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.4%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.2%
Taylor expanded in th around 0 18.6%
(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 90.8%
unpow290.8%
sqr-neg90.8%
sin-neg90.8%
sin-neg90.8%
unpow290.8%
associate-*l/88.5%
associate-/l*90.8%
+-commutative90.8%
unpow290.8%
sin-neg90.8%
sin-neg90.8%
Simplified99.6%
Taylor expanded in kx around 0 18.4%
Taylor expanded in th around 0 10.6%
herbie shell --seed 2024191
(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)))