\[0 \leq x \land x \leq 0.5\]
\[\cos^{-1} \left(1 - x\right)
\]
↓
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{\mathsf{fma}\left(\sqrt[3]{{\left(\pi \cdot 0.5\right)}^{4}}, \sqrt[3]{0.25 \cdot {\pi}^{2}}, -{t_0}^{2}\right)}{\pi \cdot 0.5 + t_0}
\end{array}
\]
(FPCore (x) :precision binary64 (acos (- 1.0 x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (asin (- 1.0 x))))
(/
(fma
(cbrt (pow (* PI 0.5) 4.0))
(cbrt (* 0.25 (pow PI 2.0)))
(- (pow t_0 2.0)))
(+ (* PI 0.5) t_0))))double code(double x) {
return acos((1.0 - x));
}
↓
double code(double x) {
double t_0 = asin((1.0 - x));
return fma(cbrt(pow((((double) M_PI) * 0.5), 4.0)), cbrt((0.25 * pow(((double) M_PI), 2.0))), -pow(t_0, 2.0)) / ((((double) M_PI) * 0.5) + t_0);
}
function code(x)
return acos(Float64(1.0 - x))
end
↓
function code(x)
t_0 = asin(Float64(1.0 - x))
return Float64(fma(cbrt((Float64(pi * 0.5) ^ 4.0)), cbrt(Float64(0.25 * (pi ^ 2.0))), Float64(-(t_0 ^ 2.0))) / Float64(Float64(pi * 0.5) + t_0))
end
code[x_] := N[ArcCos[N[(1.0 - x), $MachinePrecision]], $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[ArcSin[N[(1.0 - x), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[Power[N[Power[N[(Pi * 0.5), $MachinePrecision], 4.0], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(0.25 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] + (-N[Power[t$95$0, 2.0], $MachinePrecision])), $MachinePrecision] / N[(N[(Pi * 0.5), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]]
\cos^{-1} \left(1 - x\right)
↓
\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{\mathsf{fma}\left(\sqrt[3]{{\left(\pi \cdot 0.5\right)}^{4}}, \sqrt[3]{0.25 \cdot {\pi}^{2}}, -{t_0}^{2}\right)}{\pi \cdot 0.5 + t_0}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 89.48% |
|---|
| Cost | 45312 |
|---|
\[\mathsf{fma}\left(\sqrt{\pi} \cdot \sqrt{0.5}, \sqrt{\pi \cdot 0.5}, -\sin^{-1} \left(1 - x\right)\right)
\]
| Alternative 2 |
|---|
| Error | 89.55% |
|---|
| Cost | 32512 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt[3]{{\sin^{-1} \left(1 - x\right)}^{1.5}}\right)}^{2}
\]
| Alternative 3 |
|---|
| Error | 93.07% |
|---|
| Cost | 26180 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;3 \cdot \log \left(\sqrt[3]{e^{t_0}}\right)\\
\mathbf{else}:\\
\;\;\;\;\pi - t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 89.57% |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt[3]{\sin^{-1} \left(1 - x\right)}\right)}^{3}
\]
| Alternative 5 |
|---|
| Error | 89.54% |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt{\sin^{-1} \left(1 - x\right)}\right)}^{2}
\]
| Alternative 6 |
|---|
| Error | 93.06% |
|---|
| Cost | 13700 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;\left(\pi \cdot 0.5 + 1\right) + \left(-1 - \sin^{-1} \left(1 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\pi - \cos^{-1} \left(1 - x\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 93.06% |
|---|
| Cost | 13316 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;1 + \left(t_0 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\pi - t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 93.06% |
|---|
| Cost | 6848 |
|---|
\[1 + \left(\cos^{-1} \left(1 - x\right) + -1\right)
\]
| Alternative 9 |
|---|
| Error | 93.06% |
|---|
| Cost | 6592 |
|---|
\[\cos^{-1} \left(1 - x\right)
\]