| Alternative 1 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 181696 |
(FPCore (x) :precision binary64 (- (/ PI 2.0) (* 2.0 (asin (sqrt (/ (- 1.0 x) 2.0))))))
(FPCore (x)
:precision binary64
(let* ((t_0 (acos (sqrt (fma -0.5 x 0.5)))) (t_1 (pow t_0 2.0)))
(/
(+ (* 0.015625 (pow PI 6.0)) (- 1.0 (exp (log1p (* 64.0 (pow t_0 6.0))))))
(*
(fma PI -0.5 (* t_0 -2.0))
(+
(* 0.0625 (* (pow PI 2.0) (pow PI 2.0)))
(* (* t_1 4.0) (fma t_1 4.0 (* (pow PI 2.0) 0.25))))))))double code(double x) {
return (((double) M_PI) / 2.0) - (2.0 * asin(sqrt(((1.0 - x) / 2.0))));
}
double code(double x) {
double t_0 = acos(sqrt(fma(-0.5, x, 0.5)));
double t_1 = pow(t_0, 2.0);
return ((0.015625 * pow(((double) M_PI), 6.0)) + (1.0 - exp(log1p((64.0 * pow(t_0, 6.0)))))) / (fma(((double) M_PI), -0.5, (t_0 * -2.0)) * ((0.0625 * (pow(((double) M_PI), 2.0) * pow(((double) M_PI), 2.0))) + ((t_1 * 4.0) * fma(t_1, 4.0, (pow(((double) M_PI), 2.0) * 0.25)))));
}
function code(x) return Float64(Float64(pi / 2.0) - Float64(2.0 * asin(sqrt(Float64(Float64(1.0 - x) / 2.0))))) end
function code(x) t_0 = acos(sqrt(fma(-0.5, x, 0.5))) t_1 = t_0 ^ 2.0 return Float64(Float64(Float64(0.015625 * (pi ^ 6.0)) + Float64(1.0 - exp(log1p(Float64(64.0 * (t_0 ^ 6.0)))))) / Float64(fma(pi, -0.5, Float64(t_0 * -2.0)) * Float64(Float64(0.0625 * Float64((pi ^ 2.0) * (pi ^ 2.0))) + Float64(Float64(t_1 * 4.0) * fma(t_1, 4.0, Float64((pi ^ 2.0) * 0.25)))))) end
code[x_] := N[(N[(Pi / 2.0), $MachinePrecision] - N[(2.0 * N[ArcSin[N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[ArcCos[N[Sqrt[N[(-0.5 * x + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, N[(N[(N[(0.015625 * N[Power[Pi, 6.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Exp[N[Log[1 + N[(64.0 * N[Power[t$95$0, 6.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(Pi * -0.5 + N[(t$95$0 * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(0.0625 * N[(N[Power[Pi, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * 4.0), $MachinePrecision] * N[(t$95$1 * 4.0 + N[(N[Power[Pi, 2.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)
\begin{array}{l}
t_0 := \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\\
t_1 := {t_0}^{2}\\
\frac{0.015625 \cdot {\pi}^{6} + \left(1 - e^{\mathsf{log1p}\left(64 \cdot {t_0}^{6}\right)}\right)}{\mathsf{fma}\left(\pi, -0.5, t_0 \cdot -2\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left(t_1 \cdot 4\right) \cdot \mathsf{fma}\left(t_1, 4, {\pi}^{2} \cdot 0.25\right)\right)}
\end{array}
| Original | 6.9% |
|---|---|
| Target | 100.0% |
| Herbie | 8.4% |
Initial program 6.9%
Applied egg-rr8.4%
[Start]6.9 | \[ \frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)
\] |
|---|---|
asin-acos [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \color{blue}{\left(\frac{\pi}{2} - \cos^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)\right)}
\] |
div-inv [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\color{blue}{\pi \cdot \frac{1}{2}} - \cos^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)\right)
\] |
metadata-eval [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\pi \cdot \color{blue}{0.5} - \cos^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)\right)
\] |
div-sub [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{\color{blue}{\frac{1}{2} - \frac{x}{2}}}\right)\right)
\] |
metadata-eval [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{\color{blue}{0.5} - \frac{x}{2}}\right)\right)
\] |
div-inv [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{0.5 - \color{blue}{x \cdot \frac{1}{2}}}\right)\right)
\] |
metadata-eval [=>]8.4 | \[ \frac{\pi}{2} - 2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{0.5 - x \cdot \color{blue}{0.5}}\right)\right)
\] |
Taylor expanded in x around 0 8.4%
Simplified8.4%
[Start]8.4 | \[ 0.5 \cdot \pi - 2 \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{0.5 - 0.5 \cdot x}\right)\right)
\] |
|---|---|
*-commutative [<=]8.4 | \[ \color{blue}{\pi \cdot 0.5} - 2 \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{0.5 - 0.5 \cdot x}\right)\right)
\] |
cancel-sign-sub-inv [=>]8.4 | \[ \pi \cdot 0.5 - 2 \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{\color{blue}{0.5 + \left(-0.5\right) \cdot x}}\right)\right)
\] |
metadata-eval [=>]8.4 | \[ \pi \cdot 0.5 - 2 \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{0.5 + \color{blue}{-0.5} \cdot x}\right)\right)
\] |
cancel-sign-sub-inv [=>]8.4 | \[ \color{blue}{\pi \cdot 0.5 + \left(-2\right) \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{0.5 + -0.5 \cdot x}\right)\right)}
\] |
metadata-eval [=>]8.4 | \[ \pi \cdot 0.5 + \color{blue}{-2} \cdot \left(0.5 \cdot \pi - \cos^{-1} \left(\sqrt{0.5 + -0.5 \cdot x}\right)\right)
\] |
*-commutative [<=]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\color{blue}{\pi \cdot 0.5} - \cos^{-1} \left(\sqrt{0.5 + -0.5 \cdot x}\right)\right)
\] |
metadata-eval [<=]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{0.5 + \color{blue}{\left(-0.5\right)} \cdot x}\right)\right)
\] |
cancel-sign-sub-inv [<=]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{\color{blue}{0.5 - 0.5 \cdot x}}\right)\right)
\] |
cancel-sign-sub-inv [=>]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{\color{blue}{0.5 + \left(-0.5\right) \cdot x}}\right)\right)
\] |
metadata-eval [=>]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{0.5 + \color{blue}{-0.5} \cdot x}\right)\right)
\] |
*-commutative [<=]8.4 | \[ \pi \cdot 0.5 + -2 \cdot \left(\pi \cdot 0.5 - \cos^{-1} \left(\sqrt{0.5 + \color{blue}{x \cdot -0.5}}\right)\right)
\] |
Applied egg-rr8.4%
[Start]8.4 | \[ \pi \cdot -0.5 - -2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)
\] |
|---|---|
flip-- [=>]8.4 | \[ \color{blue}{\frac{\left(\pi \cdot -0.5\right) \cdot \left(\pi \cdot -0.5\right) - \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right) \cdot \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right)}{\pi \cdot -0.5 + -2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)}}
\] |
flip3-- [=>]8.4 | \[ \frac{\color{blue}{\frac{{\left(\left(\pi \cdot -0.5\right) \cdot \left(\pi \cdot -0.5\right)\right)}^{3} - {\left(\left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right) \cdot \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right)\right)}^{3}}{\left(\left(\pi \cdot -0.5\right) \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\left(\pi \cdot -0.5\right) \cdot \left(\pi \cdot -0.5\right)\right) + \left(\left(\left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right) \cdot \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right)\right) \cdot \left(\left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right) \cdot \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right)\right) + \left(\left(\pi \cdot -0.5\right) \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right) \cdot \left(-2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)\right)\right)\right)}}}{\pi \cdot -0.5 + -2 \cdot \cos^{-1} \left(\sqrt{0.5 + x \cdot -0.5}\right)}
\] |
Simplified8.4%
[Start]8.4 | \[ \frac{{\left(0.25 \cdot {\pi}^{2}\right)}^{3} - {\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)}^{3}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(\left(0.25 \cdot {\pi}^{2}\right) \cdot \left(0.25 \cdot {\pi}^{2}\right) + \left(\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) + \left(0.25 \cdot {\pi}^{2}\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)\right)\right)}
\] |
|---|---|
cube-prod [=>]8.4 | \[ \frac{\color{blue}{{0.25}^{3} \cdot {\left({\pi}^{2}\right)}^{3}} - {\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)}^{3}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(\left(0.25 \cdot {\pi}^{2}\right) \cdot \left(0.25 \cdot {\pi}^{2}\right) + \left(\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) + \left(0.25 \cdot {\pi}^{2}\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)\right)\right)}
\] |
metadata-eval [=>]8.4 | \[ \frac{\color{blue}{0.015625} \cdot {\left({\pi}^{2}\right)}^{3} - {\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)}^{3}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(\left(0.25 \cdot {\pi}^{2}\right) \cdot \left(0.25 \cdot {\pi}^{2}\right) + \left(\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) + \left(0.25 \cdot {\pi}^{2}\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)\right)\right)}
\] |
cube-prod [=>]8.4 | \[ \frac{0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - \color{blue}{{\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot {4}^{3}}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(\left(0.25 \cdot {\pi}^{2}\right) \cdot \left(0.25 \cdot {\pi}^{2}\right) + \left(\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) + \left(0.25 \cdot {\pi}^{2}\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)\right)\right)}
\] |
metadata-eval [=>]8.4 | \[ \frac{0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - {\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot \color{blue}{64}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(\left(0.25 \cdot {\pi}^{2}\right) \cdot \left(0.25 \cdot {\pi}^{2}\right) + \left(\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) + \left(0.25 \cdot {\pi}^{2}\right) \cdot \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right)\right)\right)}
\] |
Applied egg-rr8.4%
[Start]8.4 | \[ \frac{0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - {\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
|---|---|
expm1-log1p-u [=>]8.4 | \[ \frac{0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64\right)\right)}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
expm1-udef [=>]8.4 | \[ \frac{0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - \color{blue}{\left(e^{\mathsf{log1p}\left({\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64\right)} - 1\right)}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
associate--r- [=>]8.4 | \[ \frac{\color{blue}{\left(0.015625 \cdot {\left({\pi}^{2}\right)}^{3} - e^{\mathsf{log1p}\left({\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64\right)}\right) + 1}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
pow-pow [=>]8.4 | \[ \frac{\left(0.015625 \cdot \color{blue}{{\pi}^{\left(2 \cdot 3\right)}} - e^{\mathsf{log1p}\left({\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64\right)}\right) + 1}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
metadata-eval [=>]8.4 | \[ \frac{\left(0.015625 \cdot {\pi}^{\color{blue}{6}} - e^{\mathsf{log1p}\left({\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}\right)}^{3} \cdot 64\right)}\right) + 1}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
pow-pow [=>]8.4 | \[ \frac{\left(0.015625 \cdot {\pi}^{6} - e^{\mathsf{log1p}\left(\color{blue}{{\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{\left(2 \cdot 3\right)}} \cdot 64\right)}\right) + 1}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
metadata-eval [=>]8.4 | \[ \frac{\left(0.015625 \cdot {\pi}^{6} - e^{\mathsf{log1p}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{\color{blue}{6}} \cdot 64\right)}\right) + 1}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
Simplified8.4%
[Start]8.4 | \[ \frac{\left(0.015625 \cdot {\pi}^{6} - e^{\mathsf{log1p}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{6} \cdot 64\right)}\right) + 1}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
|---|---|
associate-+l- [=>]8.4 | \[ \frac{\color{blue}{0.015625 \cdot {\pi}^{6} - \left(e^{\mathsf{log1p}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{6} \cdot 64\right)} - 1\right)}}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
*-commutative [=>]8.4 | \[ \frac{0.015625 \cdot {\pi}^{6} - \left(e^{\mathsf{log1p}\left(\color{blue}{64 \cdot {\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{6}}\right)} - 1\right)}{\mathsf{fma}\left(\pi, -0.5, -2 \cdot \cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)\right) \cdot \left(0.0625 \cdot \left({\pi}^{2} \cdot {\pi}^{2}\right) + \left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2} \cdot 4\right) \cdot \mathsf{fma}\left({\cos^{-1} \left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}\right)}^{2}, 4, 0.25 \cdot {\pi}^{2}\right)\right)}
\] |
Final simplification8.4%
| Alternative 1 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 181696 |
| Alternative 2 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 168896 |
| Alternative 3 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 155584 |
| Alternative 4 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 71488 |
| Alternative 5 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 45184 |
| Alternative 6 | |
|---|---|
| Accuracy | 8.4% |
| Cost | 19840 |
| Alternative 7 | |
|---|---|
| Accuracy | 5.4% |
| Cost | 19584 |
herbie shell --seed 2023137
(FPCore (x)
:name "Ian Simplification"
:precision binary64
:herbie-target
(asin x)
(- (/ PI 2.0) (* 2.0 (asin (sqrt (/ (- 1.0 x) 2.0))))))