\[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{0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) - {t_0}^{4}}{\left(\pi - \cos^{-1} \left(1 - x\right)\right) \cdot \left({\pi}^{2} \cdot 0.25 + {t_0}^{2}\right)}
\end{array}
\]
(FPCore (x) :precision binary64 (acos (- 1.0 x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (asin (- 1.0 x))))
(/
(- (* 0.0625 (* (pow PI 2.0) (pow PI 2.0))) (pow t_0 4.0))
(* (- PI (acos (- 1.0 x))) (+ (* (pow PI 2.0) 0.25) (pow t_0 2.0))))))double code(double x) {
return acos((1.0 - x));
}
↓
double code(double x) {
double t_0 = asin((1.0 - x));
return ((0.0625 * (pow(((double) M_PI), 2.0) * pow(((double) M_PI), 2.0))) - pow(t_0, 4.0)) / ((((double) M_PI) - acos((1.0 - x))) * ((pow(((double) M_PI), 2.0) * 0.25) + pow(t_0, 2.0)));
}
public static double code(double x) {
return Math.acos((1.0 - x));
}
↓
public static double code(double x) {
double t_0 = Math.asin((1.0 - x));
return ((0.0625 * (Math.pow(Math.PI, 2.0) * Math.pow(Math.PI, 2.0))) - Math.pow(t_0, 4.0)) / ((Math.PI - Math.acos((1.0 - x))) * ((Math.pow(Math.PI, 2.0) * 0.25) + Math.pow(t_0, 2.0)));
}
def code(x):
return math.acos((1.0 - x))
↓
def code(x):
t_0 = math.asin((1.0 - x))
return ((0.0625 * (math.pow(math.pi, 2.0) * math.pow(math.pi, 2.0))) - math.pow(t_0, 4.0)) / ((math.pi - math.acos((1.0 - x))) * ((math.pow(math.pi, 2.0) * 0.25) + math.pow(t_0, 2.0)))
function code(x)
return acos(Float64(1.0 - x))
end
↓
function code(x)
t_0 = asin(Float64(1.0 - x))
return Float64(Float64(Float64(0.0625 * Float64((pi ^ 2.0) * (pi ^ 2.0))) - (t_0 ^ 4.0)) / Float64(Float64(pi - acos(Float64(1.0 - x))) * Float64(Float64((pi ^ 2.0) * 0.25) + (t_0 ^ 2.0))))
end
function tmp = code(x)
tmp = acos((1.0 - x));
end
↓
function tmp = code(x)
t_0 = asin((1.0 - x));
tmp = ((0.0625 * ((pi ^ 2.0) * (pi ^ 2.0))) - (t_0 ^ 4.0)) / ((pi - acos((1.0 - x))) * (((pi ^ 2.0) * 0.25) + (t_0 ^ 2.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[(0.0625 * N[(N[Power[Pi, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[t$95$0, 4.0], $MachinePrecision]), $MachinePrecision] / N[(N[(Pi - N[ArcCos[N[(1.0 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[Pi, 2.0], $MachinePrecision] * 0.25), $MachinePrecision] + N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\cos^{-1} \left(1 - x\right)
↓
\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) - {t_0}^{4}}{\left(\pi - \cos^{-1} \left(1 - x\right)\right) \cdot \left({\pi}^{2} \cdot 0.25 + {t_0}^{2}\right)}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 10.2% |
|---|
| Cost | 78144 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\frac{{\pi}^{3} \cdot 0.125 - \mathsf{expm1}\left(\mathsf{log1p}\left({t_0}^{3}\right)\right)}{0.25 \cdot \left(\pi \cdot \pi\right) + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 10.2% |
|---|
| 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}}{0.25 \cdot \left(\pi \cdot \pi\right) + t_0 \cdot \mathsf{fma}\left(\pi, 0.5, t_0\right)}
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 10.2% |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt[3]{\sin^{-1} \left(1 - x\right)}\right)}^{3}
\]
| Alternative 4 |
|---|
| Accuracy | 10.2% |
|---|
| Cost | 26048 |
|---|
\[\pi \cdot 0.5 - {\left(\sqrt{\sin^{-1} \left(1 - x\right)}\right)}^{2}
\]
| Alternative 5 |
|---|
| Accuracy | 6.7% |
|---|
| Cost | 25920 |
|---|
\[3 \cdot \log \left(\sqrt[3]{e^{\cos^{-1} \left(1 - x\right)}}\right)
\]
| Alternative 6 |
|---|
| Accuracy | 6.7% |
|---|
| Cost | 19648 |
|---|
\[\log \left(e^{\left(1 + \cos^{-1} \left(1 - x\right)\right) + -1}\right)
\]
| Alternative 7 |
|---|
| Accuracy | 6.7% |
|---|
| Cost | 19648 |
|---|
\[\left(1 + \log \left(e^{\cos^{-1} \left(1 - x\right)}\right)\right) + -1
\]
| Alternative 8 |
|---|
| Accuracy | 6.7% |
|---|
| Cost | 6848 |
|---|
\[\left(1 + \cos^{-1} \left(1 - x\right)\right) + -1
\]
| Alternative 9 |
|---|
| Accuracy | 6.7% |
|---|
| Cost | 6592 |
|---|
\[\cos^{-1} \left(1 - x\right)
\]