\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\]
↓
\[\frac{1}{\sin B} - \frac{x}{\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 (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 / 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 / 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 / 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 / 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 / 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 / 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[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
↓
\frac{1}{\sin B} - \frac{x}{\tan B}
Alternatives
| Alternative 1 |
|---|
| Error | 1.0 |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.68:\\
\;\;\;\;\left(\frac{1}{B} + -1\right) - \frac{x}{\tan B}\\
\mathbf{elif}\;x \leq 115000000:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.1 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.9 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.7:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.026:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.9 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.58:\\
\;\;\;\;\left(\frac{1}{B} + -1\right) - t_0\\
\mathbf{elif}\;x \leq 0.026:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 18.1 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
t_0 := \frac{1 - x}{B} + B \cdot 0.16666666666666666\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-6}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 35.0 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -21000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{1}{B} + -1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 34.5 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := \frac{1 - x}{B}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{1}{B} + -1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 36.3 |
|---|
| Cost | 520 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 34.3 |
|---|
| Cost | 448 |
|---|
\[\frac{1 - x}{B} + -1
\]
| Alternative 10 |
|---|
| Error | 61.8 |
|---|
| Cost | 192 |
|---|
\[B \cdot 0.16666666666666666
\]
| Alternative 11 |
|---|
| Error | 44.6 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{B}
\]