\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq 0.02:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \pi, -1\right) + 1\\
\end{array}
\]
(FPCore (F l)
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
↓
(FPCore (F l)
:precision binary64
(if (<= (* PI l) -1e+15)
(* PI l)
(if (<= (* PI l) 0.02)
(- (* PI l) (/ (/ (tan (* PI l)) F) F))
(+ (fma l PI -1.0) 1.0))))double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
↓
double code(double F, double l) {
double tmp;
if ((((double) M_PI) * l) <= -1e+15) {
tmp = ((double) M_PI) * l;
} else if ((((double) M_PI) * l) <= 0.02) {
tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
} else {
tmp = fma(l, ((double) M_PI), -1.0) + 1.0;
}
return tmp;
}
function code(F, l)
return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l))))
end
↓
function code(F, l)
tmp = 0.0
if (Float64(pi * l) <= -1e+15)
tmp = Float64(pi * l);
elseif (Float64(pi * l) <= 0.02)
tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F));
else
tmp = Float64(fma(l, pi, -1.0) + 1.0);
end
return tmp
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[F_, l_] := If[LessEqual[N[(Pi * l), $MachinePrecision], -1e+15], N[(Pi * l), $MachinePrecision], If[LessEqual[N[(Pi * l), $MachinePrecision], 0.02], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(N[(l * Pi + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
↓
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq 0.02:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \pi, -1\right) + 1\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.9 |
|---|
| Cost | 26568 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\pi \cdot \ell \leq 0.02:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \pi, -1\right) + 1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 4.9 |
|---|
| Cost | 13320 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 0.0059:\\
\;\;\;\;\pi \cdot \left(\ell - \frac{\ell}{F \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell, \pi, -1\right) + 1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 13.3 |
|---|
| Cost | 7640 |
|---|
\[\begin{array}{l}
t_0 := -1 + \left(\pi \cdot \ell + 1\right)\\
t_1 := \ell \cdot \frac{\frac{-\pi}{F}}{F}\\
\mathbf{if}\;F \leq -4.675860782316854 \cdot 10^{-102}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;F \leq -5.4 \cdot 10^{-199}:\\
\;\;\;\;\pi \cdot \frac{-\frac{\ell}{F}}{F}\\
\mathbf{elif}\;F \leq 5.731130462967596 \cdot 10^{-159}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 6.6180432152346266 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 1.4939116397832601 \cdot 10^{-62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.306601849189003 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 13.3 |
|---|
| Cost | 7640 |
|---|
\[\begin{array}{l}
t_0 := -1 + \left(\pi \cdot \ell + 1\right)\\
\mathbf{if}\;F \leq -4.675860782316854 \cdot 10^{-102}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;F \leq -5.4 \cdot 10^{-199}:\\
\;\;\;\;\pi \cdot \frac{-\frac{\ell}{F}}{F}\\
\mathbf{elif}\;F \leq 5.731130462967596 \cdot 10^{-159}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 6.6180432152346266 \cdot 10^{-121}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\mathbf{elif}\;F \leq 1.4939116397832601 \cdot 10^{-62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.306601849189003 \cdot 10^{-17}:\\
\;\;\;\;\ell \cdot \frac{\frac{-\pi}{F}}{F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 13.2 |
|---|
| Cost | 7376 |
|---|
\[\begin{array}{l}
t_0 := \ell \cdot \frac{\frac{-\pi}{F}}{F}\\
\mathbf{if}\;F \leq 5.731130462967596 \cdot 10^{-159}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;F \leq 6.6180432152346266 \cdot 10^{-121}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.4939116397832601 \cdot 10^{-62}:\\
\;\;\;\;-1 + \left(\pi \cdot \ell + 1\right)\\
\mathbf{elif}\;F \leq 1.306601849189003 \cdot 10^{-17}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 4.9 |
|---|
| Cost | 7176 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 0.0059:\\
\;\;\;\;\pi \cdot \left(\ell - \frac{\ell}{F \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 13.2 |
|---|
| Cost | 6528 |
|---|
\[\pi \cdot \ell
\]