
(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 16 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.7%
Applied egg-rr99.7%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.1)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(if (<= (sin ky) 5e-65)
(* (sin th) (/ (sin ky) (sin kx)))
(if (or (<= (sin ky) 1e-40) (not (<= (sin ky) 1.8e-6)))
(sin th)
(fabs (* (sin ky) (/ (sin th) (sin kx))))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.1) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else if (sin(ky) <= 5e-65) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if ((sin(ky) <= 1e-40) || !(sin(ky) <= 1.8e-6)) {
tmp = sin(th);
} else {
tmp = fabs((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(ky) <= (-0.1d0)) then
tmp = sin(ky) * abs((sin(th) / sin(ky)))
else if (sin(ky) <= 5d-65) then
tmp = sin(th) * (sin(ky) / sin(kx))
else if ((sin(ky) <= 1d-40) .or. (.not. (sin(ky) <= 1.8d-6))) then
tmp = sin(th)
else
tmp = abs((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(ky) <= -0.1) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else if (Math.sin(ky) <= 5e-65) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if ((Math.sin(ky) <= 1e-40) || !(Math.sin(ky) <= 1.8e-6)) {
tmp = Math.sin(th);
} else {
tmp = Math.abs((Math.sin(ky) * (Math.sin(th) / Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.1: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) elif math.sin(ky) <= 5e-65: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) elif (math.sin(ky) <= 1e-40) or not (math.sin(ky) <= 1.8e-6): tmp = math.sin(th) else: tmp = math.fabs((math.sin(ky) * (math.sin(th) / math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.1) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); elseif (sin(ky) <= 5e-65) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif ((sin(ky) <= 1e-40) || !(sin(ky) <= 1.8e-6)) tmp = sin(th); else tmp = abs(Float64(sin(ky) * Float64(sin(th) / sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.1) tmp = sin(ky) * abs((sin(th) / sin(ky))); elseif (sin(ky) <= 5e-65) tmp = sin(th) * (sin(ky) / sin(kx)); elseif ((sin(ky) <= 1e-40) || ~((sin(ky) <= 1.8e-6))) tmp = sin(th); else tmp = abs((sin(ky) * (sin(th) / sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.1], N[(N[Sin[ky], $MachinePrecision] * N[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 1.8e-6]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[Abs[N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.1:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-40} \lor \neg \left(\sin ky \leq 1.8 \cdot 10^{-6}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin ky \cdot \frac{\sin th}{\sin kx}\right|\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.10000000000000001Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.7%
associate-/l*99.5%
unpow299.5%
Simplified99.6%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt1.7%
sqrt-unprod18.1%
pow218.1%
Applied egg-rr18.1%
unpow218.1%
rem-sqrt-square21.7%
Simplified21.7%
if -0.10000000000000001 < (sin.f64 ky) < 4.99999999999999983e-65Initial program 85.2%
+-commutative85.2%
unpow285.2%
unpow285.2%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 51.0%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 1.79999999999999992e-6 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.7%
if 9.9999999999999993e-41 < (sin.f64 ky) < 1.79999999999999992e-6Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.2%
associate-/l*99.3%
unpow299.3%
Simplified99.3%
associate-*r/99.2%
*-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 27.1%
add-sqr-sqrt1.5%
sqrt-unprod14.0%
pow214.0%
*-commutative14.0%
associate-/l*14.0%
Applied egg-rr14.0%
unpow214.0%
rem-sqrt-square26.8%
Simplified26.8%
Final simplification46.2%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin kx) -0.1)
(fabs (* (sin ky) (/ (sin th) (sin kx))))
(if (<= (sin kx) 1e-109)
(sin th)
(if (or (<= (sin kx) 1e-47) (not (<= (sin kx) 5e-24)))
(* (sin th) (/ (sin ky) (sin kx)))
(/ 1.0 (/ (sin ky) (* (sin ky) (sin th))))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(kx) <= -0.1) {
tmp = fabs((sin(ky) * (sin(th) / sin(kx))));
} else if (sin(kx) <= 1e-109) {
tmp = sin(th);
} else if ((sin(kx) <= 1e-47) || !(sin(kx) <= 5e-24)) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else {
tmp = 1.0 / (sin(ky) / (sin(ky) * 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.1d0)) then
tmp = abs((sin(ky) * (sin(th) / sin(kx))))
else if (sin(kx) <= 1d-109) then
tmp = sin(th)
else if ((sin(kx) <= 1d-47) .or. (.not. (sin(kx) <= 5d-24))) then
tmp = sin(th) * (sin(ky) / sin(kx))
else
tmp = 1.0d0 / (sin(ky) / (sin(ky) * 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.1) {
tmp = Math.abs((Math.sin(ky) * (Math.sin(th) / Math.sin(kx))));
} else if (Math.sin(kx) <= 1e-109) {
tmp = Math.sin(th);
} else if ((Math.sin(kx) <= 1e-47) || !(Math.sin(kx) <= 5e-24)) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else {
tmp = 1.0 / (Math.sin(ky) / (Math.sin(ky) * Math.sin(th)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(kx) <= -0.1: tmp = math.fabs((math.sin(ky) * (math.sin(th) / math.sin(kx)))) elif math.sin(kx) <= 1e-109: tmp = math.sin(th) elif (math.sin(kx) <= 1e-47) or not (math.sin(kx) <= 5e-24): tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) else: tmp = 1.0 / (math.sin(ky) / (math.sin(ky) * math.sin(th))) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(kx) <= -0.1) tmp = abs(Float64(sin(ky) * Float64(sin(th) / sin(kx)))); elseif (sin(kx) <= 1e-109) tmp = sin(th); elseif ((sin(kx) <= 1e-47) || !(sin(kx) <= 5e-24)) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); else tmp = Float64(1.0 / Float64(sin(ky) / Float64(sin(ky) * sin(th)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(kx) <= -0.1) tmp = abs((sin(ky) * (sin(th) / sin(kx)))); elseif (sin(kx) <= 1e-109) tmp = sin(th); elseif ((sin(kx) <= 1e-47) || ~((sin(kx) <= 5e-24))) tmp = sin(th) * (sin(ky) / sin(kx)); else tmp = 1.0 / (sin(ky) / (sin(ky) * sin(th))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[kx], $MachinePrecision], -0.1], N[Abs[N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[kx], $MachinePrecision], 1e-109], N[Sin[th], $MachinePrecision], If[Or[LessEqual[N[Sin[kx], $MachinePrecision], 1e-47], N[Not[LessEqual[N[Sin[kx], $MachinePrecision], 5e-24]], $MachinePrecision]], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sin[ky], $MachinePrecision] / N[(N[Sin[ky], $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin kx \leq -0.1:\\
\;\;\;\;\left|\sin ky \cdot \frac{\sin th}{\sin kx}\right|\\
\mathbf{elif}\;\sin kx \leq 10^{-109}:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin kx \leq 10^{-47} \lor \neg \left(\sin kx \leq 5 \cdot 10^{-24}\right):\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\sin ky}{\sin ky \cdot \sin th}}\\
\end{array}
\end{array}
if (sin.f64 kx) < -0.10000000000000001Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.6%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
associate-*r/99.6%
*-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 6.0%
add-sqr-sqrt4.3%
sqrt-unprod19.8%
pow219.8%
*-commutative19.8%
associate-/l*19.8%
Applied egg-rr19.8%
unpow219.8%
rem-sqrt-square31.7%
Simplified31.7%
if -0.10000000000000001 < (sin.f64 kx) < 9.9999999999999999e-110Initial program 82.1%
unpow282.1%
sqr-neg82.1%
sin-neg82.1%
sin-neg82.1%
unpow282.1%
associate-*l/79.3%
associate-/l*81.9%
unpow281.9%
Simplified99.7%
Taylor expanded in kx around 0 42.3%
if 9.9999999999999999e-110 < (sin.f64 kx) < 9.9999999999999997e-48 or 4.9999999999999998e-24 < (sin.f64 kx) Initial program 99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 59.9%
if 9.9999999999999997e-48 < (sin.f64 kx) < 4.9999999999999998e-24Initial program 100.0%
unpow2100.0%
sqr-neg100.0%
sin-neg100.0%
sin-neg100.0%
unpow2100.0%
associate-*l/99.6%
associate-/l*99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in kx around 0 63.3%
associate-*r/63.5%
*-commutative63.5%
clear-num63.7%
*-commutative63.7%
Applied egg-rr63.7%
Final simplification46.3%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin th) -0.625)
(* (sin th) (/ (sin ky) (sin kx)))
(if (<= (sin th) -0.004)
(sin th)
(if (<= (sin th) 5e-8)
(* (sin ky) (/ th (hypot (sin ky) (sin kx))))
(* (sin ky) (fabs (/ (sin th) (sin ky))))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(th) <= -0.625) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if (sin(th) <= -0.004) {
tmp = sin(th);
} else if (sin(th) <= 5e-8) {
tmp = sin(ky) * (th / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(th) <= -0.625) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if (Math.sin(th) <= -0.004) {
tmp = Math.sin(th);
} else if (Math.sin(th) <= 5e-8) {
tmp = Math.sin(ky) * (th / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(th) <= -0.625: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) elif math.sin(th) <= -0.004: tmp = math.sin(th) elif math.sin(th) <= 5e-8: tmp = math.sin(ky) * (th / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(th) <= -0.625) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif (sin(th) <= -0.004) tmp = sin(th); elseif (sin(th) <= 5e-8) tmp = Float64(sin(ky) * Float64(th / hypot(sin(ky), sin(kx)))); else tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(th) <= -0.625) tmp = sin(th) * (sin(ky) / sin(kx)); elseif (sin(th) <= -0.004) tmp = sin(th); elseif (sin(th) <= 5e-8) tmp = sin(ky) * (th / hypot(sin(ky), sin(kx))); else tmp = sin(ky) * abs((sin(th) / sin(ky))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[th], $MachinePrecision], -0.625], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], -0.004], N[Sin[th], $MachinePrecision], If[LessEqual[N[Sin[th], $MachinePrecision], 5e-8], 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[Abs[N[(N[Sin[th], $MachinePrecision] / N[Sin[ky], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin th \leq -0.625:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin th \leq -0.004:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;\sin th \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\sin ky \cdot \frac{th}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\end{array}
\end{array}
if (sin.f64 th) < -0.625Initial program 89.6%
+-commutative89.6%
unpow289.6%
unpow289.6%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 27.0%
if -0.625 < (sin.f64 th) < -0.0040000000000000001Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.3%
associate-/l*99.6%
unpow299.6%
Simplified99.5%
Taylor expanded in kx around 0 34.5%
if -0.0040000000000000001 < (sin.f64 th) < 4.9999999999999998e-8Initial program 91.2%
unpow291.2%
sqr-neg91.2%
sin-neg91.2%
sin-neg91.2%
unpow291.2%
associate-*l/89.3%
associate-/l*91.1%
unpow291.1%
Simplified99.6%
Taylor expanded in th around 0 99.6%
if 4.9999999999999998e-8 < (sin.f64 th) Initial program 96.3%
unpow296.3%
sqr-neg96.3%
sin-neg96.3%
sin-neg96.3%
unpow296.3%
associate-*l/96.3%
associate-/l*96.2%
unpow296.2%
Simplified99.5%
Taylor expanded in kx around 0 25.6%
add-sqr-sqrt24.9%
sqrt-unprod41.1%
pow241.1%
Applied egg-rr41.1%
unpow241.1%
rem-sqrt-square41.7%
Simplified41.7%
Final simplification67.1%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.32)
(cbrt (sqrt (pow (sin th) 6.0)))
(if (<= (sin ky) 5e-65)
(* (sin th) (/ (sin ky) (sin kx)))
(if (or (<= (sin ky) 1e-40) (not (<= (sin ky) 2e-18)))
(sin th)
(* (sin th) (/ ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.32) {
tmp = cbrt(sqrt(pow(sin(th), 6.0)));
} else if (sin(ky) <= 5e-65) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / sin(kx));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.32) {
tmp = Math.cbrt(Math.sqrt(Math.pow(Math.sin(th), 6.0)));
} else if (Math.sin(ky) <= 5e-65) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if ((Math.sin(ky) <= 1e-40) || !(Math.sin(ky) <= 2e-18)) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.32) tmp = cbrt(sqrt((sin(th) ^ 6.0))); elseif (sin(ky) <= 5e-65) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.32], N[Power[N[Sqrt[N[Power[N[Sin[th], $MachinePrecision], 6.0], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 2e-18]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.32:\\
\;\;\;\;\sqrt[3]{\sqrt{{\sin th}^{6}}}\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-40} \lor \neg \left(\sin ky \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.320000000000000007Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.4%
add-cbrt-cube2.7%
pow32.7%
Applied egg-rr2.7%
add-sqr-sqrt1.8%
sqrt-unprod26.2%
pow-prod-up26.3%
metadata-eval26.3%
Applied egg-rr26.3%
if -0.320000000000000007 < (sin.f64 ky) < 4.99999999999999983e-65Initial program 86.1%
+-commutative86.1%
unpow286.1%
unpow286.1%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 48.1%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 2.0000000000000001e-18 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.5%
if 9.9999999999999993e-41 < (sin.f64 ky) < 2.0000000000000001e-18Initial program 99.2%
+-commutative99.2%
unpow299.2%
unpow299.2%
hypot-undefine99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 51.8%
Final simplification47.4%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.32)
(fabs (sin th))
(if (<= (sin ky) 5e-65)
(* (sin th) (/ (sin ky) (sin kx)))
(if (or (<= (sin ky) 1e-40) (not (<= (sin ky) 2e-18)))
(sin th)
(* (sin th) (/ ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.32) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-65) {
tmp = sin(th) * (sin(ky) / sin(kx));
} else if ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) {
tmp = sin(th);
} else {
tmp = sin(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 (sin(ky) <= (-0.32d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-65) then
tmp = sin(th) * (sin(ky) / sin(kx))
else if ((sin(ky) <= 1d-40) .or. (.not. (sin(ky) <= 2d-18))) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.32) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-65) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.sin(kx));
} else if ((Math.sin(ky) <= 1e-40) || !(Math.sin(ky) <= 2e-18)) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.32: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-65: tmp = math.sin(th) * (math.sin(ky) / math.sin(kx)) elif (math.sin(ky) <= 1e-40) or not (math.sin(ky) <= 2e-18): tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.32) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-65) tmp = Float64(sin(th) * Float64(sin(ky) / sin(kx))); elseif ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.32) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-65) tmp = sin(th) * (sin(ky) / sin(kx)); elseif ((sin(ky) <= 1e-40) || ~((sin(ky) <= 2e-18))) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.32], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 2e-18]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.32:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-40} \lor \neg \left(\sin ky \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.320000000000000007Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.4%
add-sqr-sqrt0.7%
sqrt-unprod29.2%
pow229.2%
Applied egg-rr29.2%
unpow229.2%
rem-sqrt-square34.0%
associate-*r/34.0%
associate-*l/34.0%
*-inverses34.0%
*-lft-identity34.0%
Simplified34.0%
if -0.320000000000000007 < (sin.f64 ky) < 4.99999999999999983e-65Initial program 86.1%
+-commutative86.1%
unpow286.1%
unpow286.1%
hypot-undefine99.6%
Applied egg-rr99.6%
Taylor expanded in ky around 0 48.1%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 2.0000000000000001e-18 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.5%
if 9.9999999999999993e-41 < (sin.f64 ky) < 2.0000000000000001e-18Initial program 99.2%
+-commutative99.2%
unpow299.2%
unpow299.2%
hypot-undefine99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 51.8%
Final simplification49.0%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.32)
(fabs (sin th))
(if (<= (sin ky) 5e-65)
(* (sin ky) (/ (sin th) (sin kx)))
(if (or (<= (sin ky) 1e-40) (not (<= (sin ky) 2e-18)))
(sin th)
(* (sin th) (/ ky (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.32) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 5e-65) {
tmp = sin(ky) * (sin(th) / sin(kx));
} else if ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) {
tmp = sin(th);
} else {
tmp = sin(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 (sin(ky) <= (-0.32d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 5d-65) then
tmp = sin(ky) * (sin(th) / sin(kx))
else if ((sin(ky) <= 1d-40) .or. (.not. (sin(ky) <= 2d-18))) then
tmp = sin(th)
else
tmp = sin(th) * (ky / sin(kx))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.32) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 5e-65) {
tmp = Math.sin(ky) * (Math.sin(th) / Math.sin(kx));
} else if ((Math.sin(ky) <= 1e-40) || !(Math.sin(ky) <= 2e-18)) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / Math.sin(kx));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.32: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 5e-65: tmp = math.sin(ky) * (math.sin(th) / math.sin(kx)) elif (math.sin(ky) <= 1e-40) or not (math.sin(ky) <= 2e-18): tmp = math.sin(th) else: tmp = math.sin(th) * (ky / math.sin(kx)) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.32) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-65) tmp = Float64(sin(ky) * Float64(sin(th) / sin(kx))); elseif ((sin(ky) <= 1e-40) || !(sin(ky) <= 2e-18)) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / sin(kx))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.32) tmp = abs(sin(th)); elseif (sin(ky) <= 5e-65) tmp = sin(ky) * (sin(th) / sin(kx)); elseif ((sin(ky) <= 1e-40) || ~((sin(ky) <= 2e-18))) tmp = sin(th); else tmp = sin(th) * (ky / sin(kx)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.32], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40], N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 2e-18]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.32:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{elif}\;\sin ky \leq 10^{-40} \lor \neg \left(\sin ky \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.320000000000000007Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in kx around 0 2.4%
add-sqr-sqrt0.7%
sqrt-unprod29.2%
pow229.2%
Applied egg-rr29.2%
unpow229.2%
rem-sqrt-square34.0%
associate-*r/34.0%
associate-*l/34.0%
*-inverses34.0%
*-lft-identity34.0%
Simplified34.0%
if -0.320000000000000007 < (sin.f64 ky) < 4.99999999999999983e-65Initial program 86.1%
unpow286.1%
sqr-neg86.1%
sin-neg86.1%
sin-neg86.1%
unpow286.1%
associate-*l/84.8%
associate-/l*86.1%
unpow286.1%
Simplified99.6%
Taylor expanded in ky around 0 48.1%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 2.0000000000000001e-18 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.5%
if 9.9999999999999993e-41 < (sin.f64 ky) < 2.0000000000000001e-18Initial program 99.2%
+-commutative99.2%
unpow299.2%
unpow299.2%
hypot-undefine99.2%
Applied egg-rr99.2%
Taylor expanded in ky around 0 51.8%
Final simplification48.9%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(fabs (sin th))
(if (or (<= (sin ky) 5e-65)
(and (not (<= (sin ky) 1e-40)) (<= (sin ky) 2e-18)))
(* (sin th) (/ ky (sin kx)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = fabs(sin(th));
} else if ((sin(ky) <= 5e-65) || (!(sin(ky) <= 1e-40) && (sin(ky) <= 2e-18))) {
tmp = sin(th) * (ky / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.05d0)) then
tmp = abs(sin(th))
else if ((sin(ky) <= 5d-65) .or. (.not. (sin(ky) <= 1d-40)) .and. (sin(ky) <= 2d-18)) then
tmp = sin(th) * (ky / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.05) {
tmp = Math.abs(Math.sin(th));
} else if ((Math.sin(ky) <= 5e-65) || (!(Math.sin(ky) <= 1e-40) && (Math.sin(ky) <= 2e-18))) {
tmp = Math.sin(th) * (ky / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.05: tmp = math.fabs(math.sin(th)) elif (math.sin(ky) <= 5e-65) or (not (math.sin(ky) <= 1e-40) and (math.sin(ky) <= 2e-18)): tmp = math.sin(th) * (ky / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.05) tmp = abs(sin(th)); elseif ((sin(ky) <= 5e-65) || (!(sin(ky) <= 1e-40) && (sin(ky) <= 2e-18))) tmp = Float64(sin(th) * Float64(ky / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.05) tmp = abs(sin(th)); elseif ((sin(ky) <= 5e-65) || (~((sin(ky) <= 1e-40)) && (sin(ky) <= 2e-18))) tmp = sin(th) * (ky / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.05], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], And[N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40]], $MachinePrecision], LessEqual[N[Sin[ky], $MachinePrecision], 2e-18]]], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65} \lor \neg \left(\sin ky \leq 10^{-40}\right) \land \sin ky \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.7%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt0.9%
sqrt-unprod27.6%
pow227.6%
Applied egg-rr27.6%
unpow227.6%
rem-sqrt-square31.7%
associate-*r/31.7%
associate-*l/31.8%
*-inverses31.8%
*-lft-identity31.8%
Simplified31.8%
if -0.050000000000000003 < (sin.f64 ky) < 4.99999999999999983e-65 or 9.9999999999999993e-41 < (sin.f64 ky) < 2.0000000000000001e-18Initial program 85.6%
+-commutative85.6%
unpow285.6%
unpow285.6%
hypot-undefine99.7%
Applied egg-rr99.7%
Taylor expanded in ky around 0 51.4%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 2.0000000000000001e-18 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.5%
Final simplification49.4%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.05)
(fabs (sin th))
(if (or (<= (sin ky) 5e-65)
(and (not (<= (sin ky) 1e-40)) (<= (sin ky) 2e-18)))
(* ky (/ (sin th) (sin kx)))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.05) {
tmp = fabs(sin(th));
} else if ((sin(ky) <= 5e-65) || (!(sin(ky) <= 1e-40) && (sin(ky) <= 2e-18))) {
tmp = ky * (sin(th) / sin(kx));
} else {
tmp = sin(th);
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (sin(ky) <= (-0.05d0)) then
tmp = abs(sin(th))
else if ((sin(ky) <= 5d-65) .or. (.not. (sin(ky) <= 1d-40)) .and. (sin(ky) <= 2d-18)) then
tmp = ky * (sin(th) / sin(kx))
else
tmp = sin(th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.05) {
tmp = Math.abs(Math.sin(th));
} else if ((Math.sin(ky) <= 5e-65) || (!(Math.sin(ky) <= 1e-40) && (Math.sin(ky) <= 2e-18))) {
tmp = ky * (Math.sin(th) / Math.sin(kx));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.05: tmp = math.fabs(math.sin(th)) elif (math.sin(ky) <= 5e-65) or (not (math.sin(ky) <= 1e-40) and (math.sin(ky) <= 2e-18)): tmp = ky * (math.sin(th) / math.sin(kx)) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.05) tmp = abs(sin(th)); elseif ((sin(ky) <= 5e-65) || (!(sin(ky) <= 1e-40) && (sin(ky) <= 2e-18))) tmp = Float64(ky * Float64(sin(th) / sin(kx))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.05) tmp = abs(sin(th)); elseif ((sin(ky) <= 5e-65) || (~((sin(ky) <= 1e-40)) && (sin(ky) <= 2e-18))) tmp = ky * (sin(th) / sin(kx)); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.05], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[N[Sin[ky], $MachinePrecision], 5e-65], And[N[Not[LessEqual[N[Sin[ky], $MachinePrecision], 1e-40]], $MachinePrecision], LessEqual[N[Sin[ky], $MachinePrecision], 2e-18]]], N[(ky * N[(N[Sin[th], $MachinePrecision] / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.05:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 5 \cdot 10^{-65} \lor \neg \left(\sin ky \leq 10^{-40}\right) \land \sin ky \leq 2 \cdot 10^{-18}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.050000000000000003Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.7%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt0.9%
sqrt-unprod27.6%
pow227.6%
Applied egg-rr27.6%
unpow227.6%
rem-sqrt-square31.7%
associate-*r/31.7%
associate-*l/31.8%
*-inverses31.8%
*-lft-identity31.8%
Simplified31.8%
if -0.050000000000000003 < (sin.f64 ky) < 4.99999999999999983e-65 or 9.9999999999999993e-41 < (sin.f64 ky) < 2.0000000000000001e-18Initial program 85.6%
unpow285.6%
sqr-neg85.6%
sin-neg85.6%
sin-neg85.6%
unpow285.6%
associate-*l/84.1%
associate-/l*85.5%
unpow285.5%
Simplified99.6%
Taylor expanded in ky around 0 49.6%
associate-/l*51.4%
Simplified51.4%
if 4.99999999999999983e-65 < (sin.f64 ky) < 9.9999999999999993e-41 or 2.0000000000000001e-18 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/98.4%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 59.5%
Final simplification49.4%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (hypot (sin ky) (sin kx))))
(if (<= (sin ky) 6e-306)
(* (sin ky) (/ th t_1))
(if (<= (sin ky) 1.8e-6) (/ (* ky (sin th)) t_1) (sin th)))))
double code(double kx, double ky, double th) {
double t_1 = hypot(sin(ky), sin(kx));
double tmp;
if (sin(ky) <= 6e-306) {
tmp = sin(ky) * (th / t_1);
} else if (sin(ky) <= 1.8e-6) {
tmp = (ky * sin(th)) / t_1;
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.hypot(Math.sin(ky), Math.sin(kx));
double tmp;
if (Math.sin(ky) <= 6e-306) {
tmp = Math.sin(ky) * (th / t_1);
} else if (Math.sin(ky) <= 1.8e-6) {
tmp = (ky * Math.sin(th)) / t_1;
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.hypot(math.sin(ky), math.sin(kx)) tmp = 0 if math.sin(ky) <= 6e-306: tmp = math.sin(ky) * (th / t_1) elif math.sin(ky) <= 1.8e-6: tmp = (ky * math.sin(th)) / t_1 else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)) tmp = 0.0 if (sin(ky) <= 6e-306) tmp = Float64(sin(ky) * Float64(th / t_1)); elseif (sin(ky) <= 1.8e-6) tmp = Float64(Float64(ky * sin(th)) / t_1); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = hypot(sin(ky), sin(kx)); tmp = 0.0; if (sin(ky) <= 6e-306) tmp = sin(ky) * (th / t_1); elseif (sin(ky) <= 1.8e-6) tmp = (ky * sin(th)) / t_1; else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], 6e-306], N[(N[Sin[ky], $MachinePrecision] * N[(th / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1.8e-6], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{hypot}\left(\sin ky, \sin kx\right)\\
\mathbf{if}\;\sin ky \leq 6 \cdot 10^{-306}:\\
\;\;\;\;\sin ky \cdot \frac{th}{t\_1}\\
\mathbf{elif}\;\sin ky \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{ky \cdot \sin th}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < 6.00000000000000048e-306Initial program 94.6%
unpow294.6%
sqr-neg94.6%
sin-neg94.6%
sin-neg94.6%
unpow294.6%
associate-*l/93.3%
associate-/l*94.5%
unpow294.5%
Simplified99.6%
Taylor expanded in th around 0 59.6%
if 6.00000000000000048e-306 < (sin.f64 ky) < 1.79999999999999992e-6Initial program 84.6%
unpow284.6%
sqr-neg84.6%
sin-neg84.6%
sin-neg84.6%
unpow284.6%
associate-*l/83.1%
associate-/l*84.5%
unpow284.5%
Simplified99.6%
associate-*r/93.2%
*-commutative93.2%
Applied egg-rr93.2%
Taylor expanded in ky around 0 92.9%
if 1.79999999999999992e-6 < (sin.f64 ky) Initial program 99.6%
unpow299.6%
sqr-neg99.6%
sin-neg99.6%
sin-neg99.6%
unpow299.6%
associate-*l/99.6%
associate-/l*99.4%
unpow299.4%
Simplified99.5%
Taylor expanded in kx around 0 58.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/92.2%
associate-/l*93.1%
unpow293.1%
Simplified99.6%
(FPCore (kx ky th) :precision binary64 (if (<= kx 2e+24) (sin th) (+ (+ (+ (sin th) 2.0) -1.0) -1.0)))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2e+24) {
tmp = sin(th);
} else {
tmp = ((sin(th) + 2.0) + -1.0) + -1.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 <= 2d+24) then
tmp = sin(th)
else
tmp = ((sin(th) + 2.0d0) + (-1.0d0)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 2e+24) {
tmp = Math.sin(th);
} else {
tmp = ((Math.sin(th) + 2.0) + -1.0) + -1.0;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 2e+24: tmp = math.sin(th) else: tmp = ((math.sin(th) + 2.0) + -1.0) + -1.0 return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 2e+24) tmp = sin(th); else tmp = Float64(Float64(Float64(sin(th) + 2.0) + -1.0) + -1.0); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 2e+24) tmp = sin(th); else tmp = ((sin(th) + 2.0) + -1.0) + -1.0; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 2e+24], N[Sin[th], $MachinePrecision], N[(N[(N[(N[Sin[th], $MachinePrecision] + 2.0), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2 \cdot 10^{+24}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sin th + 2\right) + -1\right) + -1\\
\end{array}
\end{array}
if kx < 2e24Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.8%
associate-/l*90.2%
unpow290.2%
Simplified99.6%
Taylor expanded in kx around 0 32.5%
if 2e24 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 8.4%
expm1-log1p-u8.4%
expm1-undefine17.2%
Applied egg-rr17.2%
expm1-define8.4%
associate-*r/17.8%
associate-*l/8.4%
*-inverses8.4%
*-lft-identity8.4%
Simplified8.4%
expm1-undefine17.2%
log1p-undefine17.2%
rem-exp-log17.2%
+-commutative17.2%
Applied egg-rr17.2%
expm1-log1p-u17.2%
expm1-undefine17.2%
log1p-undefine17.2%
+-commutative17.2%
add-exp-log17.2%
associate-+l+17.2%
metadata-eval17.2%
Applied egg-rr17.2%
Final simplification27.7%
(FPCore (kx ky th) :precision binary64 (if (<= kx 1.6e+24) (sin th) (+ 1.0 (+ (sin th) -1.0))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.6e+24) {
tmp = sin(th);
} else {
tmp = 1.0 + (sin(th) + -1.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.6d+24) then
tmp = sin(th)
else
tmp = 1.0d0 + (sin(th) + (-1.0d0))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 1.6e+24) {
tmp = Math.sin(th);
} else {
tmp = 1.0 + (Math.sin(th) + -1.0);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 1.6e+24: tmp = math.sin(th) else: tmp = 1.0 + (math.sin(th) + -1.0) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 1.6e+24) tmp = sin(th); else tmp = Float64(1.0 + Float64(sin(th) + -1.0)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 1.6e+24) tmp = sin(th); else tmp = 1.0 + (sin(th) + -1.0); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 1.6e+24], N[Sin[th], $MachinePrecision], N[(1.0 + N[(N[Sin[th], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 1.6 \cdot 10^{+24}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sin th + -1\right)\\
\end{array}
\end{array}
if kx < 1.5999999999999999e24Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.8%
associate-/l*90.2%
unpow290.2%
Simplified99.6%
Taylor expanded in kx around 0 32.5%
if 1.5999999999999999e24 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 8.4%
expm1-log1p-u8.4%
expm1-undefine17.2%
Applied egg-rr17.2%
expm1-define8.4%
associate-*r/17.8%
associate-*l/8.4%
*-inverses8.4%
*-lft-identity8.4%
Simplified8.4%
expm1-undefine17.2%
log1p-undefine17.2%
rem-exp-log17.2%
+-commutative17.2%
Applied egg-rr17.2%
sub-neg17.2%
+-commutative17.2%
metadata-eval17.2%
associate-+l+17.2%
Applied egg-rr17.2%
(FPCore (kx ky th) :precision binary64 (if (<= kx 8e+28) (sin th) (+ (+ th 1.0) -1.0)))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 8e+28) {
tmp = sin(th);
} else {
tmp = (th + 1.0) + -1.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 <= 8d+28) then
tmp = sin(th)
else
tmp = (th + 1.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 8e+28) {
tmp = Math.sin(th);
} else {
tmp = (th + 1.0) + -1.0;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 8e+28: tmp = math.sin(th) else: tmp = (th + 1.0) + -1.0 return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 8e+28) tmp = sin(th); else tmp = Float64(Float64(th + 1.0) + -1.0); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 8e+28) tmp = sin(th); else tmp = (th + 1.0) + -1.0; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 8e+28], N[Sin[th], $MachinePrecision], N[(N[(th + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 8 \cdot 10^{+28}:\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left(th + 1\right) + -1\\
\end{array}
\end{array}
if kx < 7.99999999999999967e28Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.8%
associate-/l*90.2%
unpow290.2%
Simplified99.6%
Taylor expanded in kx around 0 32.5%
if 7.99999999999999967e28 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 8.4%
expm1-log1p-u8.4%
expm1-undefine17.2%
Applied egg-rr17.2%
expm1-define8.4%
associate-*r/17.8%
associate-*l/8.4%
*-inverses8.4%
*-lft-identity8.4%
Simplified8.4%
expm1-undefine17.2%
log1p-undefine17.2%
rem-exp-log17.2%
+-commutative17.2%
Applied egg-rr17.2%
Taylor expanded in th around 0 14.7%
+-commutative14.7%
Simplified14.7%
Final simplification26.9%
(FPCore (kx ky th) :precision binary64 (if (<= kx 5.2e+24) th (+ (+ th 1.0) -1.0)))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 5.2e+24) {
tmp = th;
} else {
tmp = (th + 1.0) + -1.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 <= 5.2d+24) then
tmp = th
else
tmp = (th + 1.0d0) + (-1.0d0)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 5.2e+24) {
tmp = th;
} else {
tmp = (th + 1.0) + -1.0;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 5.2e+24: tmp = th else: tmp = (th + 1.0) + -1.0 return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 5.2e+24) tmp = th; else tmp = Float64(Float64(th + 1.0) + -1.0); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 5.2e+24) tmp = th; else tmp = (th + 1.0) + -1.0; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 5.2e+24], th, N[(N[(th + 1.0), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 5.2 \cdot 10^{+24}:\\
\;\;\;\;th\\
\mathbf{else}:\\
\;\;\;\;\left(th + 1\right) + -1\\
\end{array}
\end{array}
if kx < 5.1999999999999997e24Initial program 90.4%
unpow290.4%
sqr-neg90.4%
sin-neg90.4%
sin-neg90.4%
unpow290.4%
associate-*l/88.8%
associate-/l*90.2%
unpow290.2%
Simplified99.6%
Taylor expanded in kx around 0 32.4%
Taylor expanded in th around 0 14.6%
if 5.1999999999999997e24 < kx Initial program 99.4%
unpow299.4%
sqr-neg99.4%
sin-neg99.4%
sin-neg99.4%
unpow299.4%
associate-*l/99.5%
associate-/l*99.5%
unpow299.5%
Simplified99.5%
Taylor expanded in kx around 0 8.4%
expm1-log1p-u8.4%
expm1-undefine17.2%
Applied egg-rr17.2%
expm1-define8.4%
associate-*r/17.8%
associate-*l/8.4%
*-inverses8.4%
*-lft-identity8.4%
Simplified8.4%
expm1-undefine17.2%
log1p-undefine17.2%
rem-exp-log17.2%
+-commutative17.2%
Applied egg-rr17.2%
Taylor expanded in th around 0 14.7%
+-commutative14.7%
Simplified14.7%
Final simplification14.6%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.2%
unpow293.2%
sqr-neg93.2%
sin-neg93.2%
sin-neg93.2%
unpow293.2%
associate-*l/92.2%
associate-/l*93.1%
unpow293.1%
Simplified99.6%
Taylor expanded in kx around 0 24.9%
Taylor expanded in th around 0 11.9%
herbie shell --seed 2024100
(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)))