\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\]
↓
\[\frac{1 - \cos B \cdot x}{\sin B}
\]
(FPCore (B x)
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
↓
(FPCore (B x) :precision binary64 (/ (- 1.0 (* (cos B) x)) (sin 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 - (cos(B) * x)) / sin(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 - (cos(b) * x)) / sin(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.cos(B) * x)) / Math.sin(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.cos(B) * x)) / math.sin(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 - Float64(cos(B) * x)) / sin(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 - (cos(B) * x)) / sin(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[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
↓
\frac{1 - \cos B \cdot x}{\sin B}
Alternatives
| Alternative 1 |
|---|
| Error | 1.3 |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \frac{-\cos B}{\sin B}\\
\mathbf{if}\;x \leq -8579896924646503:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 104580880.11854258:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.2 |
|---|
| Cost | 13448 |
|---|
\[\begin{array}{l}
t_0 := \cos B \cdot \frac{-x}{\sin B}\\
\mathbf{if}\;x \leq -8579896924646503:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 104580880.11854258:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 9.5 |
|---|
| Cost | 7368 |
|---|
\[\begin{array}{l}
t_0 := \left(B \cdot 0.16666666666666666 + \frac{1}{B}\right) - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.8955616087334302 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9.531076106404538 \cdot 10^{+53}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 18.3 |
|---|
| Cost | 6856 |
|---|
\[\begin{array}{l}
t_0 := B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\
\mathbf{if}\;x \leq -5.066143356299908 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.8757986119390207 \cdot 10^{-19}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 16.5 |
|---|
| Cost | 6720 |
|---|
\[\frac{1 - x}{\sin B}
\]
| Alternative 6 |
|---|
| Error | 35.5 |
|---|
| Cost | 576 |
|---|
\[B \cdot 0.16666666666666666 + \frac{1 - x}{B}
\]
| Alternative 7 |
|---|
| Error | 36.3 |
|---|
| Cost | 520 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -20544.879071261556:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.02609633979704309:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 35.6 |
|---|
| Cost | 320 |
|---|
\[\frac{1 - x}{B}
\]
| Alternative 9 |
|---|
| Error | 44.6 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{B}
\]