
(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 20 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.2%
+-commutative93.2%
unpow293.2%
unpow293.2%
hypot-undefine99.6%
Applied egg-rr99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.002)
(* th (/ (sin ky) (hypot (sin ky) kx)))
(if (<= (sin ky) 5e-44)
(/ (sin ky) (/ (sin kx) (sin th)))
(/ (* (sin ky) (sin th)) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.002) {
tmp = th * (sin(ky) / hypot(sin(ky), kx));
} else if (sin(ky) <= 5e-44) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else {
tmp = (sin(ky) * sin(th)) / sin(ky);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.002) {
tmp = th * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else if (Math.sin(ky) <= 5e-44) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.sin(ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.002: tmp = th * (math.sin(ky) / math.hypot(math.sin(ky), kx)) elif math.sin(ky) <= 5e-44: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) else: tmp = (math.sin(ky) * math.sin(th)) / math.sin(ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.002) tmp = Float64(th * Float64(sin(ky) / hypot(sin(ky), kx))); elseif (sin(ky) <= 5e-44) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); else tmp = Float64(Float64(sin(ky) * sin(th)) / sin(ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.002) tmp = th * (sin(ky) / hypot(sin(ky), kx)); elseif (sin(ky) <= 5e-44) tmp = sin(ky) / (sin(kx) / sin(th)); else tmp = (sin(ky) * sin(th)) / sin(ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.002], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -2e-3Initial program 99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 57.9%
Taylor expanded in kx around 0 31.0%
if -2e-3 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 85.7%
unpow285.7%
sqr-neg85.7%
sin-neg85.7%
sin-neg85.7%
unpow285.7%
associate-*l/80.8%
associate-/l*85.7%
+-commutative85.7%
unpow285.7%
sin-neg85.7%
sin-neg85.7%
Simplified99.7%
clear-num99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 53.6%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
Final simplification50.7%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) -0.05) (* th (/ (sin ky) (hypot ky (sin kx)))) (if (<= (sin kx) 4e-113) (sin th) (/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.05) {
tmp = th * (sin(ky) / hypot(ky, sin(kx)));
} else if (sin(kx) <= 4e-113) {
tmp = sin(th);
} else {
tmp = sin(ky) / (sin(kx) / sin(th));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.05) {
tmp = th * (Math.sin(ky) / Math.hypot(ky, Math.sin(kx)));
} else if (Math.sin(kx) <= 4e-113) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.05: tmp = th * (math.sin(ky) / math.hypot(ky, math.sin(kx))) elif math.sin(kx) <= 4e-113: tmp = math.sin(th) else: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.05) tmp = Float64(th * Float64(sin(ky) / hypot(ky, sin(kx)))); elseif (sin(kx) <= 4e-113) tmp = sin(th); else tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.05) tmp = th * (sin(ky) / hypot(ky, sin(kx))); elseif (sin(kx) <= 4e-113) tmp = sin(th); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.05], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 4e-113], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.05:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-113}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.050000000000000003Initial program 99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in th around 0 53.9%
Taylor expanded in ky around 0 30.5%
if -0.050000000000000003 < (sin.f64 kx) < 3.99999999999999991e-113Initial program 83.1%
unpow283.1%
sqr-neg83.1%
sin-neg83.1%
sin-neg83.1%
unpow283.1%
associate-*l/80.8%
associate-/l*83.0%
+-commutative83.0%
unpow283.0%
sin-neg83.0%
sin-neg83.0%
Simplified99.7%
Taylor expanded in kx around 0 45.3%
if 3.99999999999999991e-113 < (sin.f64 kx) Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/95.6%
associate-/l*99.4%
+-commutative99.4%
unpow299.4%
sin-neg99.4%
sin-neg99.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 60.9%
Final simplification47.4%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.3)
(sqrt (pow (sin th) 2.0))
(if (<= (sin ky) 5e-44)
(/ (sin ky) (/ (sin kx) (sin th)))
(/ (* (sin ky) (sin th)) (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.3) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 5e-44) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else {
tmp = (sin(ky) * sin(th)) / sin(ky);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.3d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 5d-44) then
tmp = sin(ky) / (sin(kx) / sin(th))
else
tmp = (sin(ky) * sin(th)) / sin(ky)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.3) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 5e-44) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.sin(ky);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.3: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 5e-44: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) else: tmp = (math.sin(ky) * math.sin(th)) / math.sin(ky) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); else tmp = Float64(Float64(sin(ky) * sin(th)) / sin(ky)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = sin(ky) / (sin(kx) / sin(th)); else tmp = (sin(ky) * sin(th)) / sin(ky); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.3], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.3:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\sin ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.299999999999999989Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
+-commutative99.4%
unpow299.4%
sin-neg99.4%
sin-neg99.4%
Simplified99.5%
Taylor expanded in kx around 0 3.0%
add-sqr-sqrt1.4%
sqrt-unprod17.9%
pow217.9%
Applied egg-rr17.9%
if -0.299999999999999989 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 87.0%
unpow287.0%
sqr-neg87.0%
sin-neg87.0%
sin-neg87.0%
unpow287.0%
associate-*l/82.5%
associate-/l*87.0%
+-commutative87.0%
unpow287.0%
sin-neg87.0%
sin-neg87.0%
Simplified99.7%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 49.3%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.3)
(sqrt (pow (sin th) 2.0))
(if (<= (sin ky) 5e-44)
(/ (sin ky) (/ (sin kx) (sin th)))
(/ (* ky (sin th)) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.3) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 5e-44) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else {
tmp = (ky * sin(th)) / ky;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.3d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 5d-44) then
tmp = sin(ky) / (sin(kx) / sin(th))
else
tmp = (ky * sin(th)) / ky
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.3) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 5e-44) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else {
tmp = (ky * Math.sin(th)) / ky;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.3: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 5e-44: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) else: tmp = (ky * math.sin(th)) / ky return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); else tmp = Float64(Float64(ky * sin(th)) / ky); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = sin(ky) / (sin(kx) / sin(th)); else tmp = (ky * sin(th)) / ky; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.3], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.3:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.299999999999999989Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
+-commutative99.4%
unpow299.4%
sin-neg99.4%
sin-neg99.4%
Simplified99.5%
Taylor expanded in kx around 0 3.0%
add-sqr-sqrt1.4%
sqrt-unprod17.9%
pow217.9%
Applied egg-rr17.9%
if -0.299999999999999989 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 87.0%
unpow287.0%
sqr-neg87.0%
sin-neg87.0%
sin-neg87.0%
unpow287.0%
associate-*l/82.5%
associate-/l*87.0%
+-commutative87.0%
unpow287.0%
sin-neg87.0%
sin-neg87.0%
Simplified99.7%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 49.3%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
Taylor expanded in ky around 0 8.7%
Taylor expanded in ky around 0 63.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.3)
(sqrt (pow (sin th) 2.0))
(if (<= (sin ky) 5e-44)
(* (sin ky) (/ (sin th) (sin kx)))
(/ (* ky (sin th)) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.3) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 5e-44) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else {
tmp = (ky * sin(th)) / ky;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.3d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 5d-44) then
tmp = sin(ky) * (sin(th) / sin(kx))
else
tmp = (ky * sin(th)) / ky
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.3) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 5e-44) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else {
tmp = (ky * Math.sin(th)) / ky;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.3: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 5e-44: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) else: tmp = (ky * math.sin(th)) / ky return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); else tmp = Float64(Float64(ky * sin(th)) / ky); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.3) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = sin(ky) * (sin(th) / sin(kx)); else tmp = (ky * sin(th)) / ky; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.3], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.3:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.299999999999999989Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
+-commutative99.4%
unpow299.4%
sin-neg99.4%
sin-neg99.4%
Simplified99.5%
Taylor expanded in kx around 0 3.0%
add-sqr-sqrt1.4%
sqrt-unprod17.9%
pow217.9%
Applied egg-rr17.9%
if -0.299999999999999989 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 87.0%
unpow287.0%
sqr-neg87.0%
sin-neg87.0%
sin-neg87.0%
unpow287.0%
associate-*l/82.5%
associate-/l*87.0%
+-commutative87.0%
unpow287.0%
sin-neg87.0%
sin-neg87.0%
Simplified99.7%
Taylor expanded in ky around 0 49.3%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
Taylor expanded in ky around 0 8.7%
Taylor expanded in ky around 0 63.6%
(FPCore (kx ky th) :precision binary64 (if (<= (sin kx) 0.0005) (/ (* (sin ky) (sin th)) (fabs (sin ky))) (* (sin th) (/ (sin ky) (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= 0.0005) {
tmp = (sin(ky) * sin(th)) / fabs(sin(ky));
} else {
tmp = sin(th) * (sin(ky) / 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.0005d0) then
tmp = (sin(ky) * sin(th)) / abs(sin(ky))
else
tmp = sin(th) * (sin(ky) / 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.0005) {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.abs(Math.sin(ky));
} else {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= 0.0005: tmp = (math.sin(ky) * math.sin(th)) / math.fabs(math.sin(ky)) else: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= 0.0005) tmp = Float64(Float64(sin(ky) * sin(th)) / abs(sin(ky))); else tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= 0.0005) tmp = (sin(ky) * sin(th)) / abs(sin(ky)); else tmp = sin(th) * (sin(ky) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], 0.0005], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq 0.0005:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\left|\sin ky\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < 5.0000000000000001e-4Initial program 91.1%
unpow291.1%
sqr-neg91.1%
sin-neg91.1%
sin-neg91.1%
unpow291.1%
associate-*l/88.0%
associate-/l*91.0%
+-commutative91.0%
unpow291.0%
sin-neg91.0%
sin-neg91.0%
Simplified99.7%
Taylor expanded in kx around 0 30.9%
associate-*r/34.4%
Applied egg-rr34.4%
add-sqr-sqrt31.8%
sqrt-prod52.5%
rem-sqrt-square60.2%
Applied egg-rr60.2%
if 5.0000000000000001e-4 < (sin.f64 kx) Initial program 99.4%
Taylor expanded in ky around 0 67.0%
Final simplification61.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.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/90.8%
associate-/l*93.1%
+-commutative93.1%
unpow293.1%
sin-neg93.1%
sin-neg93.1%
Simplified99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.002)
(sqrt (pow (sin th) 2.0))
(if (<= (sin ky) 5e-44)
(* ky (/ (sin th) (sin kx)))
(/ (* ky (sin th)) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.002) {
tmp = sqrt(pow(sin(th), 2.0));
} else if (sin(ky) <= 5e-44) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = (ky * sin(th)) / ky;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.002d0)) then
tmp = sqrt((sin(th) ** 2.0d0))
else if (sin(ky) <= 5d-44) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = (ky * sin(th)) / ky
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.002) {
tmp = Math.sqrt(Math.pow(Math.sin(th), 2.0));
} else if (Math.sin(ky) <= 5e-44) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = (ky * Math.sin(th)) / ky;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.002: tmp = math.sqrt(math.pow(math.sin(th), 2.0)) elif math.sin(ky) <= 5e-44: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = (ky * math.sin(th)) / ky return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.002) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = Float64(Float64(ky * sin(th)) / ky); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.002) tmp = sqrt((sin(th) ^ 2.0)); elseif (sin(ky) <= 5e-44) tmp = ky * (sin(th) / sin(kx)); else tmp = (ky * sin(th)) / ky; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.002], N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;\sqrt{{\sin th}^{2}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -2e-3Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.9%
add-sqr-sqrt1.5%
sqrt-unprod18.1%
pow218.1%
Applied egg-rr18.1%
if -2e-3 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 85.7%
unpow285.7%
sqr-neg85.7%
sin-neg85.7%
sin-neg85.7%
unpow285.7%
associate-*l/80.8%
associate-/l*85.7%
+-commutative85.7%
unpow285.7%
sin-neg85.7%
sin-neg85.7%
Simplified99.7%
Taylor expanded in ky around 0 48.5%
associate-/l*53.6%
Simplified53.6%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
Taylor expanded in ky around 0 8.7%
Taylor expanded in ky around 0 63.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.002)
(fabs (sin th))
(if (<= (sin ky) 5e-44)
(* ky (/ (sin th) (sin kx)))
(/ (* ky (sin th)) ky))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.002) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-44) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = (ky * sin(th)) / ky;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.002d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-44) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = (ky * sin(th)) / ky
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.002) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-44) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = (ky * Math.sin(th)) / ky;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.002: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-44: tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = (ky * math.sin(th)) / ky return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.002) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-44) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = Float64(Float64(ky * sin(th)) / ky); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.002) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-44) tmp = ky * (sin(th) / sin(kx)); else tmp = (ky * sin(th)) / ky; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.002], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-44], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.002:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-44}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\end{array}
\end{array}
if (sin.f64 ky) < -2e-3Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 2.9%
add-sqr-sqrt1.5%
sqrt-unprod18.1%
pow218.1%
Applied egg-rr18.1%
unpow218.1%
rem-sqrt-square27.4%
associate-*r/27.4%
*-rgt-identity27.4%
times-frac27.4%
*-inverses27.4%
/-rgt-identity27.4%
*-lft-identity27.4%
Simplified27.4%
if -2e-3 < (sin.f64 ky) < 5.00000000000000039e-44Initial program 85.7%
unpow285.7%
sqr-neg85.7%
sin-neg85.7%
sin-neg85.7%
unpow285.7%
associate-*l/80.8%
associate-/l*85.7%
+-commutative85.7%
unpow285.7%
sin-neg85.7%
sin-neg85.7%
Simplified99.7%
Taylor expanded in ky around 0 48.5%
associate-/l*53.6%
Simplified53.6%
if 5.00000000000000039e-44 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.5%
Taylor expanded in kx around 0 63.5%
associate-*r/63.7%
Applied egg-rr63.7%
Taylor expanded in ky around 0 8.7%
Taylor expanded in ky around 0 63.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.5e-5) (* (sin ky) (/ (sin th) (hypot ky (sin kx)))) (/ (* (sin ky) (sin th)) (fabs (sin ky)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.5e-5) {
tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx)));
} else {
tmp = (sin(ky) * sin(th)) / fabs(sin(ky));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.5e-5) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.hypot(ky, Math.sin(kx)));
} else {
tmp = (Math.sin(ky) * Math.sin(th)) / Math.abs(Math.sin(ky));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.5e-5: tmp = math.sin(ky) * (math.sin(th) / math.hypot(ky, math.sin(kx))) else: tmp = (math.sin(ky) * math.sin(th)) / math.fabs(math.sin(ky)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.5e-5) tmp = Float64(sin(ky) * Float64(sin(th) / hypot(ky, sin(kx)))); else tmp = Float64(Float64(sin(ky) * sin(th)) / abs(sin(ky))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.5e-5) tmp = sin(ky) * (sin(th) / hypot(ky, sin(kx))); else tmp = (sin(ky) * sin(th)) / abs(sin(ky)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.5e-5], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sqrt[ky ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.5 \cdot 10^{-5}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\mathsf{hypot}\left(ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky \cdot \sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 1.50000000000000004e-5Initial program 90.9%
unpow290.9%
sqr-neg90.9%
sin-neg90.9%
sin-neg90.9%
unpow290.9%
associate-*l/87.8%
associate-/l*90.9%
+-commutative90.9%
unpow290.9%
sin-neg90.9%
sin-neg90.9%
Simplified99.6%
Taylor expanded in ky around 0 68.0%
if 1.50000000000000004e-5 < ky Initial 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%
Taylor expanded in kx around 0 33.8%
associate-*r/33.9%
Applied egg-rr33.9%
add-sqr-sqrt32.5%
sqrt-prod67.3%
rem-sqrt-square67.3%
Applied egg-rr67.3%
(FPCore (kx ky th) :precision binary64 (if (<= th 3.8e-6) (* (sin ky) (/ th (hypot (sin ky) (sin kx)))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 3.8e-6) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (th <= 3.8e-6) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if th <= 3.8e-6: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (th <= 3.8e-6) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (th <= 3.8e-6) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 3.8e-6], N[(N[Sin[ky], $MachinePrecision] * N[(th / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;th \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if th < 3.8e-6Initial program 94.6%
unpow294.6%
sqr-neg94.6%
sin-neg94.6%
sin-neg94.6%
unpow294.6%
associate-*l/91.3%
associate-/l*94.5%
+-commutative94.5%
unpow294.5%
sin-neg94.5%
sin-neg94.5%
Simplified99.7%
Taylor expanded in th around 0 69.0%
if 3.8e-6 < th Initial program 89.6%
unpow289.6%
sqr-neg89.6%
sin-neg89.6%
sin-neg89.6%
unpow289.6%
associate-*l/89.5%
associate-/l*89.6%
+-commutative89.6%
unpow289.6%
sin-neg89.6%
sin-neg89.6%
Simplified99.4%
Taylor expanded in kx around 0 22.4%
add-sqr-sqrt21.3%
sqrt-prod38.5%
rem-sqrt-square45.5%
Applied egg-rr45.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky 4.3e-44) (/ (sin ky) (/ (sin kx) (sin th))) (* (sin ky) (/ (sin th) (fabs (sin ky))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.3e-44) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(ky)));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 4.3d-44) then
tmp = sin(ky) / (sin(kx) / sin(th))
else
tmp = sin(ky) * (sin(th) / abs(sin(ky)))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 4.3e-44) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 4.3e-44: tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 4.3e-44) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 4.3e-44) tmp = sin(ky) / (sin(kx) / sin(th)); else tmp = sin(ky) * (sin(th) / abs(sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 4.3e-44], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[ky], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 4.3 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin ky\right|}\\
\end{array}
\end{array}
if ky < 4.30000000000000013e-44Initial program 90.6%
unpow290.6%
sqr-neg90.6%
sin-neg90.6%
sin-neg90.6%
unpow290.6%
associate-*l/87.3%
associate-/l*90.6%
+-commutative90.6%
unpow290.6%
sin-neg90.6%
sin-neg90.6%
Simplified99.6%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 37.3%
if 4.30000000000000013e-44 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/99.6%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.6%
Taylor expanded in kx around 0 34.0%
add-sqr-sqrt32.7%
sqrt-prod64.2%
rem-sqrt-square64.2%
Applied egg-rr64.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 1.5e-224) (* ky (/ (sin th) kx)) (if (<= ky 2.6e+33) (/ (* ky (sin th)) ky) (fabs (sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.5e-224) {
tmp = ky * (sin(th) / kx);
} else if (ky <= 2.6e+33) {
tmp = (ky * sin(th)) / ky;
} else {
tmp = fabs(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.5d-224) then
tmp = ky * (sin(th) / kx)
else if (ky <= 2.6d+33) then
tmp = (ky * sin(th)) / ky
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 1.5e-224) {
tmp = ky * (Math.sin(th) / kx);
} else if (ky <= 2.6e+33) {
tmp = (ky * Math.sin(th)) / ky;
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 1.5e-224: tmp = ky * (math.sin(th) / kx) elif ky <= 2.6e+33: tmp = (ky * math.sin(th)) / ky else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 1.5e-224) tmp = Float64(ky * Float64(sin(th) / kx)); elseif (ky <= 2.6e+33) tmp = Float64(Float64(ky * sin(th)) / ky); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 1.5e-224) tmp = ky * (sin(th) / kx); elseif (ky <= 2.6e+33) tmp = (ky * sin(th)) / ky; else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 1.5e-224], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], If[LessEqual[ky, 2.6e+33], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 1.5 \cdot 10^{-224}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{elif}\;ky \leq 2.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < 1.49999999999999991e-224Initial program 91.7%
unpow291.7%
sqr-neg91.7%
sin-neg91.7%
sin-neg91.7%
unpow291.7%
associate-*l/89.6%
associate-/l*91.7%
+-commutative91.7%
unpow291.7%
sin-neg91.7%
sin-neg91.7%
Simplified99.5%
associate-*r/95.4%
hypot-undefine89.6%
unpow289.6%
unpow289.6%
+-commutative89.6%
associate-*l/91.7%
*-commutative91.7%
clear-num91.6%
un-div-inv91.7%
+-commutative91.7%
unpow291.7%
unpow291.7%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 57.5%
Taylor expanded in ky around 0 17.3%
associate-/l*20.9%
Simplified20.9%
if 1.49999999999999991e-224 < ky < 2.5999999999999997e33Initial program 90.5%
unpow290.5%
sqr-neg90.5%
sin-neg90.5%
sin-neg90.5%
unpow290.5%
associate-*l/85.1%
associate-/l*90.5%
+-commutative90.5%
unpow290.5%
sin-neg90.5%
sin-neg90.5%
Simplified99.8%
Taylor expanded in kx around 0 39.0%
associate-*r/45.8%
Applied egg-rr45.8%
Taylor expanded in ky around 0 39.4%
Taylor expanded in ky around 0 45.8%
if 2.5999999999999997e33 < 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.5%
+-commutative99.5%
unpow299.5%
sin-neg99.5%
sin-neg99.5%
Simplified99.6%
Taylor expanded in kx around 0 31.0%
add-sqr-sqrt12.5%
sqrt-unprod19.3%
pow219.3%
Applied egg-rr19.3%
unpow219.3%
rem-sqrt-square27.8%
associate-*r/27.8%
*-rgt-identity27.8%
times-frac27.8%
*-inverses27.8%
/-rgt-identity27.8%
*-lft-identity27.8%
Simplified27.8%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.9e-224) (* ky (/ (sin th) kx)) (/ (* ky (sin th)) ky)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.9e-224) {
tmp = ky * (sin(th) / kx);
} else {
tmp = (ky * sin(th)) / ky;
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= 2.9d-224) then
tmp = ky * (sin(th) / kx)
else
tmp = (ky * sin(th)) / ky
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.9e-224) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = (ky * Math.sin(th)) / ky;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.9e-224: tmp = ky * (math.sin(th) / kx) else: tmp = (ky * math.sin(th)) / ky return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.9e-224) tmp = Float64(ky * Float64(sin(th) / kx)); else tmp = Float64(Float64(ky * sin(th)) / ky); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= 2.9e-224) tmp = ky * (sin(th) / kx); else tmp = (ky * sin(th)) / ky; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.9e-224], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / ky), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.9 \cdot 10^{-224}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{ky \cdot \sin th}{ky}\\
\end{array}
\end{array}
if ky < 2.9e-224Initial program 91.7%
unpow291.7%
sqr-neg91.7%
sin-neg91.7%
sin-neg91.7%
unpow291.7%
associate-*l/89.6%
associate-/l*91.7%
+-commutative91.7%
unpow291.7%
sin-neg91.7%
sin-neg91.7%
Simplified99.5%
associate-*r/95.4%
hypot-undefine89.6%
unpow289.6%
unpow289.6%
+-commutative89.6%
associate-*l/91.7%
*-commutative91.7%
clear-num91.6%
un-div-inv91.7%
+-commutative91.7%
unpow291.7%
unpow291.7%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in kx around 0 57.5%
Taylor expanded in ky around 0 17.3%
associate-/l*20.9%
Simplified20.9%
if 2.9e-224 < ky Initial program 95.2%
unpow295.2%
sqr-neg95.2%
sin-neg95.2%
sin-neg95.2%
unpow295.2%
associate-*l/92.5%
associate-/l*95.1%
+-commutative95.1%
unpow295.1%
sin-neg95.1%
sin-neg95.1%
Simplified99.7%
Taylor expanded in kx around 0 34.9%
associate-*r/38.3%
Applied egg-rr38.3%
Taylor expanded in ky around 0 21.9%
Taylor expanded in ky around 0 38.3%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.7e-154) (* ky (/ (sin th) kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.7e-154) {
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 <= 2.7d-154) 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 <= 2.7e-154) {
tmp = ky * (Math.sin(th) / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.7e-154: tmp = ky * (math.sin(th) / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.7e-154) 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 <= 2.7e-154) tmp = ky * (sin(th) / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.7e-154], N[(ky * N[(N[Sin[th], $MachinePrecision] / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.7 \cdot 10^{-154}:\\
\;\;\;\;ky \cdot \frac{\sin th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.69999999999999989e-154Initial program 89.5%
unpow289.5%
sqr-neg89.5%
sin-neg89.5%
sin-neg89.5%
unpow289.5%
associate-*l/87.6%
associate-/l*89.5%
+-commutative89.5%
unpow289.5%
sin-neg89.5%
sin-neg89.5%
Simplified99.5%
associate-*r/95.6%
hypot-undefine87.6%
unpow287.6%
unpow287.6%
+-commutative87.6%
associate-*l/89.5%
*-commutative89.5%
clear-num89.4%
un-div-inv89.5%
+-commutative89.5%
unpow289.5%
unpow289.5%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in kx around 0 58.0%
Taylor expanded in ky around 0 19.1%
associate-/l*22.4%
Simplified22.4%
if 2.69999999999999989e-154 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/96.6%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
sin-neg99.7%
sin-neg99.7%
Simplified99.7%
Taylor expanded in kx around 0 36.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.8e-6) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.8e-6) {
tmp = sin(th);
} else {
tmp = ky * (th / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (kx <= 3.8d-6) then
tmp = sin(th)
else
tmp = ky * (th / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.8e-6) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.8e-6: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.8e-6) tmp = sin(th); else tmp = Float64(ky * Float64(th / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.8e-6) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.8e-6], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 3.8e-6Initial program 91.2%
unpow291.2%
sqr-neg91.2%
sin-neg91.2%
sin-neg91.2%
unpow291.2%
associate-*l/88.0%
associate-/l*91.0%
+-commutative91.0%
unpow291.0%
sin-neg91.0%
sin-neg91.0%
Simplified99.6%
Taylor expanded in kx around 0 30.2%
if 3.8e-6 < kx Initial program 99.4%
+-commutative99.4%
unpow299.4%
unpow299.4%
hypot-undefine99.4%
Applied egg-rr99.4%
Taylor expanded in th around 0 50.1%
Taylor expanded in ky around 0 23.7%
associate-/l*23.7%
Simplified23.7%
(FPCore (kx ky th) :precision binary64 (if (<= ky 9.5e-187) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 9.5e-187) {
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 <= 9.5d-187) 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 <= 9.5e-187) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 9.5e-187: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 9.5e-187) 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 <= 9.5e-187) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 9.5e-187], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 9.5 \cdot 10^{-187}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 9.49999999999999936e-187Initial program 90.8%
+-commutative90.8%
unpow290.8%
unpow290.8%
hypot-undefine99.5%
Applied egg-rr99.5%
Taylor expanded in th around 0 50.7%
Taylor expanded in ky around 0 17.3%
associate-/l*20.5%
Simplified20.5%
Taylor expanded in kx around 0 14.1%
associate-/l*17.5%
Simplified17.5%
if 9.49999999999999936e-187 < ky Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/94.0%
associate-/l*96.8%
+-commutative96.8%
unpow296.8%
sin-neg96.8%
sin-neg96.8%
Simplified99.7%
Taylor expanded in kx around 0 36.6%
(FPCore (kx ky th) :precision binary64 (if (<= ky 3.5e-107) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 3.5e-107) {
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 <= 3.5d-107) 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 <= 3.5e-107) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 3.5e-107: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 3.5e-107) 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 <= 3.5e-107) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 3.5e-107], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 3.5 \cdot 10^{-107}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 3.49999999999999985e-107Initial program 90.1%
+-commutative90.1%
unpow290.1%
unpow290.1%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 51.9%
Taylor expanded in ky around 0 19.3%
associate-/l*22.2%
Simplified22.2%
Taylor expanded in kx around 0 15.9%
associate-/l*18.9%
Simplified18.9%
if 3.49999999999999985e-107 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/98.5%
associate-/l*99.6%
+-commutative99.6%
unpow299.6%
sin-neg99.6%
sin-neg99.6%
Simplified99.7%
Taylor expanded in kx around 0 34.1%
Taylor expanded in th around 0 17.3%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/90.8%
associate-/l*93.1%
+-commutative93.1%
unpow293.1%
sin-neg93.1%
sin-neg93.1%
Simplified99.6%
Taylor expanded in kx around 0 24.6%
Taylor expanded in th around 0 13.0%
herbie shell --seed 2024155
(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)))