\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\]
↓
\[{\sin B}^{-1} - \frac{x}{\tan B}
\]
(FPCore (B x)
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
↓
(FPCore (B x) :precision binary64 (- (pow (sin B) -1.0) (/ x (tan B))))
double code(double B, double x) {
return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
↓
double code(double B, double x) {
return pow(sin(B), -1.0) - (x / tan(B));
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
end function
↓
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (sin(b) ** (-1.0d0)) - (x / tan(b))
end function
public static double code(double B, double x) {
return -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
↓
public static double code(double B, double x) {
return Math.pow(Math.sin(B), -1.0) - (x / Math.tan(B));
}
def code(B, x):
return -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
↓
def code(B, x):
return math.pow(math.sin(B), -1.0) - (x / math.tan(B))
function code(B, x)
return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B)))
end
↓
function code(B, x)
return Float64((sin(B) ^ -1.0) - Float64(x / tan(B)))
end
function tmp = code(B, x)
tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B));
end
↓
function tmp = code(B, x)
tmp = (sin(B) ^ -1.0) - (x / tan(B));
end
code[B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[B_, x_] := N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
↓
{\sin B}^{-1} - \frac{x}{\tan B}
Alternatives
| Alternative 1 |
|---|
| Error | 1.62% |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -520:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-5}:\\
\;\;\;\;{\sin B}^{-1} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\tan B}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.23% |
|---|
| Cost | 13248 |
|---|
\[\frac{1}{\sin B} - \frac{x}{\tan B}
\]
| Alternative 3 |
|---|
| Error | 1.62% |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -520:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\tan B}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.68% |
|---|
| Cost | 6985 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-6} \lor \neg \left(x \leq 5.2 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{1 - x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.68% |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\tan B}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 2.46% |
|---|
| Cost | 6921 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 29.21% |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-7}:\\
\;\;\;\;\left(\frac{1}{B} - \frac{x}{B}\right) + B \cdot 0.16666666666666666\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 55.97% |
|---|
| Cost | 704 |
|---|
\[\frac{1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)
\]
| Alternative 9 |
|---|
| Error | 55.67% |
|---|
| Cost | 704 |
|---|
\[\left(\frac{1}{B} - \frac{x}{B}\right) + B \cdot 0.16666666666666666
\]
| Alternative 10 |
|---|
| Error | 55.66% |
|---|
| Cost | 576 |
|---|
\[B \cdot 0.16666666666666666 + \frac{1 - x}{B}
\]
| Alternative 11 |
|---|
| Error | 56.95% |
|---|
| Cost | 521 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 55.85% |
|---|
| Cost | 448 |
|---|
\[\frac{1}{B} - \frac{x}{B}
\]
| Alternative 13 |
|---|
| Error | 55.85% |
|---|
| Cost | 320 |
|---|
\[\frac{1 - x}{B}
\]
| Alternative 14 |
|---|
| Error | 96.64% |
|---|
| Cost | 192 |
|---|
\[B \cdot 0.16666666666666666
\]
| Alternative 15 |
|---|
| Error | 70.05% |
|---|
| Cost | 192 |
|---|
\[\frac{1}{B}
\]