\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\]
↓
\[\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}
\]
(FPCore (B x)
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
↓
(FPCore (B x) :precision binary64 (- (/ 1.0 (sin B)) (* x (/ 1.0 (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 (1.0 / sin(B)) - (x * (1.0 / 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 = (1.0d0 / sin(b)) - (x * (1.0d0 / 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 (1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
}
def code(B, x):
return -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
↓
def code(B, x):
return (1.0 / math.sin(B)) - (x * (1.0 / 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(Float64(1.0 / sin(B)) - Float64(x * Float64(1.0 / 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 = (1.0 / sin(B)) - (x * (1.0 / 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[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
↓
\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}
Alternatives
| Alternative 1 |
|---|
| Error | 1.2 |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
t_0 := -\frac{\cos B \cdot x}{\sin B}\\
\mathbf{if}\;x \leq -520:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2500000:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 10.6 |
|---|
| Cost | 7496 |
|---|
\[\begin{array}{l}
t_0 := \left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+94}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+81}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 18.2 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;B \leq -0.3:\\
\;\;\;\;t_0\\
\mathbf{elif}\;B \leq 0.038:\\
\;\;\;\;\left(\frac{1}{B} + B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right)\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 18.2 |
|---|
| Cost | 6848 |
|---|
\[\frac{1}{\sin B} - \frac{x}{B}
\]
| Alternative 5 |
|---|
| Error | 35.6 |
|---|
| Cost | 832 |
|---|
\[\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(x \cdot B\right)\right) - \frac{x}{B}
\]
| Alternative 6 |
|---|
| Error | 35.5 |
|---|
| Cost | 704 |
|---|
\[\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}
\]
| Alternative 7 |
|---|
| Error | 36.3 |
|---|
| Cost | 520 |
|---|
\[\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.014:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 35.6 |
|---|
| Cost | 320 |
|---|
\[\frac{1 - x}{B}
\]
| Alternative 9 |
|---|
| Error | 44.7 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{B}
\]