\[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 | 57.3 |
|---|
| Cost | 65024 |
|---|
\[\begin{array}{l}
t_0 := \sqrt[3]{\sin^{-1} \left(1 - x\right)}\\
\mathsf{fma}\left(-t_0, {t_0}^{2}, {t_0}^{3}\right) + \cos^{-1} \left(1 - x\right)
\end{array}
\]
| Alternative 2 |
|---|
| Error | 57.3 |
|---|
| Cost | 52288 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{1 + \left(0.25 \cdot {\pi}^{2} - e^{\mathsf{log1p}\left({t_0}^{2}\right)}\right)}{\pi \cdot 0.5 + t_0}
\end{array}
\]
| Alternative 3 |
|---|
| Error | 57.3 |
|---|
| Cost | 52224 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\cos^{-1} \left(1 - x\right) + \mathsf{fma}\left(-\sqrt[3]{t_0}, {\left({t_0}^{2}\right)}^{0.3333333333333333}, t_0\right)
\end{array}
\]
| Alternative 4 |
|---|
| Error | 59.6 |
|---|
| Cost | 26180 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;2 \cdot \log \left(\sqrt{e^{t_0}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + 2 \cdot \sin^{-1} \left(1 - x\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 57.3 |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt[3]{\sin^{-1} \left(1 - x\right)}\right)}^{3}
\]
| Alternative 6 |
|---|
| Error | 57.3 |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt{\sin^{-1} \left(1 - x\right)}\right)}^{2}
\]
| Alternative 7 |
|---|
| Error | 57.9 |
|---|
| Cost | 13508 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\mathbf{if}\;x \leq 5.5 \cdot 10^{-17}:\\
\;\;\;\;\cos^{-1} \left(1 - x\right) + 2 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot 0.5 - t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 59.6 |
|---|
| Cost | 13184 |
|---|
\[\pi \cdot 0.5 - \sin^{-1} \left(1 - x\right)
\]
| Alternative 9 |
|---|
| Error | 59.6 |
|---|
| Cost | 6592 |
|---|
\[\cos^{-1} \left(1 - x\right)
\]