\[\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}
\]
↓
\[\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
t_1 := \frac{\left(2.6666666666666665 \cdot t_0\right) \cdot t_0}{\sin x}\\
t_2 := {t_0}^{2}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-8}:\\
\;\;\;\;2.6666666666666665 \cdot \frac{t_2}{\sin x}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{0.6666666666666666} \cdot 0.4444444444444444\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665 \cdot t_2}{\sin x}\\
\end{array}
\]
(FPCore (x)
:precision binary64
(/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (sin (* x 0.5)))
(t_1 (/ (* (* 2.6666666666666665 t_0) t_0) (sin x)))
(t_2 (pow t_0 2.0)))
(if (<= t_1 -5e-8)
(* 2.6666666666666665 (/ t_2 (sin x)))
(if (<= t_1 4e-38)
(* (/ x 0.6666666666666666) 0.4444444444444444)
(/ (* 2.6666666666666665 t_2) (sin x))))))double code(double x) {
return (((8.0 / 3.0) * sin((x * 0.5))) * sin((x * 0.5))) / sin(x);
}
↓
double code(double x) {
double t_0 = sin((x * 0.5));
double t_1 = ((2.6666666666666665 * t_0) * t_0) / sin(x);
double t_2 = pow(t_0, 2.0);
double tmp;
if (t_1 <= -5e-8) {
tmp = 2.6666666666666665 * (t_2 / sin(x));
} else if (t_1 <= 4e-38) {
tmp = (x / 0.6666666666666666) * 0.4444444444444444;
} else {
tmp = (2.6666666666666665 * t_2) / sin(x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (((8.0d0 / 3.0d0) * sin((x * 0.5d0))) * sin((x * 0.5d0))) / sin(x)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sin((x * 0.5d0))
t_1 = ((2.6666666666666665d0 * t_0) * t_0) / sin(x)
t_2 = t_0 ** 2.0d0
if (t_1 <= (-5d-8)) then
tmp = 2.6666666666666665d0 * (t_2 / sin(x))
else if (t_1 <= 4d-38) then
tmp = (x / 0.6666666666666666d0) * 0.4444444444444444d0
else
tmp = (2.6666666666666665d0 * t_2) / sin(x)
end if
code = tmp
end function
public static double code(double x) {
return (((8.0 / 3.0) * Math.sin((x * 0.5))) * Math.sin((x * 0.5))) / Math.sin(x);
}
↓
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
double t_1 = ((2.6666666666666665 * t_0) * t_0) / Math.sin(x);
double t_2 = Math.pow(t_0, 2.0);
double tmp;
if (t_1 <= -5e-8) {
tmp = 2.6666666666666665 * (t_2 / Math.sin(x));
} else if (t_1 <= 4e-38) {
tmp = (x / 0.6666666666666666) * 0.4444444444444444;
} else {
tmp = (2.6666666666666665 * t_2) / Math.sin(x);
}
return tmp;
}
def code(x):
return (((8.0 / 3.0) * math.sin((x * 0.5))) * math.sin((x * 0.5))) / math.sin(x)
↓
def code(x):
t_0 = math.sin((x * 0.5))
t_1 = ((2.6666666666666665 * t_0) * t_0) / math.sin(x)
t_2 = math.pow(t_0, 2.0)
tmp = 0
if t_1 <= -5e-8:
tmp = 2.6666666666666665 * (t_2 / math.sin(x))
elif t_1 <= 4e-38:
tmp = (x / 0.6666666666666666) * 0.4444444444444444
else:
tmp = (2.6666666666666665 * t_2) / math.sin(x)
return tmp
function code(x)
return Float64(Float64(Float64(Float64(8.0 / 3.0) * sin(Float64(x * 0.5))) * sin(Float64(x * 0.5))) / sin(x))
end
↓
function code(x)
t_0 = sin(Float64(x * 0.5))
t_1 = Float64(Float64(Float64(2.6666666666666665 * t_0) * t_0) / sin(x))
t_2 = t_0 ^ 2.0
tmp = 0.0
if (t_1 <= -5e-8)
tmp = Float64(2.6666666666666665 * Float64(t_2 / sin(x)));
elseif (t_1 <= 4e-38)
tmp = Float64(Float64(x / 0.6666666666666666) * 0.4444444444444444);
else
tmp = Float64(Float64(2.6666666666666665 * t_2) / sin(x));
end
return tmp
end
function tmp = code(x)
tmp = (((8.0 / 3.0) * sin((x * 0.5))) * sin((x * 0.5))) / sin(x);
end
↓
function tmp_2 = code(x)
t_0 = sin((x * 0.5));
t_1 = ((2.6666666666666665 * t_0) * t_0) / sin(x);
t_2 = t_0 ^ 2.0;
tmp = 0.0;
if (t_1 <= -5e-8)
tmp = 2.6666666666666665 * (t_2 / sin(x));
elseif (t_1 <= 4e-38)
tmp = (x / 0.6666666666666666) * 0.4444444444444444;
else
tmp = (2.6666666666666665 * t_2) / sin(x);
end
tmp_2 = tmp;
end
code[x_] := N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.6666666666666665 * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, -5e-8], N[(2.6666666666666665 * N[(t$95$2 / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-38], N[(N[(x / 0.6666666666666666), $MachinePrecision] * 0.4444444444444444), $MachinePrecision], N[(N[(2.6666666666666665 * t$95$2), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]]]]]]
\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}
↓
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
t_1 := \frac{\left(2.6666666666666665 \cdot t_0\right) \cdot t_0}{\sin x}\\
t_2 := {t_0}^{2}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-8}:\\
\;\;\;\;2.6666666666666665 \cdot \frac{t_2}{\sin x}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{0.6666666666666666} \cdot 0.4444444444444444\\
\mathbf{else}:\\
\;\;\;\;\frac{2.6666666666666665 \cdot t_2}{\sin x}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 19976 |
|---|
\[\begin{array}{l}
t_0 := 2.6666666666666665 \cdot \frac{{\sin \left(x \cdot 0.5\right)}^{2}}{\sin x}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{0.6666666666666666} \cdot 0.4444444444444444\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.7 |
|---|
| Cost | 14024 |
|---|
\[\begin{array}{l}
t_0 := \frac{\left(\cos x + -1\right) \cdot -1.3333333333333333}{\sin x}\\
\mathbf{if}\;x \leq -0.018:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0235:\\
\;\;\;\;2.6666666666666665 \cdot \left(0.25 \cdot x + \left(0.020833333333333332 \cdot {x}^{3} + 0.0020833333333333333 \cdot {x}^{5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.7 |
|---|
| Cost | 13896 |
|---|
\[\begin{array}{l}
t_0 := \frac{\left(\cos x + -1\right) \cdot -1.3333333333333333}{\sin x}\\
\mathbf{if}\;x \leq -0.018:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0235:\\
\;\;\;\;x \cdot 0.6666666666666666 + \left(0.05555555555555555 \cdot {x}^{3} + 0.005555555555555556 \cdot {x}^{5}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.7 |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
t_0 := 1.3333333333333333 \cdot \frac{1 - \cos x}{\sin x}\\
\mathbf{if}\;x \leq -0.0045:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0044:\\
\;\;\;\;2.6666666666666665 \cdot \left(0.25 \cdot x + 0.020833333333333332 \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.7 |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
t_0 := \frac{\left(\cos x + -1\right) \cdot -1.3333333333333333}{\sin x}\\
\mathbf{if}\;x \leq -0.0045:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0044:\\
\;\;\;\;2.6666666666666665 \cdot \left(0.25 \cdot x + 0.020833333333333332 \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 31.0 |
|---|
| Cost | 320 |
|---|
\[\frac{x}{0.6666666666666666} \cdot 0.4444444444444444
\]
| Alternative 7 |
|---|
| Error | 31.0 |
|---|
| Cost | 192 |
|---|
\[x \cdot 0.6666666666666666
\]