\[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)\\
t_1 := {t_0}^{3}\\
t_2 := {t_0}^{9}\\
t_3 := {t_0}^{18}\\
\frac{\frac{\frac{\mathsf{fma}\left(-t_2, t_2, t_3\right) + \left({\pi}^{18} \cdot 3.814697265625 \cdot 10^{-6} - t_3\right)}{\mathsf{fma}\left(t_1, \mathsf{fma}\left(0.125, {\pi}^{3}, t_1\right), {\pi}^{6} \cdot 0.015625\right)}}{\mathsf{fma}\left({\left({\pi}^{3}\right)}^{3}, 0.001953125, t_2\right)}}{\left(\pi \cdot \pi\right) \cdot 0.25 + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
(FPCore (x) :precision binary64 (acos (- 1.0 x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (asin (- 1.0 x)))
(t_1 (pow t_0 3.0))
(t_2 (pow t_0 9.0))
(t_3 (pow t_0 18.0)))
(/
(/
(/
(+ (fma (- t_2) t_2 t_3) (- (* (pow PI 18.0) 3.814697265625e-6) t_3))
(fma t_1 (fma 0.125 (pow PI 3.0) t_1) (* (pow PI 6.0) 0.015625)))
(fma (pow (pow PI 3.0) 3.0) 0.001953125 t_2))
(+ (* (* PI PI) 0.25) (* t_0 (fma 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));
double t_1 = pow(t_0, 3.0);
double t_2 = pow(t_0, 9.0);
double t_3 = pow(t_0, 18.0);
return (((fma(-t_2, t_2, t_3) + ((pow(((double) M_PI), 18.0) * 3.814697265625e-6) - t_3)) / fma(t_1, fma(0.125, pow(((double) M_PI), 3.0), t_1), (pow(((double) M_PI), 6.0) * 0.015625))) / fma(pow(pow(((double) M_PI), 3.0), 3.0), 0.001953125, t_2)) / (((((double) M_PI) * ((double) M_PI)) * 0.25) + (t_0 * fma(((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))
t_1 = t_0 ^ 3.0
t_2 = t_0 ^ 9.0
t_3 = t_0 ^ 18.0
return Float64(Float64(Float64(Float64(fma(Float64(-t_2), t_2, t_3) + Float64(Float64((pi ^ 18.0) * 3.814697265625e-6) - t_3)) / fma(t_1, fma(0.125, (pi ^ 3.0), t_1), Float64((pi ^ 6.0) * 0.015625))) / fma(((pi ^ 3.0) ^ 3.0), 0.001953125, t_2)) / Float64(Float64(Float64(pi * pi) * 0.25) + Float64(t_0 * fma(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]}, Block[{t$95$1 = N[Power[t$95$0, 3.0], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 9.0], $MachinePrecision]}, Block[{t$95$3 = N[Power[t$95$0, 18.0], $MachinePrecision]}, N[(N[(N[(N[(N[((-t$95$2) * t$95$2 + t$95$3), $MachinePrecision] + N[(N[(N[Power[Pi, 18.0], $MachinePrecision] * 3.814697265625e-6), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[(0.125 * N[Power[Pi, 3.0], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[Power[Pi, 6.0], $MachinePrecision] * 0.015625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 3.0], $MachinePrecision] * 0.001953125 + t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(Pi * Pi), $MachinePrecision] * 0.25), $MachinePrecision] + N[(t$95$0 * N[(Pi * 0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\cos^{-1} \left(1 - x\right)
↓
\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
t_1 := {t_0}^{3}\\
t_2 := {t_0}^{9}\\
t_3 := {t_0}^{18}\\
\frac{\frac{\frac{\mathsf{fma}\left(-t_2, t_2, t_3\right) + \left({\pi}^{18} \cdot 3.814697265625 \cdot 10^{-6} - t_3\right)}{\mathsf{fma}\left(t_1, \mathsf{fma}\left(0.125, {\pi}^{3}, t_1\right), {\pi}^{6} \cdot 0.015625\right)}}{\mathsf{fma}\left({\left({\pi}^{3}\right)}^{3}, 0.001953125, t_2\right)}}{\left(\pi \cdot \pi\right) \cdot 0.25 + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 89.37% |
|---|
| Cost | 175616 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
t_1 := {t_0}^{3}\\
\frac{\frac{\frac{3.814697265625 \cdot 10^{-6} \cdot {\left({\pi}^{6}\right)}^{3} - {t_0}^{18}}{\mathsf{fma}\left(t_1, \mathsf{fma}\left(0.125, {\pi}^{3}, t_1\right), {\pi}^{6} \cdot 0.015625\right)}}{\mathsf{fma}\left({\left({\pi}^{3}\right)}^{3}, 0.001953125, {t_0}^{9}\right)}}{\left(\pi \cdot \pi\right) \cdot 0.25 + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
| Alternative 2 |
|---|
| Error | 89.4% |
|---|
| Cost | 78144 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{0.125 \cdot {\pi}^{3} - \mathsf{expm1}\left(\mathsf{log1p}\left({t_0}^{3}\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.25 + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
| Alternative 3 |
|---|
| Error | 89.42% |
|---|
| Cost | 71808 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{0.125 \cdot e^{3 \cdot \log \pi} - {t_0}^{3}}{\left(\pi \cdot \pi\right) \cdot 0.25 + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
| Alternative 4 |
|---|
| Error | 92.86% |
|---|
| Cost | 52228 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;\mathsf{fma}\left({\left(\sqrt{e^{\mathsf{log1p}\left(t_0\right) \cdot 0.6666666666666666}}\right)}^{2}, \sqrt[3]{1 + t_0}, -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left|t_0 + -1\right|\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 92.86% |
|---|
| Cost | 39364 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;\mathsf{fma}\left(e^{\mathsf{log1p}\left(t_0\right) \cdot 0.6666666666666666}, \sqrt[3]{1 + t_0}, -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left|t_0 + -1\right|\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 90.34% |
|---|
| Cost | 39236 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
t_1 := t_0 + -1\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;1 + \left|t_1\right|\\
\mathbf{else}:\\
\;\;\;\;1 + {\left({\left(\sqrt[3]{\sqrt[3]{t_1}}\right)}^{3}\right)}^{3}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 90.33% |
|---|
| Cost | 26372 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;1 + \left|t_0 + -1\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\frac{1}{\sqrt[3]{t_0}}\right)}^{3}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 90.32% |
|---|
| Cost | 26116 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right)\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;1 + \left|t_0 + -1\right|\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{t_0}\right)}^{3}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 92.86% |
|---|
| Cost | 19908 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right) + -1\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;1 + \mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left|t_0\right|\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 92.86% |
|---|
| Cost | 13508 |
|---|
\[\begin{array}{l}
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;\pi \cdot 0.5 - \sin^{-1} \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left|\cos^{-1} \left(1 - x\right) + -1\right|\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 92.86% |
|---|
| Cost | 13184 |
|---|
\[\pi \cdot 0.5 - \sin^{-1} \left(1 - x\right)
\]
| Alternative 12 |
|---|
| Error | 92.86% |
|---|
| Cost | 6848 |
|---|
\[\left(1 + \cos^{-1} \left(1 - x\right)\right) + -1
\]
| Alternative 13 |
|---|
| Error | 92.86% |
|---|
| Cost | 6592 |
|---|
\[\cos^{-1} \left(1 - x\right)
\]