1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5 /* { dg-options "-mcpu=power8 -w -std=c++14" } */
7 /* target/69667, compiler got
8 internal compiler error: Max. number of generated reload insns per insn is achieved (90) */
11 typedef int evaluation_error_type;
13 template <class T, class> T get_epsilon();
14 template <class E> __attribute__((__noreturn__)) void throw_exception(E);
15 template <class Formatter, class Group> char do_format(Formatter, Group &);
16 int raise_error_e, non_central_beta_p_k;
17 template <class, class T> void raise_error(T &p1) {
18 char msg = do_format(msg, p1);
19 throw_exception(raise_error_e);
21 char raise_evaluation_error_function;
22 template <class T1, class T2, class Policy>
23 T1 gamma_p_derivative(T1, T2, Policy);
24 template <class T, class Policy> T ibeta_imp(Policy, bool, T *);
25 template <class> struct B {};
26 template <class Dist, class RealType> B<Dist> complement(Dist, RealType);
27 template <class, class> class C;
28 template <class T, class Policy> struct D {
29 D(C<T, Policy> p1, T, bool) : dist(p1) {}
30 void operator()(T p1) { comp ? cdf(complement(dist, p1)) : T(); }
34 template <class, class = A> class C {
38 template <class RealType, class Policy> void quantile(Policy p1, RealType) {
39 nc_beta_quantile(p1, false);
41 double quantile_sanity_check___trans_tmp_1, quantile_sanity_check___trans_tmp_3,
42 quantile_sanity_check___trans_tmp_5, quantile_sanity_check___trans_tmp_7;
43 void Trans_NS_detail_raise_evaluation_error(char *, char *, long double &p3,
47 template <class T, class Policy>
48 void raise_evaluation_error(char *, T &p2, Policy) {
49 Trans_NS_detail_raise_evaluation_error(
50 &raise_evaluation_error_function, "", p2,
51 typename Policy::evaluation_error_type());
53 template <class T, class Policy>
54 T non_central_beta_p(T p1, T p2, T p3, Policy p4, T p5 = 0) {
55 T y, errtol = get_epsilon<T, Policy>(), l2,
56 pois = gamma_p_derivative(T(), l2, p4), xterm, last_term = 0;
59 T beta = y ? ibeta_imp(p4, false, &xterm) : ibeta_imp(p4, true, &xterm);
64 for (; non_central_beta_p_k;) {
66 if (errtol && last_term || beta)
69 p1 + non_central_beta_p_k - 1 / p3 * p1 + p2 + non_central_beta_p_k - 2;
72 raise_evaluation_error("", sum, p4);
74 template <class RealType, class Policy>
75 RealType non_central_beta_cdf(RealType, bool, Policy) {
77 non_central_beta_p(a, b, x, A());
79 template <class F, class T, class Tol, class Policy>
80 int bracket_and_solve_root_01(F p1, T, bool, Tol, unsigned, Policy) {
84 template <class RealType, class Policy>
85 void nc_beta_quantile(C<RealType, Policy>, bool p2) {
87 typedef RealType value_type;
88 D<value_type, Policy> f(C<value_type, Policy>(0, 0, 0), p, p2);
91 bracket_and_solve_root_01(f, value_type(), true, tol, max_iter, Policy());
93 template <class RealType, class Policy> RealType cdf(B<C<RealType, Policy>>) {
94 RealType l = non_central_beta_cdf(l, true, Policy());
96 template <typename T> void quantile_sanity_check(T) {
97 quantile(C<long double>(quantile_sanity_check___trans_tmp_1,
98 quantile_sanity_check___trans_tmp_3,
99 quantile_sanity_check___trans_tmp_5),
100 quantile_sanity_check___trans_tmp_7);
102 void test_accuracy() {
104 quantile_sanity_check(ncbeta);