\[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}\\
\frac{\frac{{\left(\pi \cdot 0.5\right)}^{6} - t_1 \cdot t_1}{t_1 + 0.125 \cdot {\pi}^{3}}}{\left(\pi \cdot 0.5\right) \cdot \left(\pi \cdot 0.5\right) + \left(t_0 \cdot t_0 + \left(\pi \cdot 0.5\right) \cdot 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)))
(/
(/ (- (pow (* PI 0.5) 6.0) (* t_1 t_1)) (+ t_1 (* 0.125 (pow PI 3.0))))
(+ (* (* PI 0.5) (* PI 0.5)) (+ (* t_0 t_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));
double t_1 = pow(t_0, 3.0);
return ((pow((((double) M_PI) * 0.5), 6.0) - (t_1 * t_1)) / (t_1 + (0.125 * pow(((double) M_PI), 3.0)))) / (((((double) M_PI) * 0.5) * (((double) M_PI) * 0.5)) + ((t_0 * t_0) + ((((double) M_PI) * 0.5) * t_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));
double t_1 = Math.pow(t_0, 3.0);
return ((Math.pow((Math.PI * 0.5), 6.0) - (t_1 * t_1)) / (t_1 + (0.125 * Math.pow(Math.PI, 3.0)))) / (((Math.PI * 0.5) * (Math.PI * 0.5)) + ((t_0 * t_0) + ((Math.PI * 0.5) * t_0)));
}
def code(x):
return math.acos((1.0 - x))
↓
def code(x):
t_0 = math.asin((1.0 - x))
t_1 = math.pow(t_0, 3.0)
return ((math.pow((math.pi * 0.5), 6.0) - (t_1 * t_1)) / (t_1 + (0.125 * math.pow(math.pi, 3.0)))) / (((math.pi * 0.5) * (math.pi * 0.5)) + ((t_0 * t_0) + ((math.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
return Float64(Float64(Float64((Float64(pi * 0.5) ^ 6.0) - Float64(t_1 * t_1)) / Float64(t_1 + Float64(0.125 * (pi ^ 3.0)))) / Float64(Float64(Float64(pi * 0.5) * Float64(pi * 0.5)) + Float64(Float64(t_0 * t_0) + Float64(Float64(pi * 0.5) * t_0))))
end
function tmp = code(x)
tmp = acos((1.0 - x));
end
↓
function tmp = code(x)
t_0 = asin((1.0 - x));
t_1 = t_0 ^ 3.0;
tmp = ((((pi * 0.5) ^ 6.0) - (t_1 * t_1)) / (t_1 + (0.125 * (pi ^ 3.0)))) / (((pi * 0.5) * (pi * 0.5)) + ((t_0 * t_0) + ((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]}, N[(N[(N[(N[Power[N[(Pi * 0.5), $MachinePrecision], 6.0], $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(0.125 * N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(Pi * 0.5), $MachinePrecision] * N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(N[(Pi * 0.5), $MachinePrecision] * 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}\\
\frac{\frac{{\left(\pi \cdot 0.5\right)}^{6} - t_1 \cdot t_1}{t_1 + 0.125 \cdot {\pi}^{3}}}{\left(\pi \cdot 0.5\right) \cdot \left(\pi \cdot 0.5\right) + \left(t_0 \cdot t_0 + \left(\pi \cdot 0.5\right) \cdot t_0\right)}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 57.5 |
|---|
| Cost | 85248 |
|---|
\[\begin{array}{l}
t_0 := {\left(\pi \cdot 0.5\right)}^{1.5}\\
t_1 := \sin^{-1} \left(1 - x\right)\\
\frac{\mathsf{fma}\left(t_0, t_0, -{t_1}^{3}\right)}{\left(\pi \cdot 0.5\right) \cdot \left(\pi \cdot 0.5\right) + \left(t_1 \cdot t_1 + \left(\pi \cdot 0.5\right) \cdot t_1\right)}
\end{array}
\]
| Alternative 2 |
|---|
| Error | 57.5 |
|---|
| Cost | 72128 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
t_1 := {t_0}^{2}\\
\frac{\mathsf{fma}\left(-t_0, t_0, t_1\right) + \left(0.25 \cdot {\pi}^{2} - t_1\right)}{\pi \cdot 0.5 + t_0}
\end{array}
\]
| Alternative 3 |
|---|
| Error | 57.5 |
|---|
| Cost | 65856 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
t_1 := \pi \cdot 0.5 + t_0\\
\frac{\mathsf{fma}\left(-t_0, t_0, {t_0}^{2}\right) + t_1 \cdot \cos^{-1} \left(1 - x\right)}{t_1}
\end{array}
\]
| Alternative 4 |
|---|
| Error | 57.5 |
|---|
| Cost | 52288 |
|---|
\[\begin{array}{l}
t_0 := \sin^{-1} \left(1 - x\right)\\
\cos^{-1} \left(1 - x\right) + \mathsf{fma}\left(0 - {t_0}^{0.3333333333333333}, {\left(\sqrt[3]{t_0}\right)}^{2}, t_0\right)
\end{array}
\]
| Alternative 5 |
|---|
| Error | 57.5 |
|---|
| Cost | 38848 |
|---|
\[\log \left(e^{\pi \cdot 0.5 - {\left(\sqrt[3]{\sin^{-1} \left(1 - x\right)}\right)}^{3}}\right)
\]
| Alternative 6 |
|---|
| Error | 57.5 |
|---|
| Cost | 32640 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{\sin^{-1} \left(1 - x\right)}\\
\pi \cdot 0.5 - t_0 \cdot t_0
\end{array}
\]
| Alternative 7 |
|---|
| Error | 58.1 |
|---|
| Cost | 32580 |
|---|
\[\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}:\\
\;\;\;\;3 \cdot \log \left(\sqrt[3]{e^{t_0}}\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 58.1 |
|---|
| Cost | 26628 |
|---|
\[\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 + \frac{1}{{\left(\frac{1}{\sqrt[3]{t_1}}\right)}^{3}}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 58.1 |
|---|
| Cost | 26308 |
|---|
\[\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}:\\
\;\;\;\;1 + \left(-1 + \log \left(e^{t_0}\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 58.1 |
|---|
| Cost | 26052 |
|---|
\[\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}:\\
\;\;\;\;\log \left(e^{t_0}\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 59.7 |
|---|
| Cost | 19972 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(1 - x\right) + -1\\
\mathbf{if}\;1 - x \leq 1:\\
\;\;\;\;1 + {\left(\sqrt[3]{t_0}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;1 + \left|t_0\right|\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 58.1 |
|---|
| Cost | 19908 |
|---|
\[\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 + \frac{1}{\frac{1}{t_1}}\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 59.7 |
|---|
| Cost | 7104 |
|---|
\[1 + \frac{1}{\frac{1}{\cos^{-1} \left(1 - x\right) + -1}}
\]
| Alternative 14 |
|---|
| Error | 59.7 |
|---|
| Cost | 6848 |
|---|
\[1 + \left(\cos^{-1} \left(1 - x\right) + -1\right)
\]
| Alternative 15 |
|---|
| Error | 59.7 |
|---|
| Cost | 6592 |
|---|
\[\cos^{-1} \left(1 - x\right)
\]