
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (sqrt (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0)))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / sqrt((pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))) * sin(th);
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = (sin(ky) / sqrt(((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))) * sin(th)
end function
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.sqrt((Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.sqrt((math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / sqrt(Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / sqrt(((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0)))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\sqrt{{\sin kx}^{2} + {\sin ky}^{2}}} \cdot \sin th
\end{array}
(FPCore (kx ky th) :precision binary64 (* (/ (sin ky) (hypot (sin ky) (sin kx))) (sin th)))
double code(double kx, double ky, double th) {
return (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th);
}
public static double code(double kx, double ky, double th) {
return (Math.sin(ky) / Math.hypot(Math.sin(ky), Math.sin(kx))) * Math.sin(th);
}
def code(kx, ky, th): return (math.sin(ky) / math.hypot(math.sin(ky), math.sin(kx))) * math.sin(th)
function code(kx, ky, th) return Float64(Float64(sin(ky) / hypot(sin(ky), sin(kx))) * sin(th)) end
function tmp = code(kx, ky, th) tmp = (sin(ky) / hypot(sin(ky), sin(kx))) * sin(th); end
code[kx_, ky_, th_] := N[(N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[Sin[th], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)} \cdot \sin th
\end{array}
Initial program 93.7%
+-commutative93.7%
unpow293.7%
unpow293.7%
hypot-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (fabs (sin kx))))
(if (<= (sin ky) -0.005)
(fabs (sin th))
(if (<= (sin ky) -5e-75)
(/ (sin th) (/ t_1 ky))
(if (<= (sin ky) -2e-149)
(/ (* ky (sin th)) (hypot (sin ky) kx))
(if (<= (sin ky) 2e-27) (* (sin th) (/ ky t_1)) (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = fabs(sin(kx));
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= -5e-75) {
tmp = sin(th) / (t_1 / ky);
} else if (sin(ky) <= -2e-149) {
tmp = (ky * sin(th)) / hypot(sin(ky), kx);
} else if (sin(ky) <= 2e-27) {
tmp = sin(th) * (ky / t_1);
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.abs(Math.sin(kx));
double tmp;
if (Math.sin(ky) <= -0.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= -5e-75) {
tmp = Math.sin(th) / (t_1 / ky);
} else if (Math.sin(ky) <= -2e-149) {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(ky), kx);
} else if (Math.sin(ky) <= 2e-27) {
tmp = Math.sin(th) * (ky / t_1);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.fabs(math.sin(kx)) tmp = 0 if math.sin(ky) <= -0.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= -5e-75: tmp = math.sin(th) / (t_1 / ky) elif math.sin(ky) <= -2e-149: tmp = (ky * math.sin(th)) / math.hypot(math.sin(ky), kx) elif math.sin(ky) <= 2e-27: tmp = math.sin(th) * (ky / t_1) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = abs(sin(kx)) tmp = 0.0 if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= -5e-75) tmp = Float64(sin(th) / Float64(t_1 / ky)); elseif (sin(ky) <= -2e-149) tmp = Float64(Float64(ky * sin(th)) / hypot(sin(ky), kx)); elseif (sin(ky) <= 2e-27) tmp = Float64(sin(th) * Float64(ky / t_1)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = abs(sin(kx)); tmp = 0.0; if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= -5e-75) tmp = sin(th) / (t_1 / ky); elseif (sin(ky) <= -2e-149) tmp = (ky * sin(th)) / hypot(sin(ky), kx); elseif (sin(ky) <= 2e-27) tmp = sin(th) * (ky / t_1); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], -5e-75], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], -2e-149], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-27], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin kx\right|\\
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq -5 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sin th}{\frac{t_1}{ky}}\\
\mathbf{elif}\;\sin ky \leq -2 \cdot 10^{-149}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.4%
sqrt-unprod27.1%
pow227.1%
*-commutative27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/r/27.1%
*-inverses27.1%
/-rgt-identity27.1%
unpow227.1%
rem-sqrt-square30.3%
Simplified30.3%
if -0.0050000000000000001 < (sin.f64 ky) < -4.99999999999999979e-75Initial program 99.3%
+-commutative99.3%
unpow299.3%
unpow299.3%
hypot-def99.4%
Simplified99.4%
Taylor expanded in ky around 0 69.2%
*-commutative69.2%
clear-num69.4%
un-div-inv69.5%
Applied egg-rr69.5%
add-sqr-sqrt68.8%
sqrt-prod87.4%
rem-sqrt-square87.4%
Applied egg-rr87.6%
if -4.99999999999999979e-75 < (sin.f64 ky) < -1.99999999999999996e-149Initial program 99.8%
associate-*l/99.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-udef99.0%
associate-*l/99.8%
expm1-log1p-u99.8%
expm1-udef43.1%
Applied egg-rr43.1%
expm1-def99.8%
expm1-log1p99.8%
associate-/l*99.0%
hypot-def99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-def99.0%
Simplified99.0%
Taylor expanded in ky around 0 99.0%
Taylor expanded in kx around 0 83.1%
if -1.99999999999999996e-149 < (sin.f64 ky) < 2.0000000000000001e-27Initial program 83.5%
+-commutative83.5%
unpow283.5%
unpow283.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 55.4%
add-sqr-sqrt42.1%
sqrt-prod74.5%
rem-sqrt-square82.4%
Applied egg-rr82.4%
if 2.0000000000000001e-27 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 59.0%
Final simplification63.7%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (fabs (sin kx))))
(if (<= (sin ky) -0.005)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(if (<= (sin ky) -5e-75)
(/ (sin th) (/ t_1 ky))
(if (<= (sin ky) -2e-149)
(/ (* ky (sin th)) (hypot (sin ky) kx))
(if (<= (sin ky) 2e-27) (* (sin th) (/ ky t_1)) (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = fabs(sin(kx));
double tmp;
if (sin(ky) <= -0.005) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else if (sin(ky) <= -5e-75) {
tmp = sin(th) / (t_1 / ky);
} else if (sin(ky) <= -2e-149) {
tmp = (ky * sin(th)) / hypot(sin(ky), kx);
} else if (sin(ky) <= 2e-27) {
tmp = sin(th) * (ky / t_1);
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.abs(Math.sin(kx));
double tmp;
if (Math.sin(ky) <= -0.005) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else if (Math.sin(ky) <= -5e-75) {
tmp = Math.sin(th) / (t_1 / ky);
} else if (Math.sin(ky) <= -2e-149) {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(ky), kx);
} else if (Math.sin(ky) <= 2e-27) {
tmp = Math.sin(th) * (ky / t_1);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.fabs(math.sin(kx)) tmp = 0 if math.sin(ky) <= -0.005: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) elif math.sin(ky) <= -5e-75: tmp = math.sin(th) / (t_1 / ky) elif math.sin(ky) <= -2e-149: tmp = (ky * math.sin(th)) / math.hypot(math.sin(ky), kx) elif math.sin(ky) <= 2e-27: tmp = math.sin(th) * (ky / t_1) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = abs(sin(kx)) tmp = 0.0 if (sin(ky) <= -0.005) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); elseif (sin(ky) <= -5e-75) tmp = Float64(sin(th) / Float64(t_1 / ky)); elseif (sin(ky) <= -2e-149) tmp = Float64(Float64(ky * sin(th)) / hypot(sin(ky), kx)); elseif (sin(ky) <= 2e-27) tmp = Float64(sin(th) * Float64(ky / t_1)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = abs(sin(kx)); tmp = 0.0; if (sin(ky) <= -0.005) tmp = sin(ky) * abs((sin(th) / sin(ky))); elseif (sin(ky) <= -5e-75) tmp = sin(th) / (t_1 / ky); elseif (sin(ky) <= -2e-149) tmp = (ky * sin(th)) / hypot(sin(ky), kx); elseif (sin(ky) <= 2e-27) tmp = sin(th) * (ky / t_1); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.005], 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-75], N[(N[Sin[th], $MachinePrecision] / N[(t$95$1 / ky), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], -2e-149], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-27], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin kx\right|\\
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{elif}\;\sin ky \leq -5 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sin th}{\frac{t_1}{ky}}\\
\mathbf{elif}\;\sin ky \leq -2 \cdot 10^{-149}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.2%
sqrt-unprod28.6%
pow228.6%
Applied egg-rr28.6%
unpow228.6%
rem-sqrt-square37.4%
Simplified37.4%
if -0.0050000000000000001 < (sin.f64 ky) < -4.99999999999999979e-75Initial program 99.3%
+-commutative99.3%
unpow299.3%
unpow299.3%
hypot-def99.4%
Simplified99.4%
Taylor expanded in ky around 0 69.2%
*-commutative69.2%
clear-num69.4%
un-div-inv69.5%
Applied egg-rr69.5%
add-sqr-sqrt68.8%
sqrt-prod87.4%
rem-sqrt-square87.4%
Applied egg-rr87.6%
if -4.99999999999999979e-75 < (sin.f64 ky) < -1.99999999999999996e-149Initial program 99.8%
associate-*l/99.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-udef99.0%
associate-*l/99.8%
expm1-log1p-u99.8%
expm1-udef43.1%
Applied egg-rr43.1%
expm1-def99.8%
expm1-log1p99.8%
associate-/l*99.0%
hypot-def99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-def99.0%
Simplified99.0%
Taylor expanded in ky around 0 99.0%
Taylor expanded in kx around 0 83.1%
if -1.99999999999999996e-149 < (sin.f64 ky) < 2.0000000000000001e-27Initial program 83.5%
+-commutative83.5%
unpow283.5%
unpow283.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 55.4%
add-sqr-sqrt42.1%
sqrt-prod74.5%
rem-sqrt-square82.4%
Applied egg-rr82.4%
if 2.0000000000000001e-27 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 59.0%
Final simplification65.5%
(FPCore (kx ky th)
:precision binary64
(let* ((t_1 (fabs (sin kx))))
(if (<= (sin ky) -0.008)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(if (<= (sin ky) -5e-75)
(* (sin ky) (/ (sin th) t_1))
(if (<= (sin ky) -2e-149)
(/ (* ky (sin th)) (hypot (sin ky) kx))
(if (<= (sin ky) 2e-27) (* (sin th) (/ ky t_1)) (sin th)))))))
double code(double kx, double ky, double th) {
double t_1 = fabs(sin(kx));
double tmp;
if (sin(ky) <= -0.008) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else if (sin(ky) <= -5e-75) {
tmp = sin(ky) * (sin(th) / t_1);
} else if (sin(ky) <= -2e-149) {
tmp = (ky * sin(th)) / hypot(sin(ky), kx);
} else if (sin(ky) <= 2e-27) {
tmp = sin(th) * (ky / t_1);
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double t_1 = Math.abs(Math.sin(kx));
double tmp;
if (Math.sin(ky) <= -0.008) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else if (Math.sin(ky) <= -5e-75) {
tmp = Math.sin(ky) * (Math.sin(th) / t_1);
} else if (Math.sin(ky) <= -2e-149) {
tmp = (ky * Math.sin(th)) / Math.hypot(Math.sin(ky), kx);
} else if (Math.sin(ky) <= 2e-27) {
tmp = Math.sin(th) * (ky / t_1);
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): t_1 = math.fabs(math.sin(kx)) tmp = 0 if math.sin(ky) <= -0.008: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) elif math.sin(ky) <= -5e-75: tmp = math.sin(ky) * (math.sin(th) / t_1) elif math.sin(ky) <= -2e-149: tmp = (ky * math.sin(th)) / math.hypot(math.sin(ky), kx) elif math.sin(ky) <= 2e-27: tmp = math.sin(th) * (ky / t_1) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) t_1 = abs(sin(kx)) tmp = 0.0 if (sin(ky) <= -0.008) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); elseif (sin(ky) <= -5e-75) tmp = Float64(sin(ky) * Float64(sin(th) / t_1)); elseif (sin(ky) <= -2e-149) tmp = Float64(Float64(ky * sin(th)) / hypot(sin(ky), kx)); elseif (sin(ky) <= 2e-27) tmp = Float64(sin(th) * Float64(ky / t_1)); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) t_1 = abs(sin(kx)); tmp = 0.0; if (sin(ky) <= -0.008) tmp = sin(ky) * abs((sin(th) / sin(ky))); elseif (sin(ky) <= -5e-75) tmp = sin(ky) * (sin(th) / t_1); elseif (sin(ky) <= -2e-149) tmp = (ky * sin(th)) / hypot(sin(ky), kx); elseif (sin(ky) <= 2e-27) tmp = sin(th) * (ky / t_1); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := Block[{t$95$1 = N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Sin[ky], $MachinePrecision], -0.008], 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-75], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], -2e-149], N[(N[(ky * N[Sin[th], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-27], N[(N[Sin[th], $MachinePrecision] * N[(ky / t$95$1), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\sin kx\right|\\
\mathbf{if}\;\sin ky \leq -0.008:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{elif}\;\sin ky \leq -5 \cdot 10^{-75}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{t_1}\\
\mathbf{elif}\;\sin ky \leq -2 \cdot 10^{-149}:\\
\;\;\;\;\frac{ky \cdot \sin th}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\sin th \cdot \frac{ky}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0080000000000000002Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.7%
add-sqr-sqrt1.2%
sqrt-unprod29.0%
pow229.0%
Applied egg-rr29.0%
unpow229.0%
rem-sqrt-square37.9%
Simplified37.9%
if -0.0080000000000000002 < (sin.f64 ky) < -4.99999999999999979e-75Initial program 99.4%
associate-*l/99.4%
*-commutative99.4%
associate-*l/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.7%
Simplified99.7%
Taylor expanded in ky around 0 65.9%
add-sqr-sqrt64.9%
sqrt-prod82.3%
rem-sqrt-square82.3%
Applied egg-rr83.1%
if -4.99999999999999979e-75 < (sin.f64 ky) < -1.99999999999999996e-149Initial program 99.8%
associate-*l/99.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-udef99.0%
associate-*l/99.8%
expm1-log1p-u99.8%
expm1-udef43.1%
Applied egg-rr43.1%
expm1-def99.8%
expm1-log1p99.8%
associate-/l*99.0%
hypot-def99.0%
unpow299.0%
unpow299.0%
+-commutative99.0%
unpow299.0%
unpow299.0%
hypot-def99.0%
Simplified99.0%
Taylor expanded in ky around 0 99.0%
Taylor expanded in kx around 0 83.1%
if -1.99999999999999996e-149 < (sin.f64 ky) < 2.0000000000000001e-27Initial program 83.5%
+-commutative83.5%
unpow283.5%
unpow283.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 55.4%
add-sqr-sqrt42.1%
sqrt-prod74.5%
rem-sqrt-square82.4%
Applied egg-rr82.4%
if 2.0000000000000001e-27 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 59.0%
Final simplification65.5%
(FPCore (kx ky th)
:precision binary64
(if (<= (sin ky) -0.005)
(* (sin ky) (fabs (/ (sin th) (sin ky))))
(if (<= (sin ky) 4e-19)
(* (sin th) (/ ky (hypot (sin ky) (sin kx))))
(sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = sin(ky) * fabs((sin(th) / sin(ky)));
} else if (sin(ky) <= 4e-19) {
tmp = sin(th) * (ky / hypot(sin(ky), sin(kx)));
} else {
tmp = sin(th);
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (Math.sin(ky) <= -0.005) {
tmp = Math.sin(ky) * Math.abs((Math.sin(th) / Math.sin(ky)));
} else if (Math.sin(ky) <= 4e-19) {
tmp = Math.sin(th) * (ky / Math.hypot(Math.sin(ky), Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.005: tmp = math.sin(ky) * math.fabs((math.sin(th) / math.sin(ky))) elif math.sin(ky) <= 4e-19: tmp = math.sin(th) * (ky / math.hypot(math.sin(ky), math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.005) tmp = Float64(sin(ky) * abs(Float64(sin(th) / sin(ky)))); elseif (sin(ky) <= 4e-19) tmp = Float64(sin(th) * Float64(ky / hypot(sin(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.005) tmp = sin(ky) * abs((sin(th) / sin(ky))); elseif (sin(ky) <= 4e-19) tmp = sin(th) * (ky / hypot(sin(ky), sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.005], 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], 4e-19], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + N[Sin[kx], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\sin ky \cdot \left|\frac{\sin th}{\sin ky}\right|\\
\mathbf{elif}\;\sin ky \leq 4 \cdot 10^{-19}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\mathsf{hypot}\left(\sin ky, \sin kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.2%
sqrt-unprod28.6%
pow228.6%
Applied egg-rr28.6%
unpow228.6%
rem-sqrt-square37.4%
Simplified37.4%
if -0.0050000000000000001 < (sin.f64 ky) < 3.9999999999999999e-19Initial program 88.0%
associate-*l/83.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-udef89.6%
associate-*l/99.6%
expm1-log1p-u99.6%
expm1-udef35.4%
Applied egg-rr35.4%
expm1-def99.6%
expm1-log1p99.6%
associate-/l*89.6%
hypot-def83.2%
unpow283.2%
unpow283.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-def89.6%
Simplified89.6%
Taylor expanded in ky around 0 89.6%
associate-/l*99.6%
associate-/r/99.6%
Applied egg-rr99.6%
if 3.9999999999999999e-19 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 59.2%
Final simplification74.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 2e-27) (* (sin th) (/ ky (fabs (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 2e-27) {
tmp = sin(th) * (ky / fabs(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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 2d-27) then
tmp = sin(th) * (ky / abs(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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 2e-27) {
tmp = Math.sin(th) * (ky / Math.abs(Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 2e-27: tmp = math.sin(th) * (ky / math.fabs(math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-27) tmp = Float64(sin(th) * Float64(ky / abs(sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 2e-27) tmp = sin(th) * (ky / abs(sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 2e-27], N[(N[Sin[th], $MachinePrecision] * N[(ky / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 2 \cdot 10^{-27}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\left|\sin kx\right|}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.4%
sqrt-unprod27.1%
pow227.1%
*-commutative27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/r/27.1%
*-inverses27.1%
/-rgt-identity27.1%
unpow227.1%
rem-sqrt-square30.3%
Simplified30.3%
if -0.0050000000000000001 < (sin.f64 ky) < 2.0000000000000001e-27Initial program 87.8%
+-commutative87.8%
unpow287.8%
unpow287.8%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.5%
add-sqr-sqrt41.9%
sqrt-prod70.1%
rem-sqrt-square76.1%
Applied egg-rr76.1%
if 2.0000000000000001e-27 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 59.0%
Final simplification60.1%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.2e-13) (* (sin th) (/ (sin ky) (hypot (sin ky) kx))) (* (sin ky) (* (sin th) (sqrt (pow (sin kx) -2.0))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) * (sin(th) * sqrt(pow(sin(kx), -2.0)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) * Math.sqrt(Math.pow(Math.sin(kx), -2.0)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.2e-13: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) * (math.sin(th) * math.sqrt(math.pow(math.sin(kx), -2.0))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.2e-13) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) * Float64(sin(th) * sqrt((sin(kx) ^ -2.0)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.2e-13) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); else tmp = sin(ky) * (sin(th) * sqrt((sin(kx) ^ -2.0))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.2e-13], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] * N[Sqrt[N[Power[N[Sin[kx], $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.2 \cdot 10^{-13}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left(\sin th \cdot \sqrt{{\sin kx}^{-2}}\right)\\
\end{array}
\end{array}
if kx < 4.19999999999999977e-13Initial program 92.1%
+-commutative92.1%
unpow292.1%
unpow292.1%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 69.6%
if 4.19999999999999977e-13 < kx Initial program 99.3%
associate-*l/99.3%
*-commutative99.3%
associate-*l/99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 47.7%
clear-num47.6%
associate-/r/47.7%
Applied egg-rr47.7%
add-sqr-sqrt42.7%
sqrt-unprod68.7%
inv-pow68.7%
inv-pow68.7%
pow-prod-up68.6%
metadata-eval68.6%
Applied egg-rr68.6%
Final simplification69.4%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 1e-128) (* (sin th) (* ky (/ 1.0 (sin kx)))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-128) {
tmp = sin(th) * (ky * (1.0 / 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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-128) then
tmp = sin(th) * (ky * (1.0d0 / 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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-128) {
tmp = Math.sin(th) * (ky * (1.0 / Math.sin(kx)));
} else {
tmp = Math.sin(th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if math.sin(ky) <= -0.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-128: tmp = math.sin(th) * (ky * (1.0 / math.sin(kx))) else: tmp = math.sin(th) return tmp
function code(kx, ky, th) tmp = 0.0 if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) tmp = Float64(sin(th) * Float64(ky * Float64(1.0 / sin(kx)))); else tmp = sin(th); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (sin(ky) <= -0.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) tmp = sin(th) * (ky * (1.0 / sin(kx))); else tmp = sin(th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[N[Sin[ky], $MachinePrecision], -0.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-128], N[(N[Sin[th], $MachinePrecision] * N[(ky * N[(1.0 / N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[th], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sin ky \leq -0.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin th \cdot \left(ky \cdot \frac{1}{\sin kx}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.4%
sqrt-unprod27.1%
pow227.1%
*-commutative27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/r/27.1%
*-inverses27.1%
/-rgt-identity27.1%
unpow227.1%
rem-sqrt-square30.3%
Simplified30.3%
if -0.0050000000000000001 < (sin.f64 ky) < 1.00000000000000005e-128Initial program 86.0%
+-commutative86.0%
unpow286.0%
unpow286.0%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.1%
clear-num52.1%
associate-/r/52.1%
Applied egg-rr52.1%
if 1.00000000000000005e-128 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 54.8%
Final simplification47.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 1e-128) (* (sin th) (/ ky (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-128) {
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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-128) 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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-128) {
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.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-128: 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) 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.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-128], 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.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;\sin th \cdot \frac{ky}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.4%
sqrt-unprod27.1%
pow227.1%
*-commutative27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/r/27.1%
*-inverses27.1%
/-rgt-identity27.1%
unpow227.1%
rem-sqrt-square30.3%
Simplified30.3%
if -0.0050000000000000001 < (sin.f64 ky) < 1.00000000000000005e-128Initial program 86.0%
+-commutative86.0%
unpow286.0%
unpow286.0%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.1%
if 1.00000000000000005e-128 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 54.8%
Final simplification47.2%
(FPCore (kx ky th) :precision binary64 (if (<= (sin ky) -0.005) (fabs (sin th)) (if (<= (sin ky) 1e-128) (* ky (/ (sin th) (sin kx))) (sin th))))
double code(double kx, double ky, double th) {
double tmp;
if (sin(ky) <= -0.005) {
tmp = fabs(sin(th));
} else if (sin(ky) <= 1e-128) {
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.005d0)) then
tmp = abs(sin(th))
else if (sin(ky) <= 1d-128) 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.005) {
tmp = Math.abs(Math.sin(th));
} else if (Math.sin(ky) <= 1e-128) {
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.005: tmp = math.fabs(math.sin(th)) elif math.sin(ky) <= 1e-128: 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) 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.005) tmp = abs(sin(th)); elseif (sin(ky) <= 1e-128) 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.005], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Sin[ky], $MachinePrecision], 1e-128], 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.005:\\
\;\;\;\;\left|\sin th\right|\\
\mathbf{elif}\;\sin ky \leq 10^{-128}:\\
\;\;\;\;ky \cdot \frac{\sin th}{\sin kx}\\
\mathbf{else}:\\
\;\;\;\;\sin th\\
\end{array}
\end{array}
if (sin.f64 ky) < -0.0050000000000000001Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.7%
+-commutative99.7%
unpow299.7%
unpow299.7%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 2.6%
add-sqr-sqrt1.4%
sqrt-unprod27.1%
pow227.1%
*-commutative27.1%
Applied egg-rr27.1%
*-commutative27.1%
associate-/r/27.1%
*-inverses27.1%
/-rgt-identity27.1%
unpow227.1%
rem-sqrt-square30.3%
Simplified30.3%
if -0.0050000000000000001 < (sin.f64 ky) < 1.00000000000000005e-128Initial program 86.0%
+-commutative86.0%
unpow286.0%
unpow286.0%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.1%
*-commutative52.1%
clear-num52.1%
un-div-inv52.1%
Applied egg-rr52.1%
associate-/r/52.1%
Applied egg-rr52.1%
if 1.00000000000000005e-128 < (sin.f64 ky) Initial program 99.7%
Taylor expanded in kx around 0 54.8%
Final simplification47.2%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.2e-13) (* (sin th) (/ (sin ky) (hypot (sin ky) kx))) (* (sin ky) (* (sin th) (/ 1.0 (fabs (sin kx)))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) * (sin(th) * (1.0 / fabs(sin(kx))));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) * (1.0 / Math.abs(Math.sin(kx))));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.2e-13: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) * (math.sin(th) * (1.0 / math.fabs(math.sin(kx)))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.2e-13) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) * Float64(sin(th) * Float64(1.0 / abs(sin(kx))))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.2e-13) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); else tmp = sin(ky) * (sin(th) * (1.0 / abs(sin(kx)))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.2e-13], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] * N[(1.0 / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.2 \cdot 10^{-13}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \left(\sin th \cdot \frac{1}{\left|\sin kx\right|}\right)\\
\end{array}
\end{array}
if kx < 4.19999999999999977e-13Initial program 92.1%
+-commutative92.1%
unpow292.1%
unpow292.1%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 69.6%
if 4.19999999999999977e-13 < kx Initial program 99.3%
associate-*l/99.3%
*-commutative99.3%
associate-*l/99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 47.7%
clear-num47.6%
associate-/r/47.7%
Applied egg-rr47.7%
add-sqr-sqrt39.7%
sqrt-prod61.9%
rem-sqrt-square61.9%
Applied egg-rr68.7%
Final simplification69.4%
(FPCore (kx ky th) :precision binary64 (if (<= kx 4.2e-13) (* (sin th) (/ (sin ky) (hypot (sin ky) kx))) (* (sin ky) (/ (sin th) (fabs (sin kx))))))
double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx));
} else {
tmp = sin(ky) * (sin(th) / fabs(sin(kx)));
}
return tmp;
}
public static double code(double kx, double ky, double th) {
double tmp;
if (kx <= 4.2e-13) {
tmp = Math.sin(th) * (Math.sin(ky) / Math.hypot(Math.sin(ky), kx));
} else {
tmp = Math.sin(ky) * (Math.sin(th) / Math.abs(Math.sin(kx)));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if kx <= 4.2e-13: tmp = math.sin(th) * (math.sin(ky) / math.hypot(math.sin(ky), kx)) else: tmp = math.sin(ky) * (math.sin(th) / math.fabs(math.sin(kx))) return tmp
function code(kx, ky, th) tmp = 0.0 if (kx <= 4.2e-13) tmp = Float64(sin(th) * Float64(sin(ky) / hypot(sin(ky), kx))); else tmp = Float64(sin(ky) * Float64(sin(th) / abs(sin(kx)))); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (kx <= 4.2e-13) tmp = sin(th) * (sin(ky) / hypot(sin(ky), kx)); else tmp = sin(ky) * (sin(th) / abs(sin(kx))); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[kx, 4.2e-13], N[(N[Sin[th], $MachinePrecision] * N[(N[Sin[ky], $MachinePrecision] / N[Sqrt[N[Sin[ky], $MachinePrecision] ^ 2 + kx ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[ky], $MachinePrecision] * N[(N[Sin[th], $MachinePrecision] / N[Abs[N[Sin[kx], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 4.2 \cdot 10^{-13}:\\
\;\;\;\;\sin th \cdot \frac{\sin ky}{\mathsf{hypot}\left(\sin ky, kx\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin ky \cdot \frac{\sin th}{\left|\sin kx\right|}\\
\end{array}
\end{array}
if kx < 4.19999999999999977e-13Initial program 92.1%
+-commutative92.1%
unpow292.1%
unpow292.1%
hypot-def99.7%
Simplified99.7%
Taylor expanded in kx around 0 69.6%
if 4.19999999999999977e-13 < kx Initial program 99.3%
associate-*l/99.3%
*-commutative99.3%
associate-*l/99.5%
+-commutative99.5%
unpow299.5%
unpow299.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 47.7%
add-sqr-sqrt39.7%
sqrt-prod61.9%
rem-sqrt-square61.9%
Applied egg-rr68.6%
Final simplification69.4%
(FPCore (kx ky th)
:precision binary64
(if (<= ky -10000000.0)
(sin th)
(if (<= ky 1.2e-128)
(* (sin th) (/ ky kx))
(if (or (<= ky 3.15) (not (<= ky 6.2e+112))) (sin th) (fabs (sin th))))))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -10000000.0) {
tmp = sin(th);
} else if (ky <= 1.2e-128) {
tmp = sin(th) * (ky / kx);
} else if ((ky <= 3.15) || !(ky <= 6.2e+112)) {
tmp = sin(th);
} else {
tmp = fabs(sin(th));
}
return tmp;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
real(8) :: tmp
if (ky <= (-10000000.0d0)) then
tmp = sin(th)
else if (ky <= 1.2d-128) then
tmp = sin(th) * (ky / kx)
else if ((ky <= 3.15d0) .or. (.not. (ky <= 6.2d+112))) then
tmp = sin(th)
else
tmp = abs(sin(th))
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -10000000.0) {
tmp = Math.sin(th);
} else if (ky <= 1.2e-128) {
tmp = Math.sin(th) * (ky / kx);
} else if ((ky <= 3.15) || !(ky <= 6.2e+112)) {
tmp = Math.sin(th);
} else {
tmp = Math.abs(Math.sin(th));
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -10000000.0: tmp = math.sin(th) elif ky <= 1.2e-128: tmp = math.sin(th) * (ky / kx) elif (ky <= 3.15) or not (ky <= 6.2e+112): tmp = math.sin(th) else: tmp = math.fabs(math.sin(th)) return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -10000000.0) tmp = sin(th); elseif (ky <= 1.2e-128) tmp = Float64(sin(th) * Float64(ky / kx)); elseif ((ky <= 3.15) || !(ky <= 6.2e+112)) tmp = sin(th); else tmp = abs(sin(th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -10000000.0) tmp = sin(th); elseif (ky <= 1.2e-128) tmp = sin(th) * (ky / kx); elseif ((ky <= 3.15) || ~((ky <= 6.2e+112))) tmp = sin(th); else tmp = abs(sin(th)); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -10000000.0], N[Sin[th], $MachinePrecision], If[LessEqual[ky, 1.2e-128], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[ky, 3.15], N[Not[LessEqual[ky, 6.2e+112]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[Abs[N[Sin[th], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -10000000:\\
\;\;\;\;\sin th\\
\mathbf{elif}\;ky \leq 1.2 \cdot 10^{-128}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\mathbf{elif}\;ky \leq 3.15 \lor \neg \left(ky \leq 6.2 \cdot 10^{+112}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\left|\sin th\right|\\
\end{array}
\end{array}
if ky < -1e7 or 1.1999999999999999e-128 < ky < 3.14999999999999991 or 6.19999999999999965e112 < ky Initial program 99.7%
Taylor expanded in kx around 0 34.2%
if -1e7 < ky < 1.1999999999999999e-128Initial program 86.3%
+-commutative86.3%
unpow286.3%
unpow286.3%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 51.2%
Taylor expanded in kx around 0 34.7%
if 3.14999999999999991 < ky < 6.19999999999999965e112Initial program 99.6%
associate-*l/99.6%
*-commutative99.6%
associate-*l/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 13.4%
add-sqr-sqrt10.5%
sqrt-unprod37.3%
pow237.3%
*-commutative37.3%
Applied egg-rr37.3%
*-commutative37.3%
associate-/r/37.4%
*-inverses37.4%
/-rgt-identity37.4%
unpow237.4%
rem-sqrt-square41.5%
Simplified41.5%
Final simplification35.0%
(FPCore (kx ky th) :precision binary64 (if (or (<= ky -10000000.0) (not (<= ky 6.2e-128))) (sin th) (* (sin th) (/ ky kx))))
double code(double kx, double ky, double th) {
double tmp;
if ((ky <= -10000000.0) || !(ky <= 6.2e-128)) {
tmp = sin(th);
} else {
tmp = sin(th) * (ky / 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 ((ky <= (-10000000.0d0)) .or. (.not. (ky <= 6.2d-128))) then
tmp = sin(th)
else
tmp = sin(th) * (ky / kx)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if ((ky <= -10000000.0) || !(ky <= 6.2e-128)) {
tmp = Math.sin(th);
} else {
tmp = Math.sin(th) * (ky / kx);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if (ky <= -10000000.0) or not (ky <= 6.2e-128): tmp = math.sin(th) else: tmp = math.sin(th) * (ky / kx) return tmp
function code(kx, ky, th) tmp = 0.0 if ((ky <= -10000000.0) || !(ky <= 6.2e-128)) tmp = sin(th); else tmp = Float64(sin(th) * Float64(ky / kx)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if ((ky <= -10000000.0) || ~((ky <= 6.2e-128))) tmp = sin(th); else tmp = sin(th) * (ky / kx); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[Or[LessEqual[ky, -10000000.0], N[Not[LessEqual[ky, 6.2e-128]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(N[Sin[th], $MachinePrecision] * N[(ky / kx), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -10000000 \lor \neg \left(ky \leq 6.2 \cdot 10^{-128}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\sin th \cdot \frac{ky}{kx}\\
\end{array}
\end{array}
if ky < -1e7 or 6.20000000000000005e-128 < ky Initial program 99.6%
Taylor expanded in kx around 0 30.9%
if -1e7 < ky < 6.20000000000000005e-128Initial program 86.3%
+-commutative86.3%
unpow286.3%
unpow286.3%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 51.2%
Taylor expanded in kx around 0 34.7%
Final simplification32.6%
(FPCore (kx ky th) :precision binary64 (if (or (<= ky -7800.0) (not (<= ky 1.35e-144))) (sin th) (/ ky (/ kx th))))
double code(double kx, double ky, double th) {
double tmp;
if ((ky <= -7800.0) || !(ky <= 1.35e-144)) {
tmp = sin(th);
} else {
tmp = ky / (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 ((ky <= (-7800.0d0)) .or. (.not. (ky <= 1.35d-144))) then
tmp = sin(th)
else
tmp = ky / (kx / th)
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if ((ky <= -7800.0) || !(ky <= 1.35e-144)) {
tmp = Math.sin(th);
} else {
tmp = ky / (kx / th);
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if (ky <= -7800.0) or not (ky <= 1.35e-144): tmp = math.sin(th) else: tmp = ky / (kx / th) return tmp
function code(kx, ky, th) tmp = 0.0 if ((ky <= -7800.0) || !(ky <= 1.35e-144)) tmp = sin(th); else tmp = Float64(ky / Float64(kx / th)); end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if ((ky <= -7800.0) || ~((ky <= 1.35e-144))) tmp = sin(th); else tmp = ky / (kx / th); end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[Or[LessEqual[ky, -7800.0], N[Not[LessEqual[ky, 1.35e-144]], $MachinePrecision]], N[Sin[th], $MachinePrecision], N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -7800 \lor \neg \left(ky \leq 1.35 \cdot 10^{-144}\right):\\
\;\;\;\;\sin th\\
\mathbf{else}:\\
\;\;\;\;\frac{ky}{\frac{kx}{th}}\\
\end{array}
\end{array}
if ky < -7800 or 1.34999999999999988e-144 < ky Initial program 99.7%
Taylor expanded in kx around 0 30.5%
if -7800 < ky < 1.34999999999999988e-144Initial program 85.0%
+-commutative85.0%
unpow285.0%
unpow285.0%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 52.0%
Taylor expanded in kx around 0 36.7%
Taylor expanded in th around 0 26.2%
associate-/l*28.0%
Simplified28.0%
Final simplification29.5%
(FPCore (kx ky th) :precision binary64 (if (<= ky -12500000000000.0) th (if (<= ky 3.9e-128) (/ ky (/ kx th)) th)))
double code(double kx, double ky, double th) {
double tmp;
if (ky <= -12500000000000.0) {
tmp = th;
} else if (ky <= 3.9e-128) {
tmp = ky / (kx / th);
} 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 <= (-12500000000000.0d0)) then
tmp = th
else if (ky <= 3.9d-128) then
tmp = ky / (kx / th)
else
tmp = th
end if
code = tmp
end function
public static double code(double kx, double ky, double th) {
double tmp;
if (ky <= -12500000000000.0) {
tmp = th;
} else if (ky <= 3.9e-128) {
tmp = ky / (kx / th);
} else {
tmp = th;
}
return tmp;
}
def code(kx, ky, th): tmp = 0 if ky <= -12500000000000.0: tmp = th elif ky <= 3.9e-128: tmp = ky / (kx / th) else: tmp = th return tmp
function code(kx, ky, th) tmp = 0.0 if (ky <= -12500000000000.0) tmp = th; elseif (ky <= 3.9e-128) tmp = Float64(ky / Float64(kx / th)); else tmp = th; end return tmp end
function tmp_2 = code(kx, ky, th) tmp = 0.0; if (ky <= -12500000000000.0) tmp = th; elseif (ky <= 3.9e-128) tmp = ky / (kx / th); else tmp = th; end tmp_2 = tmp; end
code[kx_, ky_, th_] := If[LessEqual[ky, -12500000000000.0], th, If[LessEqual[ky, 3.9e-128], N[(ky / N[(kx / th), $MachinePrecision]), $MachinePrecision], th]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;ky \leq -12500000000000:\\
\;\;\;\;th\\
\mathbf{elif}\;ky \leq 3.9 \cdot 10^{-128}:\\
\;\;\;\;\frac{ky}{\frac{kx}{th}}\\
\mathbf{else}:\\
\;\;\;\;th\\
\end{array}
\end{array}
if ky < -1.25e13 or 3.89999999999999997e-128 < ky Initial program 99.7%
associate-*l/99.0%
*-commutative99.0%
associate-*l/99.6%
+-commutative99.6%
unpow299.6%
unpow299.6%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 31.2%
Taylor expanded in th around 0 18.4%
if -1.25e13 < ky < 3.89999999999999997e-128Initial program 86.5%
+-commutative86.5%
unpow286.5%
unpow286.5%
hypot-def99.6%
Simplified99.6%
Taylor expanded in ky around 0 50.3%
Taylor expanded in kx around 0 34.2%
Taylor expanded in th around 0 24.8%
associate-/l*26.4%
Simplified26.4%
Final simplification22.0%
(FPCore (kx ky th) :precision binary64 th)
double code(double kx, double ky, double th) {
return th;
}
real(8) function code(kx, ky, th)
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8), intent (in) :: th
code = th
end function
public static double code(double kx, double ky, double th) {
return th;
}
def code(kx, ky, th): return th
function code(kx, ky, th) return th end
function tmp = code(kx, ky, th) tmp = th; end
code[kx_, ky_, th_] := th
\begin{array}{l}
\\
th
\end{array}
Initial program 93.7%
associate-*l/91.2%
*-commutative91.2%
associate-*l/93.7%
+-commutative93.7%
unpow293.7%
unpow293.7%
hypot-def99.6%
Simplified99.6%
Taylor expanded in kx around 0 20.6%
Taylor expanded in th around 0 12.7%
Final simplification12.7%
herbie shell --seed 2023313
(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)))