\[\frac{-\left(f + n\right)}{f - n}
\]
↓
\[\frac{f + n}{n - f}
\]
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
↓
(FPCore (f n) :precision binary64 (/ (+ f n) (- n f)))
double code(double f, double n) {
return -(f + n) / (f - n);
}
↓
double code(double f, double n) {
return (f + n) / (n - f);
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = -(f + n) / (f - n)
end function
↓
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = (f + n) / (n - f)
end function
public static double code(double f, double n) {
return -(f + n) / (f - n);
}
↓
public static double code(double f, double n) {
return (f + n) / (n - f);
}
def code(f, n):
return -(f + n) / (f - n)
↓
def code(f, n):
return (f + n) / (n - f)
function code(f, n)
return Float64(Float64(-Float64(f + n)) / Float64(f - n))
end
↓
function code(f, n)
return Float64(Float64(f + n) / Float64(n - f))
end
function tmp = code(f, n)
tmp = -(f + n) / (f - n);
end
↓
function tmp = code(f, n)
tmp = (f + n) / (n - f);
end
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
↓
code[f_, n_] := N[(N[(f + n), $MachinePrecision] / N[(n - f), $MachinePrecision]), $MachinePrecision]
\frac{-\left(f + n\right)}{f - n}
↓
\frac{f + n}{n - f}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 72.7% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -1.5 \cdot 10^{+90} \lor \neg \left(f \leq 9.8 \cdot 10^{+113}\right):\\
\;\;\;\;-2 \cdot \frac{n}{f} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 72.5% |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -3.2 \cdot 10^{+89}:\\
\;\;\;\;-1 - \frac{n}{f}\\
\mathbf{elif}\;f \leq 1.02 \cdot 10^{+114}:\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f}{n - f}\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 72.2% |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -3.8 \cdot 10^{+89} \lor \neg \left(f \leq 1.22 \cdot 10^{+114}\right):\\
\;\;\;\;-1 - \frac{n}{f}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{f}{n}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 72.0% |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -2.7 \cdot 10^{+89}:\\
\;\;\;\;-1\\
\mathbf{elif}\;f \leq 1.7 \cdot 10^{+114}:\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 72.2% |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -1.42 \cdot 10^{+90}:\\
\;\;\;\;-1 - \frac{n}{f}\\
\mathbf{elif}\;f \leq 7.3 \cdot 10^{+114}:\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f}{n - f}\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 72.4% |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -4.4 \cdot 10^{+89}:\\
\;\;\;\;-1 - \frac{n}{f}\\
\mathbf{elif}\;f \leq 8.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{n}{n - f}\\
\mathbf{else}:\\
\;\;\;\;\frac{f}{n - f}\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 71.6% |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;f \leq -2.9 \cdot 10^{+92}:\\
\;\;\;\;-1\\
\mathbf{elif}\;f \leq 8.4 \cdot 10^{+113}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 49.7% |
|---|
| Cost | 64 |
|---|
\[-1
\]