
(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 18 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 95.3%
unpow295.3%
sqr-neg95.3%
sin-neg95.3%
sin-neg95.3%
unpow295.3%
associate-*l/91.7%
associate-/l*95.2%
unpow295.2%
Simplified99.6%
associate-*r/95.6%
hypot-undefine91.7%
unpow291.7%
unpow291.7%
+-commutative91.7%
associate-*l/95.3%
*-commutative95.3%
clear-num95.3%
un-div-inv95.3%
+-commutative95.3%
unpow295.3%
unpow295.3%
hypot-undefine99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.03)
(fabs (* th (/ (sin ky) (sin kx))))
(if (or (<= (sin kx) 5e-79)
(and (not (<= (sin kx) 2e-37)) (<= (sin kx) 4e-23)))
(sin th)
(* (sin ky) (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((th * (sin(ky) / sin(kx))));
} else if ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-23))) {
tmp = sin(th);
} else {
tmp = sin(ky) * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.03d0)) then
tmp = abs((th * (sin(ky) / sin(kx))))
else if ((sin(kx) <= 5d-79) .or. (.not. (sin(kx) <= 2d-37)) .and. (sin(kx) <= 4d-23)) then
tmp = sin(th)
else
tmp = sin(ky) * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.03) {
tmp = Math.abs((th * (Math.sin(ky) / Math.sin(kx))));
} else if ((Math.sin(kx) <= 5e-79) || (!(Math.sin(kx) <= 2e-37) && (Math.sin(kx) <= 4e-23))) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.03: tmp = math.fabs((th * (math.sin(ky) / math.sin(kx)))) elif (math.sin(kx) <= 5e-79) or (not (math.sin(kx) <= 2e-37) and (math.sin(kx) <= 4e-23)): tmp = math.sin(th) else: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.03) tmp = abs(Float64(th * Float64(sin(ky) / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-23))) tmp = sin(th); else tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.03) tmp = abs((th * (sin(ky) / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (~((sin(kx) <= 2e-37)) && (sin(kx) <= 4e-23))) tmp = sin(th); else tmp = sin(ky) * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.03], N[Abs[N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], And[N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37]], $MachinePrecision], LessEqual[N[Sin[kx], $MachinePrecision], 4e-23]]], N[Sin[th], $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.03:\\
\;\;\;\;\left|th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79} \lor \neg \left(\sin kx \leq 2 \cdot 10^{-37}\right) \land \sin kx \leq 4 \cdot 10^{-23}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in th around 0 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in ky around 0 24.9%
add-sqr-sqrt23.1%
sqrt-unprod27.4%
pow227.4%
associate-*l/27.4%
*-un-lft-identity27.4%
*-commutative27.4%
associate-/l*27.4%
Applied egg-rr27.4%
unpow227.4%
rem-sqrt-square29.5%
associate-*r/29.5%
*-commutative29.5%
associate-/l*29.5%
Simplified29.5%
if -0.029999999999999999 < (sin.f64 kx) < 4.99999999999999999e-79 or 2.00000000000000013e-37 < (sin.f64 kx) < 3.99999999999999984e-23Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/83.2%
associate-/l*90.1%
unpow290.1%
Simplified99.7%
Taylor expanded in kx around 0 34.0%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37 or 3.99999999999999984e-23 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/97.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in ky around 0 64.3%
Final simplification42.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.03)
(fabs (* th (/ (sin ky) (sin kx))))
(if (or (<= (sin kx) 5e-79)
(and (not (<= (sin kx) 2e-37)) (<= (sin kx) 4e-23)))
(sin th)
(/ (sin ky) (/ (sin kx) (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((th * (sin(ky) / sin(kx))));
} else if ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-23))) {
tmp = sin(th);
} else {
tmp = sin(ky) / (sin(kx) / sin(th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.03d0)) then
tmp = abs((th * (sin(ky) / sin(kx))))
else if ((sin(kx) <= 5d-79) .or. (.not. (sin(kx) <= 2d-37)) .and. (sin(kx) <= 4d-23)) then
tmp = sin(th)
else
tmp = sin(ky) / (sin(kx) / sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.03) {
tmp = Math.abs((th * (Math.sin(ky) / Math.sin(kx))));
} else if ((Math.sin(kx) <= 5e-79) || (!(Math.sin(kx) <= 2e-37) && (Math.sin(kx) <= 4e-23))) {
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.03: tmp = math.fabs((th * (math.sin(ky) / math.sin(kx)))) elif (math.sin(kx) <= 5e-79) or (not (math.sin(kx) <= 2e-37) and (math.sin(kx) <= 4e-23)): 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.03) tmp = abs(Float64(th * Float64(sin(ky) / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-23))) 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.03) tmp = abs((th * (sin(ky) / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (~((sin(kx) <= 2e-37)) && (sin(kx) <= 4e-23))) 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.03], N[Abs[N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], And[N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37]], $MachinePrecision], LessEqual[N[Sin[kx], $MachinePrecision], 4e-23]]], 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.03:\\
\;\;\;\;\left|th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79} \lor \neg \left(\sin kx \leq 2 \cdot 10^{-37}\right) \land \sin kx \leq 4 \cdot 10^{-23}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in th around 0 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in ky around 0 24.9%
add-sqr-sqrt23.1%
sqrt-unprod27.4%
pow227.4%
associate-*l/27.4%
*-un-lft-identity27.4%
*-commutative27.4%
associate-/l*27.4%
Applied egg-rr27.4%
unpow227.4%
rem-sqrt-square29.5%
associate-*r/29.5%
*-commutative29.5%
associate-/l*29.5%
Simplified29.5%
if -0.029999999999999999 < (sin.f64 kx) < 4.99999999999999999e-79 or 2.00000000000000013e-37 < (sin.f64 kx) < 3.99999999999999984e-23Initial program 90.1%
unpow290.1%
sqr-neg90.1%
sin-neg90.1%
sin-neg90.1%
unpow290.1%
associate-*l/83.2%
associate-/l*90.1%
unpow290.1%
Simplified99.7%
Taylor expanded in kx around 0 34.0%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37 or 3.99999999999999984e-23 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/97.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 64.3%
Final simplification42.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.28)
(fabs (* th (/ (sin ky) (sin kx))))
(if (<= (sin kx) 5e-79)
(/ (sin th) (+ 1.0 (* 0.5 (pow (/ kx (sin ky)) 2.0))))
(if (or (<= (sin kx) 2e-37) (not (<= (sin kx) 4e-23)))
(/ (sin ky) (/ (sin kx) (sin th)))
(sin th)))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.28) {
tmp = fabs((th * (sin(ky) / sin(kx))));
} else if (sin(kx) <= 5e-79) {
tmp = sin(th) / (1.0 + (0.5 * pow((kx / sin(ky)), 2.0)));
} else if ((sin(kx) <= 2e-37) || !(sin(kx) <= 4e-23)) {
tmp = sin(ky) / (sin(kx) / sin(th));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.28d0)) then
tmp = abs((th * (sin(ky) / sin(kx))))
else if (sin(kx) <= 5d-79) then
tmp = sin(th) / (1.0d0 + (0.5d0 * ((kx / sin(ky)) ** 2.0d0)))
else if ((sin(kx) <= 2d-37) .or. (.not. (sin(kx) <= 4d-23))) then
tmp = sin(ky) / (sin(kx) / sin(th))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.28) {
tmp = Math.abs((th * (Math.sin(ky) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-79) {
tmp = Math.sin(th) / (1.0 + (0.5 * Math.pow((kx / Math.sin(ky)), 2.0)));
} else if ((Math.sin(kx) <= 2e-37) || !(Math.sin(kx) <= 4e-23)) {
tmp = Math.sin(ky) / (Math.sin(kx) / Math.sin(th));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.28: tmp = math.fabs((th * (math.sin(ky) / math.sin(kx)))) elif math.sin(kx) <= 5e-79: tmp = math.sin(th) / (1.0 + (0.5 * math.pow((kx / math.sin(ky)), 2.0))) elif (math.sin(kx) <= 2e-37) or not (math.sin(kx) <= 4e-23): tmp = math.sin(ky) / (math.sin(kx) / math.sin(th)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.28) tmp = abs(Float64(th * Float64(sin(ky) / sin(kx)))); elseif (sin(kx) <= 5e-79) tmp = Float64(sin(th) / Float64(1.0 + Float64(0.5 * (Float64(kx / sin(ky)) ^ 2.0)))); elseif ((sin(kx) <= 2e-37) || !(sin(kx) <= 4e-23)) tmp = Float64(sin(ky) / Float64(sin(kx) / sin(th))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.28) tmp = abs((th * (sin(ky) / sin(kx)))); elseif (sin(kx) <= 5e-79) tmp = sin(th) / (1.0 + (0.5 * ((kx / sin(ky)) ^ 2.0))); elseif ((sin(kx) <= 2e-37) || ~((sin(kx) <= 4e-23))) tmp = sin(ky) / (sin(kx) / sin(th)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.28], N[Abs[N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], N[(N[Sin[th], $MachinePrecision] / N[(1.0 + N[(0.5 * N[Power[N[(kx / N[Sin[ky], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37], N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 4e-23]], $MachinePrecision]], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.28:\\
\;\;\;\;\left|th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79}:\\
\;\;\;\;\frac{\sin th}{1 + 0.5 \cdot {\left(\frac{kx}{\sin ky}\right)}^{2}}\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-37} \lor \neg \left(\sin kx \leq 4 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.28000000000000003Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.6%
Taylor expanded in th around 0 51.0%
*-commutative51.0%
Simplified50.9%
Taylor expanded in ky around 0 21.9%
add-sqr-sqrt20.0%
sqrt-unprod24.3%
pow224.3%
associate-*l/24.3%
*-un-lft-identity24.3%
*-commutative24.3%
associate-/l*24.3%
Applied egg-rr24.3%
unpow224.3%
rem-sqrt-square26.8%
associate-*r/26.8%
*-commutative26.8%
associate-/l*26.8%
Simplified26.8%
if -0.28000000000000003 < (sin.f64 kx) < 4.99999999999999999e-79Initial program 90.7%
unpow290.7%
sqr-neg90.7%
sin-neg90.7%
sin-neg90.7%
unpow290.7%
associate-*l/84.2%
associate-/l*90.6%
unpow290.6%
Simplified99.7%
associate-*r/92.6%
hypot-undefine84.2%
unpow284.2%
unpow284.2%
+-commutative84.2%
associate-*l/90.7%
*-commutative90.7%
clear-num90.7%
un-div-inv90.7%
+-commutative90.7%
unpow290.7%
unpow290.7%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in kx around 0 31.9%
unpow231.9%
associate-/l*32.2%
Applied egg-rr32.2%
associate-*r/31.9%
unpow231.9%
times-frac34.8%
unpow234.8%
Simplified34.8%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37 or 3.99999999999999984e-23 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/97.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 64.3%
if 2.00000000000000013e-37 < (sin.f64 kx) < 3.99999999999999984e-23Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/100.0%
associate-/l*100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in kx around 0 35.2%
Final simplification42.0%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (/ ky (sin kx))))
(if (<= (sin kx) -0.03)
(fabs (* th t_1))
(if (<= (sin kx) 5e-79)
(sin th)
(if (<= (sin kx) 2e-37)
(* ky (/ (sin th) (sin kx)))
(if (<= (sin kx) 4e-17) (sin th) (/ t_1 (/ 1.0 (sin th)))))))))
double code(double kx, double ky, double th) {
double t_1 = ky / sin(kx);
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((th * t_1));
} else if (sin(kx) <= 5e-79) {
tmp = sin(th);
} else if (sin(kx) <= 2e-37) {
tmp = ky * (sin(th) / sin(kx));
} else if (sin(kx) <= 4e-17) {
tmp = sin(th);
} else {
tmp = t_1 / (1.0 / sin(th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = ky / sin(kx)
if (sin(kx) <= (-0.03d0)) then
tmp = abs((th * t_1))
else if (sin(kx) <= 5d-79) then
tmp = sin(th)
else if (sin(kx) <= 2d-37) then
tmp = ky * (sin(th) / sin(kx))
else if (sin(kx) <= 4d-17) then
tmp = sin(th)
else
tmp = t_1 / (1.0d0 / sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double t_1 = ky / Math.sin(kx);
double tmp;
if (Math.sin(kx) <= -0.03) {
tmp = Math.abs((th * t_1));
} else if (Math.sin(kx) <= 5e-79) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 2e-37) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(kx) <= 4e-17) {
tmp = Math.sin(th);
} else {
tmp = t_1 / (1.0 / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): t_1 = ky / math.sin(kx) tmp = 0 if math.sin(kx) <= -0.03: tmp = math.fabs((th * t_1)) elif math.sin(kx) <= 5e-79: tmp = math.sin(th) elif math.sin(kx) <= 2e-37: tmp = ky * (math.sin(th) / math.sin(kx)) elif math.sin(kx) <= 4e-17: tmp = math.sin(th) else: tmp = t_1 / (1.0 / math.sin(th)) return tmp
function code(kx, ky, th) t_1 = Float64(ky / sin(kx)) tmp = 0.0 if (sin(kx) <= -0.03) tmp = abs(Float64(th * t_1)); elseif (sin(kx) <= 5e-79) tmp = sin(th); elseif (sin(kx) <= 2e-37) tmp = Float64(ky * Float64(sin(th) / sin(kx))); elseif (sin(kx) <= 4e-17) tmp = sin(th); else tmp = Float64(t_1 / Float64(1.0 / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = ky / sin(kx); tmp = 0.0; if (sin(kx) <= -0.03) tmp = abs((th * t_1)); elseif (sin(kx) <= 5e-79) tmp = sin(th); elseif (sin(kx) <= 2e-37) tmp = ky * (sin(th) / sin(kx)); elseif (sin(kx) <= 4e-17) tmp = sin(th); else tmp = t_1 / (1.0 / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sin[kx], $MachinePrecision], -0.03], N[Abs[N[(th * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 4e-17], N[Sin[th], $MachinePrecision], N[(t$95$1 / N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{ky}{\sin kx}\\
\mathbf{if}\;\sin kx \leq -0.03:\\
\;\;\;\;\left|th \cdot t\_1\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-37}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in th around 0 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in ky around 0 24.9%
associate-/l*24.9%
Simplified24.9%
add-sqr-sqrt23.1%
sqrt-unprod26.2%
pow226.2%
Applied egg-rr26.2%
unpow226.2%
rem-sqrt-square28.2%
associate-*r/28.2%
*-rgt-identity28.2%
times-frac28.2%
/-rgt-identity28.2%
Simplified28.2%
if -0.029999999999999999 < (sin.f64 kx) < 4.99999999999999999e-79 or 2.00000000000000013e-37 < (sin.f64 kx) < 4.00000000000000029e-17Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/83.7%
associate-/l*90.3%
unpow290.3%
Simplified99.7%
Taylor expanded in kx around 0 33.1%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/86.5%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 61.4%
associate-/l*74.5%
Simplified74.5%
if 4.00000000000000029e-17 < (sin.f64 kx) Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/98.6%
associate-/l*99.3%
unpow299.3%
Simplified99.5%
expm1-log1p-u99.3%
Applied egg-rr99.3%
expm1-log1p-u99.5%
clear-num99.5%
div-inv99.6%
div-inv99.6%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 57.1%
Final simplification39.3%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.03)
(fabs (* th (/ (sin ky) (sin kx))))
(if (<= (sin kx) 5e-79)
(sin th)
(if (<= (sin kx) 2e-37)
(* ky (/ (sin th) (sin kx)))
(if (<= (sin kx) 4e-17)
(sin th)
(/ (/ ky (sin kx)) (/ 1.0 (sin th))))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((th * (sin(ky) / sin(kx))));
} else if (sin(kx) <= 5e-79) {
tmp = sin(th);
} else if (sin(kx) <= 2e-37) {
tmp = ky * (sin(th) / sin(kx));
} else if (sin(kx) <= 4e-17) {
tmp = sin(th);
} else {
tmp = (ky / sin(kx)) / (1.0 / sin(th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.03d0)) then
tmp = abs((th * (sin(ky) / sin(kx))))
else if (sin(kx) <= 5d-79) then
tmp = sin(th)
else if (sin(kx) <= 2d-37) then
tmp = ky * (sin(th) / sin(kx))
else if (sin(kx) <= 4d-17) then
tmp = sin(th)
else
tmp = (ky / sin(kx)) / (1.0d0 / sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.03) {
tmp = Math.abs((th * (Math.sin(ky) / Math.sin(kx))));
} else if (Math.sin(kx) <= 5e-79) {
tmp = Math.sin(th);
} else if (Math.sin(kx) <= 2e-37) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else if (Math.sin(kx) <= 4e-17) {
tmp = Math.sin(th);
} else {
tmp = (ky / Math.sin(kx)) / (1.0 / Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.03: tmp = math.fabs((th * (math.sin(ky) / math.sin(kx)))) elif math.sin(kx) <= 5e-79: tmp = math.sin(th) elif math.sin(kx) <= 2e-37: tmp = ky * (math.sin(th) / math.sin(kx)) elif math.sin(kx) <= 4e-17: tmp = math.sin(th) else: tmp = (ky / math.sin(kx)) / (1.0 / math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.03) tmp = abs(Float64(th * Float64(sin(ky) / sin(kx)))); elseif (sin(kx) <= 5e-79) tmp = sin(th); elseif (sin(kx) <= 2e-37) tmp = Float64(ky * Float64(sin(th) / sin(kx))); elseif (sin(kx) <= 4e-17) tmp = sin(th); else tmp = Float64(Float64(ky / sin(kx)) / Float64(1.0 / sin(th))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.03) tmp = abs((th * (sin(ky) / sin(kx)))); elseif (sin(kx) <= 5e-79) tmp = sin(th); elseif (sin(kx) <= 2e-37) tmp = ky * (sin(th) / sin(kx)); elseif (sin(kx) <= 4e-17) tmp = sin(th); else tmp = (ky / sin(kx)) / (1.0 / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.03], N[Abs[N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 4e-17], N[Sin[th], $MachinePrecision], N[(N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.03:\\
\;\;\;\;\left|th \cdot \frac{\sin ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 2 \cdot 10^{-37}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin kx \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{ky}{\sin kx}}{\frac{1}{\sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in th around 0 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in ky around 0 24.9%
add-sqr-sqrt23.1%
sqrt-unprod27.4%
pow227.4%
associate-*l/27.4%
*-un-lft-identity27.4%
*-commutative27.4%
associate-/l*27.4%
Applied egg-rr27.4%
unpow227.4%
rem-sqrt-square29.5%
associate-*r/29.5%
*-commutative29.5%
associate-/l*29.5%
Simplified29.5%
if -0.029999999999999999 < (sin.f64 kx) < 4.99999999999999999e-79 or 2.00000000000000013e-37 < (sin.f64 kx) < 4.00000000000000029e-17Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/83.7%
associate-/l*90.3%
unpow290.3%
Simplified99.7%
Taylor expanded in kx around 0 33.1%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/86.5%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in ky around 0 61.4%
associate-/l*74.5%
Simplified74.5%
if 4.00000000000000029e-17 < (sin.f64 kx) Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/98.6%
associate-/l*99.3%
unpow299.3%
Simplified99.5%
expm1-log1p-u99.3%
Applied egg-rr99.3%
expm1-log1p-u99.5%
clear-num99.5%
div-inv99.6%
div-inv99.6%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in ky around 0 57.1%
Final simplification39.6%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.03)
(fabs (* th (/ ky (sin kx))))
(if (or (<= (sin kx) 5e-79)
(and (not (<= (sin kx) 2e-37)) (<= (sin kx) 4e-17)))
(sin th)
(* ky (/ (sin th) (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.03) {
tmp = fabs((th * (ky / sin(kx))));
} else if ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-17))) {
tmp = sin(th);
} else {
tmp = ky * (sin(th) / sin(kx));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(kx) <= (-0.03d0)) then
tmp = abs((th * (ky / sin(kx))))
else if ((sin(kx) <= 5d-79) .or. (.not. (sin(kx) <= 2d-37)) .and. (sin(kx) <= 4d-17)) then
tmp = sin(th)
else
tmp = ky * (sin(th) / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(kx) <= -0.03) {
tmp = Math.abs((th * (ky / Math.sin(kx))));
} else if ((Math.sin(kx) <= 5e-79) || (!(Math.sin(kx) <= 2e-37) && (Math.sin(kx) <= 4e-17))) {
tmp = Math.sin(th);
} else {
tmp = ky * (Math.sin(th) / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.03: tmp = math.fabs((th * (ky / math.sin(kx)))) elif (math.sin(kx) <= 5e-79) or (not (math.sin(kx) <= 2e-37) and (math.sin(kx) <= 4e-17)): tmp = math.sin(th) else: tmp = ky * (math.sin(th) / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.03) tmp = abs(Float64(th * Float64(ky / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (!(sin(kx) <= 2e-37) && (sin(kx) <= 4e-17))) tmp = sin(th); else tmp = Float64(ky * Float64(sin(th) / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.03) tmp = abs((th * (ky / sin(kx)))); elseif ((sin(kx) <= 5e-79) || (~((sin(kx) <= 2e-37)) && (sin(kx) <= 4e-17))) tmp = sin(th); else tmp = ky * (sin(th) / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.03], N[Abs[N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 5e-79], And[N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 2e-37]], $MachinePrecision], LessEqual[N[Sin[kx], $MachinePrecision], 4e-17]]], N[Sin[th], $MachinePrecision], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.03:\\
\;\;\;\;\left|th \cdot \frac{ky}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 5 \cdot 10^{-79} \lor \neg \left(\sin kx \leq 2 \cdot 10^{-37}\right) \land \sin kx \leq 4 \cdot 10^{-17}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.029999999999999999Initial program 99.5%
unpow299.5%
sqr-neg99.5%
sin-neg99.5%
sin-neg99.5%
unpow299.5%
associate-*l/99.5%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in th around 0 52.5%
*-commutative52.5%
Simplified52.5%
Taylor expanded in ky around 0 24.9%
associate-/l*24.9%
Simplified24.9%
add-sqr-sqrt23.1%
sqrt-unprod26.2%
pow226.2%
Applied egg-rr26.2%
unpow226.2%
rem-sqrt-square28.2%
associate-*r/28.2%
*-rgt-identity28.2%
times-frac28.2%
/-rgt-identity28.2%
Simplified28.2%
if -0.029999999999999999 < (sin.f64 kx) < 4.99999999999999999e-79 or 2.00000000000000013e-37 < (sin.f64 kx) < 4.00000000000000029e-17Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/83.7%
associate-/l*90.3%
unpow290.3%
Simplified99.7%
Taylor expanded in kx around 0 33.1%
if 4.99999999999999999e-79 < (sin.f64 kx) < 2.00000000000000013e-37 or 4.00000000000000029e-17 < (sin.f64 kx) Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/97.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in ky around 0 56.8%
associate-/l*58.7%
Simplified58.7%
Final simplification39.3%
(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 95.3%
unpow295.3%
sqr-neg95.3%
sin-neg95.3%
sin-neg95.3%
unpow295.3%
associate-*l/91.7%
associate-/l*95.2%
unpow295.2%
Simplified99.6%
Final simplification99.6%
(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(sin(ky) / Float64(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[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{\sin th}}
\end{array}
Initial program 95.3%
unpow295.3%
sqr-neg95.3%
sin-neg95.3%
sin-neg95.3%
unpow295.3%
associate-*l/91.7%
associate-/l*95.2%
unpow295.2%
Simplified99.6%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00175)
(* th (/ (sin ky) (hypot (sin ky) (sin kx))))
(if (<= th 4.3e+60)
(sin th)
(if (<= th 1.1e+92)
(/ (sin th) (/ (sin kx) (sin ky)))
(if (or (<= th 2.2e+161) (and (not (<= th 6.7e+215)) (<= th 2.6e+239)))
(sin th)
(/ (sin ky) (/ (sin kx) (sin th))))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00175) {
tmp = th * (sin(ky) / hypot(sin(ky), sin(kx)));
} else if (th <= 4.3e+60) {
tmp = sin(th);
} else if (th <= 1.1e+92) {
tmp = sin(th) / (sin(kx) / sin(ky));
} else if ((th <= 2.2e+161) || (!(th <= 6.7e+215) && (th <= 2.6e+239))) {
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 (th <= 0.00175) {
tmp = th * (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else if (th <= 4.3e+60) {
tmp = Math.sin(th);
} else if (th <= 1.1e+92) {
tmp = Math.sin(th) / (Math.sin(kx) / Math.sin(ky));
} else if ((th <= 2.2e+161) || (!(th <= 6.7e+215) && (th <= 2.6e+239))) {
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 th <= 0.00175: tmp = th * (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) elif th <= 4.3e+60: tmp = math.sin(th) elif th <= 1.1e+92: tmp = math.sin(th) / (math.sin(kx) / math.sin(ky)) elif (th <= 2.2e+161) or (not (th <= 6.7e+215) and (th <= 2.6e+239)): 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 (th <= 0.00175) tmp = Float64(th * Float64(sin(ky) / hypot(sin(ky), sin(kx)))); elseif (th <= 4.3e+60) tmp = sin(th); elseif (th <= 1.1e+92) tmp = Float64(sin(th) / Float64(sin(kx) / sin(ky))); elseif ((th <= 2.2e+161) || (!(th <= 6.7e+215) && (th <= 2.6e+239))) 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 (th <= 0.00175) tmp = th * (sin(ky) / hypot(sin(ky), sin(kx))); elseif (th <= 4.3e+60) tmp = sin(th); elseif (th <= 1.1e+92) tmp = sin(th) / (sin(kx) / sin(ky)); elseif ((th <= 2.2e+161) || (~((th <= 6.7e+215)) && (th <= 2.6e+239))) tmp = sin(th); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00175], N[(th * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 4.3e+60], N[Sin[th], $MachinePrecision], If[LessEqual[th, 1.1e+92], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[th, 2.2e+161], And[N[Not[LessEqual[th, 6.7e+215]], $MachinePrecision], LessEqual[th, 2.6e+239]]], 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}\;th \leq 0.00175:\\
\;\;\;\;th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{elif}\;th \leq 4.3 \cdot 10^{+60}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;th \leq 1.1 \cdot 10^{+92}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\mathbf{elif}\;th \leq 2.2 \cdot 10^{+161} \lor \neg \left(th \leq 6.7 \cdot 10^{+215}\right) \land th \leq 2.6 \cdot 10^{+239}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if th < 0.00175000000000000004Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/92.0%
associate-/l*96.8%
unpow296.8%
Simplified99.6%
Taylor expanded in th around 0 59.4%
*-commutative59.4%
Simplified59.4%
*-commutative59.4%
sqrt-div59.4%
metadata-eval59.4%
sqrt-pow160.0%
metadata-eval60.0%
pow160.0%
un-div-inv60.0%
hypot-undefine59.4%
+-commutative59.4%
hypot-undefine60.0%
Applied egg-rr60.0%
associate-*r/65.3%
Simplified65.3%
if 0.00175000000000000004 < th < 4.29999999999999971e60 or 1.09999999999999996e92 < th < 2.2e161 or 6.6999999999999996e215 < th < 2.6000000000000002e239Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/89.3%
associate-/l*89.1%
unpow289.1%
Simplified99.6%
Taylor expanded in kx around 0 20.4%
if 4.29999999999999971e60 < th < 1.09999999999999996e92Initial program 78.2%
unpow278.2%
sqr-neg78.2%
sin-neg78.2%
sin-neg78.2%
unpow278.2%
associate-*l/77.8%
associate-/l*77.8%
unpow277.8%
Simplified99.3%
associate-*r/99.5%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
associate-*l/78.2%
*-commutative78.2%
clear-num78.0%
un-div-inv78.0%
+-commutative78.0%
unpow278.0%
unpow278.0%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 37.7%
if 2.2e161 < th < 6.6999999999999996e215 or 2.6000000000000002e239 < th Initial program 96.0%
unpow296.0%
sqr-neg96.0%
sin-neg96.0%
sin-neg96.0%
unpow296.0%
associate-*l/96.3%
associate-/l*96.0%
unpow296.0%
Simplified99.4%
clear-num99.4%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 25.8%
Final simplification55.1%
(FPCore (kx ky th)
:precision binary64
(if (<= th 0.00172)
(/ (sin ky) (/ (hypot (sin ky) (sin kx)) th))
(if (<= th 3.4e+60)
(sin th)
(if (<= th 1.15e+92)
(/ (sin th) (/ (sin kx) (sin ky)))
(if (or (<= th 2.3e+161) (and (not (<= th 9e+211)) (<= th 3.05e+239)))
(sin th)
(/ (sin ky) (/ (sin kx) (sin th))))))))
double code(double kx, double ky, double th) {
double tmp;
if (th <= 0.00172) {
tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th);
} else if (th <= 3.4e+60) {
tmp = sin(th);
} else if (th <= 1.15e+92) {
tmp = sin(th) / (sin(kx) / sin(ky));
} else if ((th <= 2.3e+161) || (!(th <= 9e+211) && (th <= 3.05e+239))) {
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 (th <= 0.00172) {
tmp = Math.sin(ky) / (Math.hypot(Math.sin(ky), Math.sin(kx)) / th);
} else if (th <= 3.4e+60) {
tmp = Math.sin(th);
} else if (th <= 1.15e+92) {
tmp = Math.sin(th) / (Math.sin(kx) / Math.sin(ky));
} else if ((th <= 2.3e+161) || (!(th <= 9e+211) && (th <= 3.05e+239))) {
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 th <= 0.00172: tmp = math.sin(ky) / (math.hypot(math.sin(ky), math.sin(kx)) / th) elif th <= 3.4e+60: tmp = math.sin(th) elif th <= 1.15e+92: tmp = math.sin(th) / (math.sin(kx) / math.sin(ky)) elif (th <= 2.3e+161) or (not (th <= 9e+211) and (th <= 3.05e+239)): 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 (th <= 0.00172) tmp = Float64(sin(ky) / Float64(hypot(sin(ky), sin(kx)) / th)); elseif (th <= 3.4e+60) tmp = sin(th); elseif (th <= 1.15e+92) tmp = Float64(sin(th) / Float64(sin(kx) / sin(ky))); elseif ((th <= 2.3e+161) || (!(th <= 9e+211) && (th <= 3.05e+239))) 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 (th <= 0.00172) tmp = sin(ky) / (hypot(sin(ky), sin(kx)) / th); elseif (th <= 3.4e+60) tmp = sin(th); elseif (th <= 1.15e+92) tmp = sin(th) / (sin(kx) / sin(ky)); elseif ((th <= 2.3e+161) || (~((th <= 9e+211)) && (th <= 3.05e+239))) tmp = sin(th); else tmp = sin(ky) / (sin(kx) / sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[th, 0.00172], N[(N[Sin[ky], $MachinePrecision] / N[(N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision], If[LessEqual[th, 3.4e+60], N[Sin[th], $MachinePrecision], If[LessEqual[th, 1.15e+92], N[(N[Sin[th], $MachinePrecision] / N[(N[Sin[kx], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[th, 2.3e+161], And[N[Not[LessEqual[th, 9e+211]], $MachinePrecision], LessEqual[th, 3.05e+239]]], 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}\;th \leq 0.00172:\\
\;\;\;\;\frac{\sin ky}{\frac{\mathsf{hypot}\left(\sin ky, \sin kx\right)}{th}}\\
\mathbf{elif}\;th \leq 3.4 \cdot 10^{+60}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;th \leq 1.15 \cdot 10^{+92}:\\
\;\;\;\;\frac{\sin th}{\frac{\sin kx}{\sin ky}}\\
\mathbf{elif}\;th \leq 2.3 \cdot 10^{+161} \lor \neg \left(th \leq 9 \cdot 10^{+211}\right) \land th \leq 3.05 \cdot 10^{+239}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin ky}{\frac{\sin kx}{\sin th}}\\
\end{array}
\end{array}
if th < 0.00171999999999999996Initial program 96.9%
unpow296.9%
sqr-neg96.9%
sin-neg96.9%
sin-neg96.9%
unpow296.9%
associate-*l/92.0%
associate-/l*96.8%
unpow296.8%
Simplified99.6%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in th around 0 64.2%
associate-*l/64.3%
+-commutative64.3%
unpow264.3%
unpow264.3%
hypot-undefine65.3%
*-lft-identity65.3%
Simplified65.3%
if 0.00171999999999999996 < th < 3.4e60 or 1.14999999999999999e92 < th < 2.2999999999999999e161 or 9e211 < th < 3.0500000000000002e239Initial program 89.2%
unpow289.2%
sqr-neg89.2%
sin-neg89.2%
sin-neg89.2%
unpow289.2%
associate-*l/89.3%
associate-/l*89.1%
unpow289.1%
Simplified99.6%
Taylor expanded in kx around 0 20.4%
if 3.4e60 < th < 1.14999999999999999e92Initial program 78.2%
unpow278.2%
sqr-neg78.2%
sin-neg78.2%
sin-neg78.2%
unpow278.2%
associate-*l/77.8%
associate-/l*77.8%
unpow277.8%
Simplified99.3%
associate-*r/99.5%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
associate-*l/78.2%
*-commutative78.2%
clear-num78.0%
un-div-inv78.0%
+-commutative78.0%
unpow278.0%
unpow278.0%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 37.7%
if 2.2999999999999999e161 < th < 9e211 or 3.0500000000000002e239 < th Initial program 96.0%
unpow296.0%
sqr-neg96.0%
sin-neg96.0%
sin-neg96.0%
unpow296.0%
associate-*l/96.3%
associate-/l*96.0%
unpow296.0%
Simplified99.4%
clear-num99.4%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 25.8%
Final simplification55.1%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.35e+39) (sin th) (fabs (* th (/ ky (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e+39) {
tmp = sin(th);
} else {
tmp = fabs((th * (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 (kx <= 1.35d+39) then
tmp = sin(th)
else
tmp = abs((th * (ky / sin(kx))))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e+39) {
tmp = Math.sin(th);
} else {
tmp = Math.abs((th * (ky / Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.35e+39: tmp = math.sin(th) else: tmp = math.fabs((th * (ky / math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.35e+39) tmp = sin(th); else tmp = abs(Float64(th * Float64(ky / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.35e+39) tmp = sin(th); else tmp = abs((th * (ky / sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.35e+39], N[Sin[th], $MachinePrecision], N[Abs[N[(th * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.35 \cdot 10^{+39}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|th \cdot \frac{ky}{\sin kx}\right|\\
\end{array}
\end{array}
if kx < 1.35000000000000002e39Initial program 94.1%
unpow294.1%
sqr-neg94.1%
sin-neg94.1%
sin-neg94.1%
unpow294.1%
associate-*l/89.3%
associate-/l*94.0%
unpow294.0%
Simplified99.6%
Taylor expanded in kx around 0 24.4%
if 1.35000000000000002e39 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.6%
Taylor expanded in th around 0 53.0%
*-commutative53.0%
Simplified52.9%
Taylor expanded in ky around 0 33.4%
associate-/l*33.5%
Simplified33.5%
add-sqr-sqrt28.4%
sqrt-unprod26.9%
pow226.9%
Applied egg-rr26.9%
unpow226.9%
rem-sqrt-square31.2%
associate-*r/31.2%
*-rgt-identity31.2%
times-frac31.2%
/-rgt-identity31.2%
Simplified31.2%
Final simplification25.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.7e+46) (sin th) (* ky (/ th (sin kx)))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.7e+46) {
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 <= 1.7d+46) 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 <= 1.7e+46) {
tmp = Math.sin(th);
} else {
tmp = ky * (th / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.7e+46: tmp = math.sin(th) else: tmp = ky * (th / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.7e+46) 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 <= 1.7e+46) tmp = sin(th); else tmp = ky * (th / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.7e+46], N[Sin[th], $MachinePrecision], N[(ky * N[(th / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;ky \cdot \frac{th}{\sin kx}\\
\end{array}
\end{array}
if kx < 1.6999999999999999e46Initial program 94.2%
unpow294.2%
sqr-neg94.2%
sin-neg94.2%
sin-neg94.2%
unpow294.2%
associate-*l/89.6%
associate-/l*94.1%
unpow294.1%
Simplified99.6%
Taylor expanded in kx around 0 23.9%
if 1.6999999999999999e46 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.6%
Taylor expanded in th around 0 54.8%
*-commutative54.8%
Simplified54.7%
Taylor expanded in ky around 0 35.3%
associate-/l*35.3%
Simplified35.3%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 3.2e+46) (sin th) (/ ky (/ (sin kx) th))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.2e+46) {
tmp = sin(th);
} else {
tmp = ky / (sin(kx) / 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 (kx <= 3.2d+46) then
tmp = sin(th)
else
tmp = ky / (sin(kx) / th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 3.2e+46) {
tmp = Math.sin(th);
} else {
tmp = ky / (Math.sin(kx) / th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 3.2e+46: tmp = math.sin(th) else: tmp = ky / (math.sin(kx) / th) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 3.2e+46) tmp = sin(th); else tmp = Float64(ky / Float64(sin(kx) / th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 3.2e+46) tmp = sin(th); else tmp = ky / (sin(kx) / th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 3.2e+46], N[Sin[th], $MachinePrecision], N[(ky / N[(N[Sin[kx], $MachinePrecision] / th), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 3.2 \cdot 10^{+46}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{\sin kx}{th}}\\
\end{array}
\end{array}
if kx < 3.1999999999999998e46Initial program 94.2%
unpow294.2%
sqr-neg94.2%
sin-neg94.2%
sin-neg94.2%
unpow294.2%
associate-*l/89.6%
associate-/l*94.1%
unpow294.1%
Simplified99.6%
Taylor expanded in kx around 0 23.9%
if 3.1999999999999998e46 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.6%
Taylor expanded in th around 0 54.8%
*-commutative54.8%
Simplified54.7%
Taylor expanded in ky around 0 35.3%
associate-/l*35.3%
Simplified35.3%
clear-num35.3%
un-div-inv35.4%
Applied egg-rr35.4%
Final simplification26.4%
(FPCore (kx ky th) :precision binary64 (if (<= ky 2.1e-158) (* ky (/ th kx)) (sin th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 2.1e-158) {
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 <= 2.1d-158) 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 <= 2.1e-158) {
tmp = ky * (th / kx);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 2.1e-158: tmp = ky * (th / kx) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 2.1e-158) 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 <= 2.1e-158) tmp = ky * (th / kx); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 2.1e-158], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 2.1 \cdot 10^{-158}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if ky < 2.09999999999999991e-158Initial program 93.1%
unpow293.1%
sqr-neg93.1%
sin-neg93.1%
sin-neg93.1%
unpow293.1%
associate-*l/88.9%
associate-/l*93.1%
unpow293.1%
Simplified99.6%
Taylor expanded in th around 0 42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in ky around 0 18.6%
associate-/l*20.5%
Simplified20.5%
Taylor expanded in kx around 0 19.3%
if 2.09999999999999991e-158 < ky Initial program 99.3%
unpow299.3%
sqr-neg99.3%
sin-neg99.3%
sin-neg99.3%
unpow299.3%
associate-*l/96.7%
associate-/l*99.2%
unpow299.2%
Simplified99.5%
Taylor expanded in kx around 0 35.6%
Final simplification25.0%
(FPCore (kx ky th) :precision binary64 (if (<= ky 5.2e-92) (* ky (/ th kx)) th))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= 5.2e-92) {
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 <= 5.2d-92) 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 <= 5.2e-92) {
tmp = ky * (th / kx);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= 5.2e-92: tmp = ky * (th / kx) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= 5.2e-92) 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 <= 5.2e-92) tmp = ky * (th / kx); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, 5.2e-92], N[(ky * N[(th / kx), $MachinePrecision]), $MachinePrecision], th]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq 5.2 \cdot 10^{-92}:\\
\;\;\;\;ky \cdot \frac{th}{kx}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < 5.2e-92Initial program 93.5%
unpow293.5%
sqr-neg93.5%
sin-neg93.5%
sin-neg93.5%
unpow293.5%
associate-*l/89.7%
associate-/l*93.5%
unpow293.5%
Simplified99.6%
Taylor expanded in th around 0 42.4%
*-commutative42.4%
Simplified42.3%
Taylor expanded in ky around 0 19.9%
associate-/l*21.7%
Simplified21.7%
Taylor expanded in kx around 0 19.5%
if 5.2e-92 < ky Initial program 99.7%
unpow299.7%
sqr-neg99.7%
sin-neg99.7%
sin-neg99.7%
unpow299.7%
associate-*l/96.4%
associate-/l*99.5%
unpow299.5%
Simplified99.6%
Taylor expanded in th around 0 52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in kx around 0 22.6%
Final simplification20.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.35e+39) th 0.0))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e+39) {
tmp = th;
} else {
tmp = 0.0;
}
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 <= 1.35d+39) then
tmp = th
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.35e+39) {
tmp = th;
} else {
tmp = 0.0;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.35e+39: tmp = th else: tmp = 0.0 return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.35e+39) tmp = th; else tmp = 0.0; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.35e+39) tmp = th; else tmp = 0.0; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.35e+39], th, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.35 \cdot 10^{+39}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if kx < 1.35000000000000002e39Initial program 94.1%
unpow294.1%
sqr-neg94.1%
sin-neg94.1%
sin-neg94.1%
unpow294.1%
associate-*l/89.3%
associate-/l*94.0%
unpow294.0%
Simplified99.6%
Taylor expanded in th around 0 42.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in kx around 0 14.2%
if 1.35000000000000002e39 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.4%
associate-/l*99.4%
unpow299.4%
Simplified99.6%
Taylor expanded in th around 0 53.0%
*-commutative53.0%
Simplified52.9%
Taylor expanded in ky around 0 35.9%
expm1-log1p-u35.5%
expm1-undefine25.7%
associate-*l/25.7%
*-un-lft-identity25.7%
*-commutative25.7%
associate-/l*25.7%
Applied egg-rr25.7%
Taylor expanded in ky around 0 26.0%
Final simplification16.9%
(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 95.3%
unpow295.3%
sqr-neg95.3%
sin-neg95.3%
sin-neg95.3%
unpow295.3%
associate-*l/91.7%
associate-/l*95.2%
unpow295.2%
Simplified99.6%
Taylor expanded in th around 0 45.2%
*-commutative45.2%
Simplified45.2%
Taylor expanded in kx around 0 12.0%
Final simplification12.0%
herbie shell --seed 2024080
(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)))